https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
38public:
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
73private:
76
82
87 std::unordered_map<const Node *, Real> _nodal_void_volume;
88
90 const processor_id_type _my_pid;
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};
const InputParameters & parameters() const
Computes the void volume associated with each node.
void rebuildStructures()
reinitialize _nodal_void_volume and rebuild MPI communication lists of this object
std::unordered_map< const Node *, Real > _nodal_void_volume
_nodal_void_volume[node] = void volume of the node.
virtual void timestepSetup() override
If _rebuilding_needed then rebuildStructures()
bool _rebuilding_needed
whether reinitializing of _nodal_void_volume and rebuilding MPI communication lists is needed,...
virtual void finalize() override
If there are more than 1 processor, call exchangeGhostedInfo.
static InputParameters validParams()
virtual void initialSetup() override
void buildCommLists()
Build MPI communication lists specifying which _nodal_void_volume info should be exchanged with other...
virtual void meshChanged() override
Set _rebuilding_needed = true to signal that the internal datastructures need rebuilding.
const VariablePhiValue & _phi
shape function
std::map< processor_id_type, std::vector< const Node * > > _nodes_to_send
_nodes_to_send[proc_id] = list of my nodes.
virtual void execute() override
Loops over all elements owned by this processor, computing the sum specified above.
const VariableValue & _porosity
porosity
virtual void threadJoin(const UserObject &uo) override
Adds _nodal_void_volume from all threads that have looped over different elements in their execute().
const processor_id_type _my_pid
processor ID of this object
std::map< processor_id_type, std::vector< const Node * > > _nodes_to_receive
_nodes_to_receive[proc_id] = list of my nodes.
virtual void initialize() override
Zeroes _nodal_void_volume.
Real getNodalVoidVolume(const Node *node) const
void exchangeGhostedInfo()
Exchange _nodal_void_volume for nodes that are joined to elements owned by other processors.
VariableValueTempl< false > VariableValue
VariableShapeValue< false > VariablePhiValue