https://mooseframework.inl.gov
NodalVoidVolume.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "ElementUserObject.h"
13 
37 {
38 public:
41 
43  virtual void initialize() override;
44 
48  virtual void execute() override;
49 
55  virtual void threadJoin(const UserObject & uo) override;
56 
58  virtual void finalize() override;
59 
61  virtual void meshChanged() override;
62 
64  virtual void timestepSetup() override;
65  virtual void initialSetup() override;
66 
67  /*
68  * @return the void volume
69  * @param node_id the node ID
70  */
71  Real getNodalVoidVolume(const Node * node) const;
72 
73 private:
76 
82 
87  std::unordered_map<const Node *, Real> _nodal_void_volume;
88 
91 
98  std::map<processor_id_type, std::vector<const Node *>> _nodes_to_receive;
99 
106  std::map<processor_id_type, std::vector<const Node *>> _nodes_to_send;
107 
110 
114  void rebuildStructures();
115 
120  void buildCommLists();
121 
127  void exchangeGhostedInfo();
128 };
Computes the void volume associated with each node.
Real getNodalVoidVolume(const Node *node) const
virtual void threadJoin(const UserObject &uo) override
Adds _nodal_void_volume from all threads that have looped over different elements in their execute()...
void rebuildStructures()
reinitialize _nodal_void_volume and rebuild MPI communication lists of this object ...
virtual void initialize() override
Zeroes _nodal_void_volume.
std::unordered_map< const Node *, Real > _nodal_void_volume
_nodal_void_volume[node] = void volume of the node.
OutputTools< Real >::VariablePhiValue VariablePhiValue
std::map< processor_id_type, std::vector< const Node * > > _nodes_to_send
_nodes_to_send[proc_id] = list of my nodes.
void buildCommLists()
Build MPI communication lists specifying which _nodal_void_volume info should be exchanged with other...
std::map< processor_id_type, std::vector< const Node * > > _nodes_to_receive
_nodes_to_receive[proc_id] = list of my nodes.
const processor_id_type _my_pid
processor ID of this object
virtual void timestepSetup() override
If _rebuilding_needed then rebuildStructures()
uint8_t processor_id_type
void exchangeGhostedInfo()
Exchange _nodal_void_volume for nodes that are joined to elements owned by other processors.
const VariablePhiValue & _phi
shape function
bool _rebuilding_needed
whether reinitializing of _nodal_void_volume and rebuilding MPI communication lists is needed...
virtual void execute() override
Loops over all elements owned by this processor, computing the sum specified above.
virtual void initialSetup() override
OutputTools< Real >::VariableValue VariableValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void finalize() override
If there are more than 1 processor, call exchangeGhostedInfo.
const InputParameters & parameters() const
const VariableValue & _porosity
porosity
NodalVoidVolume(const InputParameters &parameters)
static InputParameters validParams()
virtual void meshChanged() override
Set _rebuilding_needed = true to signal that the internal datastructures need rebuilding.