https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ConstraintWarehouse Class Reference

Warehouse for storing constraints. More...

#include <ConstraintWarehouse.h>

Inheritance diagram for ConstraintWarehouse:
[legend]

Public Member Functions

 ConstraintWarehouse ()
 
void addObject (std::shared_ptr< Constraint > object, THREAD_ID tid=0, bool recurse=true) override
 Add Constraint object to the warehouse. More...
 
void subdomainsCovered (std::set< SubdomainID > &subdomains_covered, std::set< std::string > &unique_variables, THREAD_ID tid=0) const
 Update supplied subdomain and variable coverate containters. More...
 
void updateActive (THREAD_ID tid=0) override
 Update the various active lists. More...
 
virtual void residualEnd (THREAD_ID tid=0) const
 
bool hasVariableObjects (unsigned int variable_id, THREAD_ID tid=0) const
 Checks for whether this warehouse has objects for a given variable. More...
 
unsigned int size (THREAD_ID tid=0) const
 Return how many kernels we store in the current warehouse. More...
 
bool hasObjectsForVariableAndBlocks (const VariableName &var_name, const std::set< SubdomainID > &blocks, std::set< SubdomainID > &blocks_covered, THREAD_ID tid) const
 Whether there are objects for this variable and the set of blocks passed. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
const std::vector< std::shared_ptr< Constraint > > & getObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable. More...
 
void sort (THREAD_ID tid=0)
 Sort the objects using the DependencyResolver. More...
 
THREAD_ID numThreads () const
 Return the number of threads. More...
 
std::string activeObjectsToFormattedString (THREAD_ID tid=0, const std::string &prefix="[DBG]") const
 Output the active content of the warehouse to a string, meant to be output to the console. More...
 
const std::vector< std::shared_ptr< NodalConstraint > > & getActiveNodalConstraints () const
 Access methods for active objects. More...
 
const std::vector< std::shared_ptr< MortarConstraintBase > > & getActiveMortarConstraints (const std::pair< BoundaryID, BoundaryID > &mortar_interface_key, bool displaced) const
 
const std::vector< std::shared_ptr< ElemElemConstraint > > & getActiveElemElemConstraints (InterfaceID interface_id, bool displaced) const
 
const std::vector< std::shared_ptr< NodeFaceConstraint > > & getActiveNodeFaceConstraints (BoundaryID boundary_id, bool displaced) const
 
const std::vector< std::shared_ptr< NodeElemConstraintBase > > & getActiveNodeElemConstraints (SubdomainID secondary_id, SubdomainID primary_id, bool displaced) const
 
bool hasActiveNodalConstraints () const
 Deterimine if active objects exist. More...
 
bool hasActiveMortarConstraints (const std::pair< BoundaryID, BoundaryID > &mortar_interface_key, bool displaced) const
 
bool hasActiveElemElemConstraints (const InterfaceID interface_id, bool displaced) const
 
bool hasActiveNodeFaceConstraints (BoundaryID boundary_id, bool displaced) const
 
bool hasActiveNodeElemConstraints (SubdomainID secondary_id, SubdomainID primary_id, bool displaced) const
 
virtual void initialSetup (THREAD_ID tid=0) const
 Convenience methods for calling object setup methods. More...
 
virtual void timestepSetup (THREAD_ID tid=0) const
 
virtual void customSetup (const ExecFlagType &exec_type, THREAD_ID tid=0) const
 
virtual void subdomainSetup (THREAD_ID tid=0) const
 
virtual void subdomainSetup (SubdomainID id, THREAD_ID tid=0) const
 
virtual void jacobianSetup (THREAD_ID tid=0) const
 
virtual void residualSetup (THREAD_ID tid=0) const
 
bool hasActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 Methods for checking/getting variable kernels for a variable and SubdomainID. More...
 
const std::vector< std::shared_ptr< Constraint > > & getActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getActiveObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the active all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Constraint > > & getActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasObjects (THREAD_ID tid=0) const
 Convenience functions for determining if objects exist. More...
 
bool hasActiveObjects (THREAD_ID tid=0) const
 
bool hasObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 
bool hasActiveBlockObjects (THREAD_ID tid=0) const
 
bool hasActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasBoundaryObjects (THREAD_ID tid=0) const
 
bool hasBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasActiveObject (const std::string &name, THREAD_ID tid=0) const
 Convenience functions for checking/getting specific objects. More...
 
std::shared_ptr< ConstraintgetObject (const std::string &name, THREAD_ID tid=0) const
 
std::shared_ptr< ConstraintgetActiveObject (const std::string &name, THREAD_ID tid=0) const
 
void updateVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateFEVariableCoupledVectorTagDependency (std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects. More...
 
void updateBlockFEVariableCoupledVectorTagDependency (SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
void updateBoundaryFEVariableCoupledVectorTagDependency (BoundaryID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 

Protected Member Functions

virtual void updateMatPropDependencyHelper (std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects, const bool producer_only) const
 Helper method for updating material property dependency vector. More...
 
void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. More...
 
bool hasBoundaryObjectsHelper (const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint >>>> &boundary_objects, const THREAD_ID tid=0) const
 Helper for determining whether we have boundary objects. More...
 

Static Protected Member Functions

static void updateActiveHelper (std::vector< std::shared_ptr< Constraint >> &active, const std::vector< std::shared_ptr< Constraint >> &all)
 Helper method for updating active vectors. More...
 
static void sortHelper (std::vector< std::shared_ptr< Constraint >> &objects)
 Helper method for sorting vectors of objects. More...
 
static void updateVariableDependencyHelper (std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
 Helper method for updating variable dependency vector. More...
 
static void updateFEVariableCoupledVectorTagDependencyHelper (std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< Constraint >> &objects)
 Helper method for updating FE variable coupleable vector tag vector. More...
 

Protected Attributes

MooseObjectWarehouse< NodalConstraint_nodal_constraints
 NodalConstraint objects. More...
 
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
 NodeFaceConstraint objects (non-displaced) More...
 
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
 NodeFaceConstraint objects (displaced) More...
 
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _mortar_constraints
 Undisplaced MortarConstraints. More...
 
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _displaced_mortar_constraints
 Displaced MortarConstraints. More...
 
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
 ElemElemConstraints (non-displaced) More...
 
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _displaced_element_constraints
 ElemElemConstraints (displaced) More...
 
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _node_elem_constraints
 NodeElemConstraint objects. More...
 
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _displaced_node_elem_constraints
 NodeElemConstraint objects. More...
 
std::map< unsigned int, MooseObjectWarehouse< Constraint > > _variable_objects
 Variable based storage. More...
 
const THREAD_ID _num_threads
 Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) More...
 
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector) More...
 
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
 All active objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _all_block_objects
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
 Active block restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
 Active boundary restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< VariableName, std::vector< std::shared_ptr< Constraint > > > > _all_variable_objects
 All objects with a certain variable selected, as the 'variable' parameter. More...
 

Detailed Description

Warehouse for storing constraints.

Definition at line 26 of file ConstraintWarehouse.h.

Constructor & Destructor Documentation

◆ ConstraintWarehouse()

ConstraintWarehouse::ConstraintWarehouse ( )

Definition at line 21 of file ConstraintWarehouse.C.

Member Function Documentation

◆ activeObjectsToFormattedString()

std::string MooseObjectWarehouseBase< Constraint >::activeObjectsToFormattedString ( THREAD_ID  tid = 0,
const std::string &  prefix = "[DBG]" 
) const
inherited

Output the active content of the warehouse to a string, meant to be output to the console.

Parameters
tidthe thread id
prefixa string to prepend to the string

Definition at line 898 of file MooseObjectWarehouseBase.h.

900 {
901  std::vector<std::string> output;
902  for (const auto & object : _active_objects[tid])
903  output.push_back(object->name());
904  return ConsoleUtils::formatString(MooseUtils::join(output, " "), prefix);
905 }
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
Definition: ConsoleUtils.C:583
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ addObject()

void ConstraintWarehouse::addObject ( std::shared_ptr< Constraint object,
THREAD_ID  tid = 0,
bool  recurse = true 
)
overridevirtual

Add Constraint object to the warehouse.

Parameters
objectA std::shared_ptr of the object
tidNot used.

Reimplemented from MooseObjectWarehouse< Constraint >.

Definition at line 24 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::addConstraint().

27 {
28  // Adds to the storage of _all_objects
30 
31  // Cast the the possible Contraint types
32  std::shared_ptr<NodeFaceConstraint> nfc = std::dynamic_pointer_cast<NodeFaceConstraint>(object);
33  std::shared_ptr<MortarConstraintBase> mc =
35  std::shared_ptr<NodalConstraint> nc = std::dynamic_pointer_cast<NodalConstraint>(object);
36  std::shared_ptr<ElemElemConstraint> ec = std::dynamic_pointer_cast<ElemElemConstraint>(object);
37  std::shared_ptr<NodeElemConstraintBase> nec =
39 
40  // NodeFaceConstraint
41  if (nfc)
42  {
43  MooseMesh & mesh = nfc->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
44  unsigned int secondary = mesh.getBoundaryID(nfc->getParam<BoundaryName>("secondary"));
45  bool displaced = nfc->parameters().have_parameter<bool>("use_displaced_mesh") &&
46  nfc->getParam<bool>("use_displaced_mesh");
47 
48  if (displaced)
49  _displaced_node_face_constraints[secondary].addObject(nfc);
50  else
51  _node_face_constraints[secondary].addObject(nfc);
52  }
53 
54  // MortarConstraint
55  else if (mc)
56  {
57  MooseMesh & mesh = mc->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
58  bool displaced = mc->getParam<bool>("use_displaced_mesh");
59 
60  auto secondary_boundary_id =
61  mesh.getBoundaryID(mc->getParam<BoundaryName>("secondary_boundary"));
62  auto primary_boundary_id = mesh.getBoundaryID(mc->getParam<BoundaryName>("primary_boundary"));
63  auto key = std::make_pair(primary_boundary_id, secondary_boundary_id);
64 
65  if (displaced)
66  _displaced_mortar_constraints[key].addObject(mc);
67  else
68  _mortar_constraints[key].addObject(mc);
69  }
70 
71  // ElemElemConstraint
72  else if (ec)
73  {
74  bool displaced = ec->parameters().have_parameter<bool>("use_displaced_mesh") &&
75  ec->getParam<bool>("use_displaced_mesh");
76  const InterfaceID interface_id = ec->getInterfaceID();
77 
78  if (displaced)
79  _displaced_element_constraints[interface_id].addObject(ec);
80  else
81  _element_constraints[interface_id].addObject(ec);
82  }
83 
84  // NodeElemConstraintBase
85  else if (nec)
86  {
87  MooseMesh & mesh = nec->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
88  SubdomainID secondary = mesh.getSubdomainID(nec->getParam<SubdomainName>("secondary"));
89  SubdomainID primary = mesh.getSubdomainID(nec->getParam<SubdomainName>("primary"));
90  bool displaced = nec->parameters().have_parameter<bool>("use_displaced_mesh") &&
91  nec->getParam<bool>("use_displaced_mesh");
92 
93  if (displaced)
94  _displaced_node_elem_constraints[std::make_pair(secondary, primary)].addObject(nec);
95  else
96  _node_elem_constraints[std::make_pair(secondary, primary)].addObject(nec);
97  }
98 
99  // NodalConstraint
100  else if (nc)
102 
103  else
104  mooseError("Unknown type of Constraint object");
105 }
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _displaced_mortar_constraints
Displaced MortarConstraints.
User for mortar methods.
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _displaced_node_elem_constraints
NodeElemConstraint objects.
MeshBase & mesh
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:93
unsigned int InterfaceID
Definition: MooseTypes.h:234
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _node_elem_constraints
NodeElemConstraint objects.
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _displaced_element_constraints
ElemElemConstraints (displaced)
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _mortar_constraints
Undisplaced MortarConstraints.
A NodeElemConstraintBase is used when you need to create constraints between a secondary node and a p...
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
NodeFaceConstraint objects (non-displaced)

◆ checkThreadID()

void MooseObjectWarehouseBase< Constraint >::checkThreadID ( THREAD_ID  tid) const
inlineprotectedinherited

Calls assert on thread id.

Definition at line 929 of file MooseObjectWarehouseBase.h.

Referenced by residualEnd().

930 {
931  mooseAssert(tid < _num_threads,
932  "Attempting to access a thread id ("
933  << tid << ") greater than the number allowed by the storage item ("
934  << _num_threads << ")");
935 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ customSetup()

void MooseObjectWarehouse< Constraint >::customSetup ( const ExecFlagType exec_type,
THREAD_ID  tid = 0 
) const
virtualinherited

Definition at line 176 of file MooseObjectWarehouse.h.

177 {
178  checkThreadID(tid);
179  for (const auto & object : _active_objects[tid])
180  object->customSetup(exec_type);
181 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveBlockObjects() [1/2]

const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & MooseObjectWarehouseBase< Constraint >::getActiveBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 469 of file MooseObjectWarehouseBase.h.

470 {
471  checkThreadID(tid);
472  return _active_block_objects[tid];
473 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBlockObjects() [2/2]

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 477 of file MooseObjectWarehouseBase.h.

478 {
479  checkThreadID(tid);
480  const auto iter = _active_block_objects[tid].find(id);
481  mooseAssert(iter != _active_block_objects[tid].end(),
482  "Unable to located active block objects for the given id: " << id << ".");
483  return iter->second;
484 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBlocks()

std::set< SubdomainID > MooseObjectWarehouseBase< Constraint >::getActiveBlocks ( THREAD_ID  tid = 0) const
inherited

Return a set of active SubdomainsIDs.

Definition at line 649 of file MooseObjectWarehouseBase.h.

650 {
651  checkThreadID(tid);
652  std::set<SubdomainID> ids;
653  for (const auto & object_pair : _active_block_objects[tid])
654  ids.insert(object_pair.first);
655  return ids;
656 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBoundaryObjects() [1/2]

const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & MooseObjectWarehouseBase< Constraint >::getActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 450 of file MooseObjectWarehouseBase.h.

451 {
452  checkThreadID(tid);
453  return _active_boundary_objects[tid];
454 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveBoundaryObjects() [2/2]

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 458 of file MooseObjectWarehouseBase.h.

459 {
460  checkThreadID(tid);
461  const auto iter = _active_boundary_objects[tid].find(id);
462  mooseAssert(iter != _active_boundary_objects[tid].end(),
463  "Unable to located active boundary objects for the given id: " << id << ".");
464  return iter->second;
465 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveElemElemConstraints()

const std::vector< std::shared_ptr< ElemElemConstraint > > & ConstraintWarehouse::getActiveElemElemConstraints ( InterfaceID  interface_id,
bool  displaced 
) const

Definition at line 172 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), and NonlinearSystemBase::constraintResiduals().

174 {
175  std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint>>::const_iterator it, end_it;
176 
177  if (displaced)
178  {
179  it = _displaced_element_constraints.find(interface_id);
180  end_it = _displaced_element_constraints.end();
181  }
182 
183  else
184  {
185  it = _element_constraints.find(interface_id);
186  end_it = _element_constraints.end();
187  }
188 
189  mooseAssert(it != end_it,
190  "Unable to locate storage for ElemElemConstraint objects for the given interface id: "
191  << interface_id);
192  return it->second.getActiveObjects();
193 }
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _displaced_element_constraints
ElemElemConstraints (displaced)

◆ getActiveMortarConstraints()

const std::vector< std::shared_ptr< MortarConstraintBase > > & ConstraintWarehouse::getActiveMortarConstraints ( const std::pair< BoundaryID, BoundaryID > &  mortar_interface_key,
bool  displaced 
) const

Definition at line 145 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::initialSetup().

147 {
148  std::map<std::pair<BoundaryID, BoundaryID>,
149  MooseObjectWarehouse<MortarConstraintBase>>::const_iterator it,
150  end_it;
151 
152  if (displaced)
153  {
154  it = _displaced_mortar_constraints.find(mortar_interface_key);
155  end_it = _displaced_mortar_constraints.end();
156  }
157  else
158  {
159  it = _mortar_constraints.find(mortar_interface_key);
160  end_it = _mortar_constraints.end();
161  }
162 
163  mooseAssert(
164  it != end_it,
165  "No MortarConstraints exist for the specified primary-secondary boundary pair, primary "
166  << mortar_interface_key.first << " and secondary " << mortar_interface_key.second);
167 
168  return it->second.getActiveObjects();
169 }
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _displaced_mortar_constraints
Displaced MortarConstraints.
A storage container for MooseObjects that inherit from SetupInterface.
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _mortar_constraints
Undisplaced MortarConstraints.

◆ getActiveNodalConstraints()

const std::vector< std::shared_ptr< NodalConstraint > > & ConstraintWarehouse::getActiveNodalConstraints ( ) const

Access methods for active objects.

Definition at line 108 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::enforceNodalConstraintsJacobian(), NonlinearSystemBase::enforceNodalConstraintsResidual(), and NonlinearSystemBase::findImplicitGeometricCouplingEntries().

109 {
111 }
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...

◆ getActiveNodeElemConstraints()

const std::vector< std::shared_ptr< NodeElemConstraintBase > > & ConstraintWarehouse::getActiveNodeElemConstraints ( SubdomainID  secondary_id,
SubdomainID  primary_id,
bool  displaced 
) const

Definition at line 196 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), and NonlinearSystemBase::setConstraintSecondaryValues().

199 {
200  std::map<std::pair<SubdomainID, SubdomainID>,
202  end_it;
203 
204  if (displaced)
205  {
206  it = _displaced_node_elem_constraints.find(std::make_pair(secondary_id, primary_id));
207  end_it = _displaced_node_elem_constraints.end();
208  }
209  else
210  {
211  it = _node_elem_constraints.find(std::make_pair(secondary_id, primary_id));
212  end_it = _node_elem_constraints.end();
213  }
214 
215  mooseAssert(
216  it != end_it,
217  "Unable to locate storage for NodeElemConstraintBase objects for the given secondary and "
218  "primary id pair: ["
219  << secondary_id << ", " << primary_id << "]");
220  return it->second.getActiveObjects();
221 }
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _displaced_node_elem_constraints
NodeElemConstraint objects.
A storage container for MooseObjects that inherit from SetupInterface.
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _node_elem_constraints
NodeElemConstraint objects.

◆ getActiveNodeFaceConstraints()

const std::vector< std::shared_ptr< NodeFaceConstraint > > & ConstraintWarehouse::getActiveNodeFaceConstraints ( BoundaryID  boundary_id,
bool  displaced 
) const

Definition at line 114 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), NonlinearSystemBase::overwriteNodeFace(), and NonlinearSystemBase::setConstraintSecondaryValues().

115 {
116  std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint>>::const_iterator it, end_it;
117 
118  if (displaced)
119  {
120  it = _displaced_node_face_constraints.find(boundary_id);
121  end_it = _displaced_node_face_constraints.end();
122  }
123 
124  else
125  {
126  it = _node_face_constraints.find(boundary_id);
127  end_it = _node_face_constraints.end();
128  }
129 
130  mooseAssert(it != end_it,
131  "Unable to locate storage for NodeFaceConstraint objects for the given boundary id: "
132  << boundary_id);
133  return it->second.getActiveObjects();
134 }
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
NodeFaceConstraint objects (non-displaced)

◆ getActiveObject()

std::shared_ptr< Constraint > MooseObjectWarehouseBase< Constraint >::getActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 630 of file MooseObjectWarehouseBase.h.

631 {
632  checkThreadID(tid);
633  for (const auto & object : _active_objects[tid])
634  if (object->name() == name)
635  return object;
636  mooseError("Unable to locate active object: ", name, ".");
637 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveObjects()

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getActiveObjects ( THREAD_ID  tid = 0) const
inlineinherited

Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.

Parameters
tidThe thread id to retrieve objects from

Definition at line 442 of file MooseObjectWarehouseBase.h.

443 {
444  checkThreadID(tid);
445  return _active_objects[tid];
446 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveVariableBlockObjects()

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouse< Constraint >::getActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 143 of file MooseObjectWarehouse.h.

146 {
147  checkThreadID(tid);
148  const auto iter = _variable_objects.find(variable_id);
149  mooseAssert(iter != _variable_objects.end(),
150  "Unable to locate variable kernels for the given variable id: " << variable_id
151  << ".");
152  return iter->second.getActiveBlockObjects(block_id, tid);
153 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< unsigned int, MooseObjectWarehouse< Constraint > > _variable_objects
Variable based storage.

◆ getBlockObjects() [1/2]

const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & MooseObjectWarehouseBase< Constraint >::getBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 423 of file MooseObjectWarehouseBase.h.

424 {
425  checkThreadID(tid);
426  return _all_block_objects[tid];
427 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBlockObjects() [2/2]

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 431 of file MooseObjectWarehouseBase.h.

432 {
433  checkThreadID(tid);
434  const auto iter = _all_block_objects[tid].find(id);
435  mooseAssert(iter != _all_block_objects[tid].end(),
436  "Unable to located active block objects for the given id: " << id << ".");
437  return iter->second;
438 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBoundaryObjects() [1/2]

const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & MooseObjectWarehouseBase< Constraint >::getBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 396 of file MooseObjectWarehouseBase.h.

397 {
398  checkThreadID(tid);
399  return _all_boundary_objects[tid];
400 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/2]

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 412 of file MooseObjectWarehouseBase.h.

413 {
414  checkThreadID(tid);
415  const auto iter = _all_boundary_objects[tid].find(id);
416  mooseAssert(iter != _all_boundary_objects[tid].end(),
417  "Unable to located active boundary objects for the given id: " << id << ".");
418  return iter->second;
419 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects

◆ getObject()

std::shared_ptr< Constraint > MooseObjectWarehouseBase< Constraint >::getObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 619 of file MooseObjectWarehouseBase.h.

620 {
621  checkThreadID(tid);
622  for (const auto & object : _all_objects[tid])
623  if (object->name() == name)
624  return object;
625  mooseError("Unable to locate object: ", name, ".");
626 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getObjects()

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getObjects ( THREAD_ID  tid = 0) const
inlineinherited

Retrieve complete vector to the all/block/boundary restricted objects for a given thread.

Parameters
tidThe thread id to retrieve objects from

Definition at line 388 of file MooseObjectWarehouseBase.h.

389 {
390  checkThreadID(tid);
391  return _all_objects[tid];
392 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getObjectsForVariable()

const std::vector< std::shared_ptr< Constraint > > & MooseObjectWarehouseBase< Constraint >::getObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable.

Definition at line 641 of file MooseObjectWarehouseBase.h.

643 {
644  return libmesh_map_find(_all_variable_objects[tid], var_name);
645 }
std::vector< std::map< VariableName, std::vector< std::shared_ptr< Constraint > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.

◆ hasActiveBlockObjects() [1/2]

bool MooseObjectWarehouseBase< Constraint >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 552 of file MooseObjectWarehouseBase.h.

553 {
554  checkThreadID(tid);
555  bool has_active_block_objects = false;
556  for (const auto & object_pair : _active_block_objects[tid])
557  has_active_block_objects |= !(object_pair.second.empty());
558  return has_active_block_objects;
559 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBlockObjects() [2/2]

bool MooseObjectWarehouseBase< Constraint >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 563 of file MooseObjectWarehouseBase.h.

564 {
565  checkThreadID(tid);
566  const auto iter = _active_block_objects[tid].find(id);
567  return iter != _active_block_objects[tid].end();
568 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBoundaryObjects() [1/2]

bool MooseObjectWarehouseBase< Constraint >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 592 of file MooseObjectWarehouseBase.h.

593 {
595 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
bool hasBoundaryObjectsHelper(const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint >>>> &boundary_objects, const THREAD_ID tid=0) const
Helper for determining whether we have boundary objects.

◆ hasActiveBoundaryObjects() [2/2]

bool MooseObjectWarehouseBase< Constraint >::hasActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 599 of file MooseObjectWarehouseBase.h.

600 {
601  checkThreadID(tid);
602  const auto iter = _active_boundary_objects[tid].find(id);
603  return iter != _active_boundary_objects[tid].end();
604 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveElemElemConstraints()

bool ConstraintWarehouse::hasActiveElemElemConstraints ( const InterfaceID  interface_id,
bool  displaced 
) const

Definition at line 230 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), and NonlinearSystemBase::constraintResiduals().

232 {
233  std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint>>::const_iterator it, end_it;
234 
235  if (displaced)
236  {
237  it = _displaced_element_constraints.find(interface_id);
238  end_it = _displaced_element_constraints.end();
239  }
240 
241  else
242  {
243  it = _element_constraints.find(interface_id);
244  end_it = _element_constraints.end();
245  }
246 
247  return (it != end_it && it->second.hasActiveObjects());
248 }
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _displaced_element_constraints
ElemElemConstraints (displaced)

◆ hasActiveMortarConstraints()

bool ConstraintWarehouse::hasActiveMortarConstraints ( const std::pair< BoundaryID, BoundaryID > &  mortar_interface_key,
bool  displaced 
) const

Definition at line 137 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::initialSetup().

139 {
140  const auto & constraints = displaced ? _displaced_mortar_constraints : _mortar_constraints;
141  return constraints.find(mortar_interface_key) != constraints.end();
142 }
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _displaced_mortar_constraints
Displaced MortarConstraints.
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _mortar_constraints
Undisplaced MortarConstraints.

◆ hasActiveNodalConstraints()

bool ConstraintWarehouse::hasActiveNodalConstraints ( ) const

Deterimine if active objects exist.

Definition at line 224 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::enforceNodalConstraintsJacobian(), and NonlinearSystemBase::enforceNodalConstraintsResidual().

225 {
227 }
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
bool hasActiveObjects(THREAD_ID tid=0) const

◆ hasActiveNodeElemConstraints()

bool ConstraintWarehouse::hasActiveNodeElemConstraints ( SubdomainID  secondary_id,
SubdomainID  primary_id,
bool  displaced 
) const

Definition at line 271 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), and NonlinearSystemBase::setConstraintSecondaryValues().

274 {
275  std::map<std::pair<SubdomainID, SubdomainID>,
277  end_it;
278 
279  if (displaced)
280  {
281  it = _displaced_node_elem_constraints.find(std::make_pair(secondary_id, primary_id));
282  end_it = _displaced_node_elem_constraints.end();
283  }
284 
285  else
286  {
287  it = _node_elem_constraints.find(std::make_pair(secondary_id, primary_id));
288  end_it = _node_elem_constraints.end();
289  }
290 
291  return (it != end_it && it->second.hasActiveObjects());
292 }
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _displaced_node_elem_constraints
NodeElemConstraint objects.
A storage container for MooseObjects that inherit from SetupInterface.
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _node_elem_constraints
NodeElemConstraint objects.

◆ hasActiveNodeFaceConstraints()

bool ConstraintWarehouse::hasActiveNodeFaceConstraints ( BoundaryID  boundary_id,
bool  displaced 
) const

Definition at line 251 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), NonlinearSystemBase::overwriteNodeFace(), and NonlinearSystemBase::setConstraintSecondaryValues().

252 {
253  std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint>>::const_iterator it, end_it;
254 
255  if (displaced)
256  {
257  it = _displaced_node_face_constraints.find(boundary_id);
258  end_it = _displaced_node_face_constraints.end();
259  }
260 
261  else
262  {
263  it = _node_face_constraints.find(boundary_id);
264  end_it = _node_face_constraints.end();
265  }
266 
267  return (it != end_it && it->second.hasActiveObjects());
268 }
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
NodeFaceConstraint objects (non-displaced)

◆ hasActiveObject()

bool MooseObjectWarehouseBase< Constraint >::hasActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Convenience functions for checking/getting specific objects.

Definition at line 608 of file MooseObjectWarehouseBase.h.

609 {
610  checkThreadID(tid);
611  for (const auto & object : _active_objects[tid])
612  if (object->name() == name)
613  return true;
614  return false;
615 }
std::string name(const ElemQuality q)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveObjects()

bool MooseObjectWarehouseBase< Constraint >::hasActiveObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 496 of file MooseObjectWarehouseBase.h.

497 {
498  checkThreadID(tid);
499  return !_active_objects[tid].empty();
500 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveVariableBlockObjects()

bool MooseObjectWarehouse< Constraint >::hasActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Methods for checking/getting variable kernels for a variable and SubdomainID.

Definition at line 133 of file MooseObjectWarehouse.h.

136 {
137  auto iter = _variable_objects.find(variable_id);
138  return (iter != _variable_objects.end() && iter->second.hasActiveBlockObjects(block_id, tid));
139 }
std::map< unsigned int, MooseObjectWarehouse< Constraint > > _variable_objects
Variable based storage.

◆ hasBoundaryObjects() [1/2]

bool MooseObjectWarehouseBase< Constraint >::hasBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 585 of file MooseObjectWarehouseBase.h.

586 {
588 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects
bool hasBoundaryObjectsHelper(const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint >>>> &boundary_objects, const THREAD_ID tid=0) const
Helper for determining whether we have boundary objects.

◆ hasBoundaryObjects() [2/2]

bool MooseObjectWarehouseBase< Constraint >::hasBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 404 of file MooseObjectWarehouseBase.h.

405 {
406  checkThreadID(tid);
407  return _all_boundary_objects[tid].find(id) != _all_boundary_objects[tid].end();
408 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects

◆ hasBoundaryObjectsHelper()

bool MooseObjectWarehouseBase< Constraint >::hasBoundaryObjectsHelper ( const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint >>>> &  boundary_objects,
const THREAD_ID  tid = 0 
) const
protectedinherited

Helper for determining whether we have boundary objects.

Definition at line 572 of file MooseObjectWarehouseBase.h.

575 {
576  checkThreadID(tid);
577  bool has_boundary_objects = false;
578  for (const auto & object_pair : boundary_objects[tid])
579  has_boundary_objects |= !(object_pair.second.empty());
580  return has_boundary_objects;
581 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasObjects()

bool MooseObjectWarehouseBase< Constraint >::hasObjects ( THREAD_ID  tid = 0) const
inherited

Convenience functions for determining if objects exist.

Definition at line 488 of file MooseObjectWarehouseBase.h.

489 {
490  checkThreadID(tid);
491  return !_all_objects[tid].empty();
492 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasObjectsForVariable()

bool MooseObjectWarehouseBase< Constraint >::hasObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

Definition at line 504 of file MooseObjectWarehouseBase.h.

506 {
507  checkThreadID(tid);
508  return _all_variable_objects[tid].count(var_name);
509 }
std::vector< std::map< VariableName, std::vector< std::shared_ptr< Constraint > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasObjectsForVariableAndBlocks()

bool MooseObjectWarehouseBase< Constraint >::hasObjectsForVariableAndBlocks ( const VariableName &  var_name,
const std::set< SubdomainID > &  blocks,
std::set< SubdomainID > &  blocks_covered,
THREAD_ID  tid 
) const
inherited

Whether there are objects for this variable and the set of blocks passed.

Parameters
var_namename of the variable
blocksblocks to consider
blocks_coveredsubset of blocks for which there is an object

Definition at line 513 of file MooseObjectWarehouseBase.h.

517 {
518  checkThreadID(tid);
519  blocks_covered.clear();
520  if (!hasObjectsForVariable(var_name, tid))
521  return false;
522 
523  // Check block restriction as a whole
524  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
525  {
526  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
527  if (blk && blk->hasBlocks(blocks))
528  {
529  blocks_covered = blocks;
530  return true;
531  }
532  }
533  // No object has all the blocks, but one might overlap, which could be troublesome.
534  // We'll keep track of which blocks are covered in case several overlap
535  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
536  {
537  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
538  if (blk)
539  for (const auto & block : blocks)
540  if (blk->hasBlocks(block))
541  blocks_covered.insert(block);
542  }
543  // No overlap at all
544  if (blocks_covered.empty())
545  return false;
546 
547  return (blocks == blocks_covered);
548 }
char ** blocks
std::vector< std::map< VariableName, std::vector< std::shared_ptr< Constraint > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
bool hasObjectsForVariable(const VariableName &var_name, THREAD_ID tid) const
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.

◆ hasVariableObjects()

bool MooseObjectWarehouse< Constraint >::hasVariableObjects ( unsigned int  variable_id,
THREAD_ID  tid = 0 
) const
inherited

Checks for whether this warehouse has objects for a given variable.

Definition at line 125 of file MooseObjectWarehouse.h.

126 {
127  auto iter = _variable_objects.find(variable_id);
128  return (iter != _variable_objects.end() && iter->second.hasObjects(tid));
129 }
std::map< unsigned int, MooseObjectWarehouse< Constraint > > _variable_objects
Variable based storage.

◆ initialSetup()

void MooseObjectWarehouse< Constraint >::initialSetup ( THREAD_ID  tid = 0) const
virtualinherited

Convenience methods for calling object setup methods.

Definition at line 157 of file MooseObjectWarehouse.h.

158 {
159  checkThreadID(tid);
160  // Initial Setup should be called on all objects because they may become active later
161  for (const auto & object : _all_objects[tid])
162  object->initialSetup();
163 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ jacobianSetup()

void MooseObjectWarehouse< Constraint >::jacobianSetup ( THREAD_ID  tid = 0) const
virtualinherited

Definition at line 207 of file MooseObjectWarehouse.h.

208 {
209  checkThreadID(tid);
210  for (const auto & object : _active_objects[tid])
211  object->jacobianSetup();
212 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ numThreads()

THREAD_ID MooseObjectWarehouseBase< Constraint >::numThreads ( ) const
inlineinherited

Return the number of threads.

Definition at line 205 of file MooseObjectWarehouseBase.h.

205 { return _num_threads; }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ residualEnd()

void ConstraintWarehouse::residualEnd ( THREAD_ID  tid = 0) const
virtual

Definition at line 358 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::computeResidualInternal().

359 {
360  checkThreadID(tid);
361  for (const auto & object : _active_objects[tid])
362  object->residualEnd();
363 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ residualSetup()

void MooseObjectWarehouse< Constraint >::residualSetup ( THREAD_ID  tid = 0) const
virtualinherited

Definition at line 216 of file MooseObjectWarehouse.h.

217 {
218  checkThreadID(tid);
219  for (const auto & object : _active_objects[tid])
220  object->residualSetup();
221 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ size()

unsigned int MooseObjectWarehouseBase< Constraint >::size ( THREAD_ID  tid = 0) const
inherited

Return how many kernels we store in the current warehouse.

Definition at line 306 of file MooseObjectWarehouseBase.h.

307 {
308  checkThreadID(tid);
309  return _all_objects[tid].size();
310 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ sort()

void MooseObjectWarehouseBase< Constraint >::sort ( THREAD_ID  tid = 0)
inherited

Sort the objects using the DependencyResolver.

Definition at line 689 of file MooseObjectWarehouseBase.h.

690 {
691  checkThreadID(tid);
692 
693  for (auto & object_pair : _all_block_objects[tid])
694  sortHelper(object_pair.second);
695 
696  for (auto & object_pair : _all_boundary_objects[tid])
697  sortHelper(object_pair.second);
698 
699  sortHelper(_all_objects[tid]);
700 
701  // The active lists now must be update to reflect the order changes
702  updateActive(tid);
703 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
static void sortHelper(std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for sorting vectors of objects.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _all_boundary_objects
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.

◆ sortHelper()

void MooseObjectWarehouseBase< Constraint >::sortHelper ( std::vector< std::shared_ptr< Constraint >> &  objects)
staticprotectedinherited

Helper method for sorting vectors of objects.

Definition at line 909 of file MooseObjectWarehouseBase.h.

910 {
911  // Do nothing if the vector is empty
912  if (objects.empty())
913  return;
914 
915  try
916  {
917  // Sort based on dependencies
918  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
919  }
920  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
921  {
922  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
923  e, "Cyclic dependency detected in object ordering");
924  }
925 }

◆ subdomainsCovered()

void ConstraintWarehouse::subdomainsCovered ( std::set< SubdomainID > &  subdomains_covered,
std::set< std::string > &  unique_variables,
THREAD_ID  tid = 0 
) const

Update supplied subdomain and variable coverate containters.

Definition at line 318 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::checkKernelCoverage().

321 {
322  // Loop over undisplaced
323  for (const auto & pr : _mortar_constraints)
324  {
325  const auto & objects = pr.second.getActiveObjects();
326  for (const auto & mc : objects)
327  {
328  const MooseVariableFEBase * lm_var = mc->variablePtr();
329  if (lm_var)
330  unique_variables.insert(lm_var->name());
331 
332  // Mortar constraints will cover primary and secondary subdomains regardless of whether we
333  // have a Lagrange multiplier associated.
334  subdomains_covered.insert(mc->primarySubdomain());
335  subdomains_covered.insert(mc->secondarySubdomain());
336  }
337  }
338 
339  // Loop over displaced
340  for (const auto & pr : _displaced_mortar_constraints)
341  {
342  const auto & objects = pr.second.getActiveObjects();
343  for (const auto & mc : objects)
344  {
345  const MooseVariableFEBase * lm_var = mc->variablePtr();
346  if (lm_var)
347  unique_variables.insert(lm_var->name());
348 
349  // Mortar constraints will cover primary and secondary subdomains regardless of whether we
350  // have a Lagrange multiplier associated.
351  subdomains_covered.insert(mc->primarySubdomain());
352  subdomains_covered.insert(mc->secondarySubdomain());
353  }
354  }
355 }
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _displaced_mortar_constraints
Displaced MortarConstraints.
This class provides an interface for common operations on field variables of both FE and FV types wit...
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector)=0
Insert the currently cached degree of freedom values into the provided vector.
std::map< std::pair< BoundaryID, BoundaryID >, MooseObjectWarehouse< MortarConstraintBase > > _mortar_constraints
Undisplaced MortarConstraints.

◆ subdomainSetup() [1/2]

void MooseObjectWarehouse< Constraint >::subdomainSetup ( THREAD_ID  tid = 0) const
virtualinherited

Definition at line 198 of file MooseObjectWarehouse.h.

199 {
200  checkThreadID(tid);
201  for (const auto & object : _active_objects[tid])
202  object->subdomainSetup();
203 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ subdomainSetup() [2/2]

void MooseObjectWarehouse< Constraint >::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtualinherited

Definition at line 185 of file MooseObjectWarehouse.h.

186 {
187  checkThreadID(tid);
188  if (hasActiveBlockObjects(id, tid))
189  {
190  const auto & objects = getActiveBlockObjects(id, tid);
191  for (const auto & object : objects)
192  object->subdomainSetup();
193  }
194 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getActiveBlockObjects(THREAD_ID tid=0) const
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ timestepSetup()

void MooseObjectWarehouse< Constraint >::timestepSetup ( THREAD_ID  tid = 0) const
virtualinherited

Definition at line 167 of file MooseObjectWarehouse.h.

168 {
169  checkThreadID(tid);
170  for (const auto & object : _active_objects[tid])
171  object->timestepSetup();
172 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateActive()

void ConstraintWarehouse::updateActive ( THREAD_ID  tid = 0)
overridevirtual

Update the various active lists.

Reimplemented from MooseObjectWarehouse< Constraint >.

Definition at line 295 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::updateActive().

296 {
299 
300  for (auto & it : _node_face_constraints)
301  it.second.updateActive();
302 
303  for (auto & it : _displaced_node_face_constraints)
304  it.second.updateActive();
305 
306  // FIXME: We call updateActive() on the NodeFaceConstraints again?
307  for (auto & it : _node_face_constraints)
308  it.second.updateActive();
309 
310  for (auto & it : _element_constraints)
311  it.second.updateActive();
312 
313  for (auto & it : _node_elem_constraints)
314  it.second.updateActive();
315 }
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraintBase > > _node_elem_constraints
NodeElemConstraint objects.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
NodeFaceConstraint objects (non-displaced)

◆ updateActiveHelper()

void MooseObjectWarehouseBase< Constraint >::updateActiveHelper ( std::vector< std::shared_ptr< Constraint >> &  active,
const std::vector< std::shared_ptr< Constraint >> &  all 
)
staticprotectedinherited

Helper method for updating active vectors.

Definition at line 675 of file MooseObjectWarehouseBase.h.

677 {
678  // Clear the active list
679  active.clear();
680 
681  std::copy_if(all.begin(),
682  all.end(),
683  std::back_inserter(active),
684  [](const std::shared_ptr<T> & object) { return object->enabled(); });
685 }

◆ updateBlockFEVariableCoupledVectorTagDependency()

void MooseObjectWarehouseBase< Constraint >::updateBlockFEVariableCoupledVectorTagDependency ( SubdomainID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 778 of file MooseObjectWarehouseBase.h.

780 {
781  if (hasActiveBlockObjects(id, tid))
782  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
783  getActiveBlockObjects(id, tid));
784 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating FE variable coupleable vector tag vector.

◆ updateBlockMatPropDependency()

void MooseObjectWarehouseBase< Constraint >::updateBlockMatPropDependency ( SubdomainID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 825 of file MooseObjectWarehouseBase.h.

830 {
831  if (hasActiveBlockObjects(id, tid))
832  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid), producer_only);
833 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

void MooseObjectWarehouseBase< Constraint >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 716 of file MooseObjectWarehouseBase.h.

720 {
721  if (hasActiveBlockObjects(id, tid))
722  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
723 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Constraint > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryFEVariableCoupledVectorTagDependency()

void MooseObjectWarehouseBase< Constraint >::updateBoundaryFEVariableCoupledVectorTagDependency ( BoundaryID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 788 of file MooseObjectWarehouseBase.h.

790 {
791  if (hasActiveBoundaryObjects(id, tid))
792  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
793  getActiveBoundaryObjects(id, tid));
794 }
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryMatPropDependency() [1/2]

void MooseObjectWarehouseBase< Constraint >::updateBoundaryMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 837 of file MooseObjectWarehouseBase.h.

841 {
842  if (hasActiveBoundaryObjects(tid))
843  for (auto & active_bnd_object : _active_boundary_objects[tid])
844  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second, producer_only);
845 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBoundaryMatPropDependency() [2/2]

void MooseObjectWarehouseBase< Constraint >::updateBoundaryMatPropDependency ( BoundaryID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 849 of file MooseObjectWarehouseBase.h.

854 {
855  if (hasActiveBoundaryObjects(id, tid))
857  needed_mat_props, getActiveBoundaryObjects(id, tid), producer_only);
858 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBoundaryVariableDependency() [1/2]

void MooseObjectWarehouseBase< Constraint >::updateBoundaryVariableDependency ( std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 727 of file MooseObjectWarehouseBase.h.

729 {
730  if (hasActiveBoundaryObjects(tid))
731  {
732  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
733  for (const auto & object_pair : _active_boundary_objects[tid])
734  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
735  }
736 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

void MooseObjectWarehouseBase< Constraint >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 740 of file MooseObjectWarehouseBase.h.

744 {
745  if (hasActiveBoundaryObjects(id, tid))
746  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
747 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateFEVariableCoupledVectorTagDependency()

void MooseObjectWarehouseBase< Constraint >::updateFEVariableCoupledVectorTagDependency ( std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects.

Definition at line 768 of file MooseObjectWarehouseBase.h.

770 {
771  if (hasActiveObjects(tid))
772  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
773  _active_objects[tid]);
774 }
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateFEVariableCoupledVectorTagDependencyHelper()

void MooseObjectWarehouseBase< Constraint >::updateFEVariableCoupledVectorTagDependencyHelper ( std::set< TagID > &  needed_fe_var_vector_tags,
const std::vector< std::shared_ptr< Constraint >> &  objects 
)
staticprotectedinherited

Helper method for updating FE variable coupleable vector tag vector.

Definition at line 798 of file MooseObjectWarehouseBase.h.

800 {
801  for (const auto & object : objects)
802  {
803  auto c = dynamic_cast<const Coupleable *>(object.get());
804  if (c)
805  {
806  const auto & tag_deps = c->getFEVariableCoupleableVectorTags();
807  needed_fe_var_vector_tags.insert(tag_deps.begin(), tag_deps.end());
808  }
809  }
810 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition: Coupleable.h:120

◆ updateMatPropDependency()

void MooseObjectWarehouseBase< Constraint >::updateMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Update material property dependency vector.

Parameters
producer_onlyOnly append dependencies of materials producing the needed_mat_props

Definition at line 814 of file MooseObjectWarehouseBase.h.

818 {
819  if (hasActiveObjects(tid))
820  updateMatPropDependencyHelper(needed_mat_props, _active_objects[tid], producer_only);
821 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateMatPropDependencyHelper()

void MooseObjectWarehouseBase< Constraint >::updateMatPropDependencyHelper ( std::unordered_set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< Constraint >> &  objects,
const bool  producer_only 
) const
protectedvirtualinherited

Helper method for updating material property dependency vector.

Definition at line 862 of file MooseObjectWarehouseBase.h.

866 {
867  for (auto & object : objects)
868  {
869  auto c = dynamic_cast<const MaterialPropertyInterface *>(object.get());
870  if (c)
871  {
872  auto & mp_deps = c->getMatPropDependencies();
873  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
874  }
875  }
876 }
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
An interface for accessing Materials.

◆ updateVariableDependency()

void MooseObjectWarehouseBase< Constraint >::updateVariableDependency ( std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Update variable dependency vector.

Definition at line 707 of file MooseObjectWarehouseBase.h.

709 {
710  if (hasActiveObjects(tid))
711  updateVariableDependencyHelper(needed_moose_vars, _active_objects[tid]);
712 }
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.
std::vector< std::vector< std::shared_ptr< Constraint > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateVariableDependencyHelper()

void MooseObjectWarehouseBase< Constraint >::updateVariableDependencyHelper ( std::set< MooseVariableFieldBase *> &  needed_moose_vars,
const std::vector< std::shared_ptr< Constraint >> &  objects 
)
staticprotectedinherited

Helper method for updating variable dependency vector.

Definition at line 751 of file MooseObjectWarehouseBase.h.

754 {
755  for (const auto & object : objects)
756  {
757  auto c = dynamic_cast<const MooseVariableDependencyInterface *>(object.get());
758  if (c)
759  {
760  const auto & mv_deps = c->getMooseVariableDependencies();
761  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
762  }
763  }
764 }
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies() const
Retrieve the set of MooseVariableFieldBase that this object depends on.

Member Data Documentation

◆ _active_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<Constraint > > > > MooseObjectWarehouseBase< Constraint >::_active_block_objects
protectedinherited

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 229 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<Constraint > > > > MooseObjectWarehouseBase< Constraint >::_active_boundary_objects
protectedinherited

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 235 of file MooseObjectWarehouseBase.h.

◆ _active_objects

std::vector<std::vector<std::shared_ptr<Constraint > > > MooseObjectWarehouseBase< Constraint >::_active_objects
protectedinherited

All active objects (THREAD_ID on outer vector)

Definition at line 223 of file MooseObjectWarehouseBase.h.

Referenced by residualEnd().

◆ _all_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<Constraint > > > > MooseObjectWarehouseBase< Constraint >::_all_block_objects
protectedinherited

Definition at line 226 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<Constraint > > > > MooseObjectWarehouseBase< Constraint >::_all_boundary_objects
protectedinherited

Definition at line 232 of file MooseObjectWarehouseBase.h.

◆ _all_objects

std::vector<std::vector<std::shared_ptr<Constraint > > > MooseObjectWarehouseBase< Constraint >::_all_objects
protectedinherited

Storage container for the ALL pointers (THREAD_ID on outer vector)

Definition at line 220 of file MooseObjectWarehouseBase.h.

◆ _all_variable_objects

std::vector<std::map<VariableName, std::vector<std::shared_ptr<Constraint > > > > MooseObjectWarehouseBase< Constraint >::_all_variable_objects
protectedinherited

All objects with a certain variable selected, as the 'variable' parameter.

Definition at line 238 of file MooseObjectWarehouseBase.h.

◆ _displaced_element_constraints

std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint> > ConstraintWarehouse::_displaced_element_constraints
protected

ElemElemConstraints (displaced)

Definition at line 105 of file ConstraintWarehouse.h.

Referenced by addObject(), getActiveElemElemConstraints(), and hasActiveElemElemConstraints().

◆ _displaced_mortar_constraints

std::map<std::pair<BoundaryID, BoundaryID>, MooseObjectWarehouse<MortarConstraintBase> > ConstraintWarehouse::_displaced_mortar_constraints
protected

Displaced MortarConstraints.

Definition at line 99 of file ConstraintWarehouse.h.

Referenced by addObject(), getActiveMortarConstraints(), hasActiveMortarConstraints(), and subdomainsCovered().

◆ _displaced_node_elem_constraints

std::map<std::pair<SubdomainID, SubdomainID>, MooseObjectWarehouse<NodeElemConstraintBase> > ConstraintWarehouse::_displaced_node_elem_constraints
protected

◆ _displaced_node_face_constraints

std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint> > ConstraintWarehouse::_displaced_node_face_constraints
protected

◆ _element_constraints

std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint> > ConstraintWarehouse::_element_constraints
protected

ElemElemConstraints (non-displaced)

Definition at line 102 of file ConstraintWarehouse.h.

Referenced by addObject(), getActiveElemElemConstraints(), hasActiveElemElemConstraints(), and updateActive().

◆ _mortar_constraints

std::map<std::pair<BoundaryID, BoundaryID>, MooseObjectWarehouse<MortarConstraintBase> > ConstraintWarehouse::_mortar_constraints
protected

Undisplaced MortarConstraints.

Definition at line 95 of file ConstraintWarehouse.h.

Referenced by addObject(), getActiveMortarConstraints(), hasActiveMortarConstraints(), and subdomainsCovered().

◆ _nodal_constraints

MooseObjectWarehouse<NodalConstraint> ConstraintWarehouse::_nodal_constraints
protected

◆ _node_elem_constraints

std::map<std::pair<SubdomainID, SubdomainID>, MooseObjectWarehouse<NodeElemConstraintBase> > ConstraintWarehouse::_node_elem_constraints
protected

◆ _node_face_constraints

std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint> > ConstraintWarehouse::_node_face_constraints
protected

◆ _num_threads

const THREAD_ID MooseObjectWarehouseBase< Constraint >::_num_threads
protectedinherited

Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)

Definition at line 217 of file MooseObjectWarehouseBase.h.

◆ _variable_objects

std::map<unsigned int, MooseObjectWarehouse<Constraint > > MooseObjectWarehouse< Constraint >::_variable_objects
protectedinherited

Variable based storage.

Definition at line 88 of file MooseObjectWarehouse.h.


The documentation for this class was generated from the following files: