www.mooseframework.org
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)
 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)
 Update the various active lists. More...
 
virtual void residualEnd (THREAD_ID tid=0) const
 
unsigned int size (THREAD_ID tid=0)
 Return how many kernels we store in the current warehouse. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
void sort (THREAD_ID tid=0)
 Sort the objects using the DependencyResolver. More...
 
THREAD_ID numThreads ()
 Return the number of threads. More...
 
const std::vector< std::shared_ptr< NodalConstraint > > & getActiveNodalConstraints () const
 Access methods for active objects. More...
 
const std::vector< std::shared_ptr< MortarConstraint > > & getActiveMortarConstraints (const std::string &interface) 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< NodeElemConstraint > > & getActiveNodeElemConstraints (SubdomainID slave_id, SubdomainID master_id, bool displaced) const
 
bool hasActiveNodalConstraints () const
 Deterimine if active objects exist. More...
 
bool hasActiveMortarConstraints (const std::string &interface) const
 
bool hasActiveElemElemConstraints (const InterfaceID interface_id, bool displaced) const
 
bool hasActiveNodeFaceConstraints (BoundaryID boundary_id, bool displaced) const
 
bool hasActiveNodeElemConstraints (SubdomainID slave_id, SubdomainID master_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 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 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 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< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 

Protected Member Functions

void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. 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< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
 Helper method for updating variable dependency vector. More...
 
static void updateMatPropDependencyHelper (std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects)
 Helper method for updating material property dependency 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::string, MooseObjectWarehouse< MortarConstraint > > _mortar_constraints
 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< NodeElemConstraint > > _node_elem_constraints
 NodeElemConstraint objects. More...
 
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _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...
 

Detailed Description

Warehouse for storing constraints.

Definition at line 27 of file ConstraintWarehouse.h.

Constructor & Destructor Documentation

◆ ConstraintWarehouse()

ConstraintWarehouse::ConstraintWarehouse ( )

Definition at line 20 of file ConstraintWarehouse.C.

Member Function Documentation

◆ addObject()

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

Add Constraint object to the warehouse.

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

Reimplemented from MooseObjectWarehouse< Constraint >.

Definition at line 23 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::addConstraint().

26 {
27  // Adds to the storage of _all_objects
29 
30  // Cast the the possible Contraint types
31  std::shared_ptr<NodeFaceConstraint> nfc = std::dynamic_pointer_cast<NodeFaceConstraint>(object);
32  std::shared_ptr<MortarConstraint> ffc = std::dynamic_pointer_cast<MortarConstraint>(object);
33  std::shared_ptr<NodalConstraint> nc = std::dynamic_pointer_cast<NodalConstraint>(object);
34  std::shared_ptr<ElemElemConstraint> ec = std::dynamic_pointer_cast<ElemElemConstraint>(object);
35  std::shared_ptr<NodeElemConstraint> nec = std::dynamic_pointer_cast<NodeElemConstraint>(object);
36 
37  // NodeFaceConstraint
38  if (nfc)
39  {
40  MooseMesh & mesh = nfc->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
41  unsigned int slave = mesh.getBoundaryID(nfc->getParam<BoundaryName>("slave"));
42  bool displaced = nfc->parameters().have_parameter<bool>("use_displaced_mesh") &&
43  nfc->getParam<bool>("use_displaced_mesh");
44 
45  if (displaced)
46  _displaced_node_face_constraints[slave].addObject(nfc);
47  else
48  _node_face_constraints[slave].addObject(nfc);
49  }
50 
51  // MortarConstraint
52  else if (ffc)
53  {
54  const std::string & interface = ffc->getParam<std::string>("interface");
55  _mortar_constraints[interface].addObject(ffc);
56  }
57 
58  // ElemElemConstraint
59  else if (ec)
60  {
61  bool displaced = ec->parameters().have_parameter<bool>("use_displaced_mesh") &&
62  ec->getParam<bool>("use_displaced_mesh");
63  const InterfaceID interface_id = ec->getInterfaceID();
64 
65  if (displaced)
66  _displaced_element_constraints[interface_id].addObject(ec);
67  else
68  _element_constraints[interface_id].addObject(ec);
69  }
70 
71  // NodeElemConstraint
72  else if (nec)
73  {
74  MooseMesh & mesh = nec->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
75  SubdomainID slave = mesh.getSubdomainID(nec->getParam<SubdomainName>("slave"));
76  SubdomainID master = mesh.getSubdomainID(nec->getParam<SubdomainName>("master"));
77  bool displaced = nec->parameters().have_parameter<bool>("use_displaced_mesh") &&
78  nec->getParam<bool>("use_displaced_mesh");
79 
80  if (displaced)
81  _displaced_node_elem_constraints[std::make_pair(slave, master)].addObject(nec);
82  else
83  _node_elem_constraints[std::make_pair(slave, master)].addObject(nec);
84  }
85 
86  // NodalConstraint
87  else if (nc)
89 
90  else
91  mooseError("Unknown type of Constraint object");
92 }
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
if(nl->nonlinearSolver() ->matvec &&nl->nonlinearSolver() ->residual_and_jacobian_object)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _displaced_node_elem_constraints
NodeElemConstraint objects.
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _node_elem_constraints
NodeElemConstraint objects.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:188
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:73
unsigned int InterfaceID
Definition: MooseTypes.h:123
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _displaced_element_constraints
ElemElemConstraints (displaced)
User for mortar methods.
A NodeElemConstraint is used when you need to create constraints between a slave node and a master el...
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
void addObject(std::shared_ptr< Constraint > object, THREAD_ID tid=0, bool recurse=true)
Add Constraint object to the warehouse.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _node_face_constraints
NodeFaceConstraint objects (non-displaced)
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1002
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1070
std::map< std::string, MooseObjectWarehouse< MortarConstraint > > _mortar_constraints
MortarConstraints.

◆ checkThreadID()

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

Calls assert on thread id.

Definition at line 694 of file MooseObjectWarehouseBase.h.

Referenced by residualEnd().

695 {
696  mooseAssert(tid < _num_threads,
697  "Attempting to access a thread id ("
698  << tid << ") greater than the number allowed by the storage item ("
699  << _num_threads << ")");
700 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ 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 388 of file MooseObjectWarehouseBase.h.

389 {
390  checkThreadID(tid);
391  return _active_block_objects[tid];
392 }
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 396 of file MooseObjectWarehouseBase.h.

397 {
398  checkThreadID(tid);
399  const auto iter = _active_block_objects[tid].find(id);
400  mooseAssert(iter != _active_block_objects[tid].end(),
401  "Unable to located active block objects for the given id: " << id << ".");
402  return iter->second;
403 }
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 496 of file MooseObjectWarehouseBase.h.

497 {
498  checkThreadID(tid);
499  std::set<SubdomainID> ids;
500  for (const auto & object_pair : _active_block_objects[tid])
501  ids.insert(object_pair.first);
502  return ids;
503 }
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 369 of file MooseObjectWarehouseBase.h.

370 {
371  checkThreadID(tid);
372  return _active_boundary_objects[tid];
373 }
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 377 of file MooseObjectWarehouseBase.h.

378 {
379  checkThreadID(tid);
380  const auto iter = _active_boundary_objects[tid].find(id);
381  mooseAssert(iter != _active_boundary_objects[tid].end(),
382  "Unable to located active boundary objects for the given id: " << id << ".");
383  return iter->second;
384 }
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 135 of file ConstraintWarehouse.C.

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

137 {
138  std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint>>::const_iterator it, end_it;
139 
140  if (displaced)
141  {
142  it = _displaced_element_constraints.find(interface_id);
143  end_it = _displaced_element_constraints.end();
144  }
145 
146  else
147  {
148  it = _element_constraints.find(interface_id);
149  end_it = _element_constraints.end();
150  }
151 
152  mooseAssert(it != end_it,
153  "Unable to locate storage for ElemElemConstraint objects for the given interface id: "
154  << interface_id);
155  return it->second.getActiveObjects();
156 }
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< MortarConstraint > > & ConstraintWarehouse::getActiveMortarConstraints ( const std::string &  interface) const

Definition at line 124 of file ConstraintWarehouse.C.

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

125 {
126  std::map<std::string, MooseObjectWarehouse<MortarConstraint>>::const_iterator it =
127  _mortar_constraints.find(interface);
128  mooseAssert(it != _mortar_constraints.end(),
129  "Unable to locate storage for MortarConstraint objects for the given interface: "
130  << interface);
131  return it->second.getActiveObjects();
132 }
std::map< std::string, MooseObjectWarehouse< MortarConstraint > > _mortar_constraints
MortarConstraints.

◆ getActiveNodalConstraints()

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

Access methods for active objects.

Definition at line 95 of file ConstraintWarehouse.C.

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

96 {
98 }
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< NodeElemConstraint > > & ConstraintWarehouse::getActiveNodeElemConstraints ( SubdomainID  slave_id,
SubdomainID  master_id,
bool  displaced 
) const

Definition at line 159 of file ConstraintWarehouse.C.

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

162 {
163  std::map<std::pair<SubdomainID, SubdomainID>,
164  MooseObjectWarehouse<NodeElemConstraint>>::const_iterator it,
165  end_it;
166 
167  if (displaced)
168  {
169  it = _displaced_node_elem_constraints.find(std::make_pair(slave_id, master_id));
170  end_it = _displaced_node_elem_constraints.end();
171  }
172  else
173  {
174  it = _node_elem_constraints.find(std::make_pair(slave_id, master_id));
175  end_it = _node_elem_constraints.end();
176  }
177 
178  mooseAssert(it != end_it,
179  "Unable to locate storage for NodeElemConstraint objects for the given slave and "
180  "master id pair: ["
181  << slave_id << ", " << master_id << "]");
182  return it->second.getActiveObjects();
183 }
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _displaced_node_elem_constraints
NodeElemConstraint objects.
A storage container for MooseObjects that inherit from SetupInterface.
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _node_elem_constraints
NodeElemConstraint objects.

◆ getActiveNodeFaceConstraints()

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

Definition at line 101 of file ConstraintWarehouse.C.

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

102 {
103  std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint>>::const_iterator it, end_it;
104 
105  if (displaced)
106  {
107  it = _displaced_node_face_constraints.find(boundary_id);
108  end_it = _displaced_node_face_constraints.end();
109  }
110 
111  else
112  {
113  it = _node_face_constraints.find(boundary_id);
114  end_it = _node_face_constraints.end();
115  }
116 
117  mooseAssert(it != end_it,
118  "Unable to locate storage for NodeFaceConstraint objects for the given boundary id: "
119  << boundary_id);
120  return it->second.getActiveObjects();
121 }
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 485 of file MooseObjectWarehouseBase.h.

486 {
487  checkThreadID(tid);
488  for (const auto & object : _active_objects[tid])
489  if (object->name() == name)
490  return object;
491  mooseError("Unable to locate active object: ", name, ".");
492 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
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 361 of file MooseObjectWarehouseBase.h.

362 {
363  checkThreadID(tid);
364  return _active_objects[tid];
365 }
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 129 of file MooseObjectWarehouse.h.

132 {
133  checkThreadID(tid);
134  const auto iter = _variable_objects.find(variable_id);
135  mooseAssert(iter != _variable_objects.end(),
136  "Unable to locate variable kernels for the given variable id: " << variable_id
137  << ".");
138  return iter->second.getActiveBlockObjects(block_id, tid);
139 }
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 342 of file MooseObjectWarehouseBase.h.

343 {
344  checkThreadID(tid);
345  return _all_block_objects[tid];
346 }
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 350 of file MooseObjectWarehouseBase.h.

351 {
352  checkThreadID(tid);
353  const auto iter = _all_block_objects[tid].find(id);
354  mooseAssert(iter != _all_block_objects[tid].end(),
355  "Unable to located active block objects for the given id: " << id << ".");
356  return iter->second;
357 }
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 323 of file MooseObjectWarehouseBase.h.

324 {
325  checkThreadID(tid);
326  return _all_boundary_objects[tid];
327 }
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 331 of file MooseObjectWarehouseBase.h.

332 {
333  checkThreadID(tid);
334  const auto iter = _all_boundary_objects[tid].find(id);
335  mooseAssert(iter != _all_boundary_objects[tid].end(),
336  "Unable to located active boundary objects for the given id: " << id << ".");
337  return iter->second;
338 }
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 474 of file MooseObjectWarehouseBase.h.

475 {
476  checkThreadID(tid);
477  for (const auto & object : _all_objects[tid])
478  if (object->name() == name)
479  return object;
480  mooseError("Unable to locate object: ", name, ".");
481 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
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 315 of file MooseObjectWarehouseBase.h.

316 {
317  checkThreadID(tid);
318  return _all_objects[tid];
319 }
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.

◆ hasActiveBlockObjects() [1/2]

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

Definition at line 423 of file MooseObjectWarehouseBase.h.

424 {
425  checkThreadID(tid);
426  bool has_active_block_objects = false;
427  for (const auto & object_pair : _active_block_objects[tid])
428  has_active_block_objects |= !(object_pair.second.empty());
429  return has_active_block_objects;
430 }
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 434 of file MooseObjectWarehouseBase.h.

435 {
436  checkThreadID(tid);
437  const auto iter = _active_block_objects[tid].find(id);
438  return iter != _active_block_objects[tid].end();
439 }
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 443 of file MooseObjectWarehouseBase.h.

444 {
445  checkThreadID(tid);
446  bool has_active_boundary_objects = false;
447  for (const auto & object_pair : _active_boundary_objects[tid])
448  has_active_boundary_objects |= !(object_pair.second.empty());
449  return has_active_boundary_objects;
450 }
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)

◆ hasActiveBoundaryObjects() [2/2]

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

Definition at line 454 of file MooseObjectWarehouseBase.h.

455 {
456  checkThreadID(tid);
457  const auto iter = _active_boundary_objects[tid].find(id);
458  return iter != _active_boundary_objects[tid].end();
459 }
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 200 of file ConstraintWarehouse.C.

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

202 {
203  std::map<unsigned int, MooseObjectWarehouse<ElemElemConstraint>>::const_iterator it, end_it;
204 
205  if (displaced)
206  {
207  it = _displaced_element_constraints.find(interface_id);
208  end_it = _displaced_element_constraints.end();
209  }
210 
211  else
212  {
213  it = _element_constraints.find(interface_id);
214  end_it = _element_constraints.end();
215  }
216 
217  return (it != end_it && it->second.hasActiveObjects());
218 }
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::string &  interface) const

Definition at line 192 of file ConstraintWarehouse.C.

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

193 {
194  std::map<std::string, MooseObjectWarehouse<MortarConstraint>>::const_iterator it =
195  _mortar_constraints.find(interface);
196  return (it != _mortar_constraints.end() && it->second.hasActiveObjects());
197 }
std::map< std::string, MooseObjectWarehouse< MortarConstraint > > _mortar_constraints
MortarConstraints.

◆ hasActiveNodalConstraints()

bool ConstraintWarehouse::hasActiveNodalConstraints ( ) const

Deterimine if active objects exist.

Definition at line 186 of file ConstraintWarehouse.C.

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

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

◆ hasActiveNodeElemConstraints()

bool ConstraintWarehouse::hasActiveNodeElemConstraints ( SubdomainID  slave_id,
SubdomainID  master_id,
bool  displaced 
) const

Definition at line 241 of file ConstraintWarehouse.C.

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

244 {
245  std::map<std::pair<SubdomainID, SubdomainID>,
246  MooseObjectWarehouse<NodeElemConstraint>>::const_iterator it,
247  end_it;
248 
249  if (displaced)
250  {
251  it = _displaced_node_elem_constraints.find(std::make_pair(slave_id, master_id));
252  end_it = _displaced_node_elem_constraints.end();
253  }
254 
255  else
256  {
257  it = _node_elem_constraints.find(std::make_pair(slave_id, master_id));
258  end_it = _node_elem_constraints.end();
259  }
260 
261  return (it != end_it && it->second.hasActiveObjects());
262 }
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _displaced_node_elem_constraints
NodeElemConstraint objects.
A storage container for MooseObjects that inherit from SetupInterface.
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _node_elem_constraints
NodeElemConstraint objects.

◆ hasActiveNodeFaceConstraints()

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

Definition at line 221 of file ConstraintWarehouse.C.

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

222 {
223  std::map<BoundaryID, MooseObjectWarehouse<NodeFaceConstraint>>::const_iterator it, end_it;
224 
225  if (displaced)
226  {
227  it = _displaced_node_face_constraints.find(boundary_id);
228  end_it = _displaced_node_face_constraints.end();
229  }
230 
231  else
232  {
233  it = _node_face_constraints.find(boundary_id);
234  end_it = _node_face_constraints.end();
235  }
236 
237  return (it != end_it && it->second.hasActiveObjects());
238 }
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 463 of file MooseObjectWarehouseBase.h.

464 {
465  checkThreadID(tid);
466  for (const auto & object : _active_objects[tid])
467  if (object->name() == name)
468  return true;
469  return false;
470 }
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 415 of file MooseObjectWarehouseBase.h.

416 {
417  checkThreadID(tid);
418  return !_active_objects[tid].empty();
419 }
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 119 of file MooseObjectWarehouse.h.

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

◆ hasObjects()

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

Convenience functions for determining if objects exist.

Definition at line 407 of file MooseObjectWarehouseBase.h.

408 {
409  checkThreadID(tid);
410  return !_all_objects[tid].empty();
411 }
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.

◆ initialSetup()

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

Convenience methods for calling object setup methods.

Definition at line 143 of file MooseObjectWarehouse.h.

144 {
145  checkThreadID(tid);
146  // Initial Setup should be called on all objects because they may become active later
147  for (const auto & object : _all_objects[tid])
148  object->initialSetup();
149 }
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 184 of file MooseObjectWarehouse.h.

185 {
186  checkThreadID(tid);
187  for (const auto & object : _active_objects[tid])
188  object->jacobianSetup();
189 }
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 ( )
inlineinherited

Return the number of threads.

Definition at line 163 of file MooseObjectWarehouseBase.h.

163 { 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 305 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::computeResidualInternal().

306 {
307  checkThreadID(tid);
308  for (const auto & object : _active_objects[tid])
309  object->residualEnd();
310 }
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 193 of file MooseObjectWarehouse.h.

194 {
195  checkThreadID(tid);
196  for (const auto & object : _active_objects[tid])
197  object->residualSetup();
198 }
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)
inherited

Return how many kernels we store in the current warehouse.

Definition at line 235 of file MooseObjectWarehouseBase.h.

236 {
237  checkThreadID(tid);
238  return _all_objects[tid].size();
239 }
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 536 of file MooseObjectWarehouseBase.h.

537 {
538  checkThreadID(tid);
539 
540  for (auto & object_pair : _all_block_objects[tid])
541  sortHelper(object_pair.second);
542 
543  for (auto & object_pair : _all_boundary_objects[tid])
544  sortHelper(object_pair.second);
545 
546  sortHelper(_all_objects[tid]);
547 
548  // The active lists now must be update to reflect the order changes
549  updateActive(tid);
550 }
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 674 of file MooseObjectWarehouseBase.h.

675 {
676  // Do nothing if the vector is empty
677  if (objects.empty())
678  return;
679 
680  try
681  {
682  // Sort based on dependencies
683  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
684  }
685  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
686  {
687  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
688  e, "Cyclic dependency detected in object ordering");
689  }
690 }

◆ 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 287 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::checkKernelCoverage().

290 {
291  for (const auto & it : _mortar_constraints)
292  {
293  const auto & objects = it.second.getActiveObjects();
294  for (const auto & ffc : objects)
295  {
296  MooseVariableFEBase & var = ffc->variable();
297  unique_variables.insert(var.name());
298  const std::set<SubdomainID> & subdomains = var.activeSubdomains();
299  subdomains_covered.insert(subdomains.begin(), subdomains.end());
300  }
301  }
302 }
virtual const std::set< SubdomainID > & activeSubdomains() const =0
The subdomains the variable is active on.
virtual void insert(NumericVector< Number > &residual)=0
const std::string & name() const
Get the variable name.
std::map< std::string, MooseObjectWarehouse< MortarConstraint > > _mortar_constraints
MortarConstraints.

◆ subdomainSetup() [1/2]

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

Definition at line 175 of file MooseObjectWarehouse.h.

176 {
177  checkThreadID(tid);
178  for (const auto & object : _active_objects[tid])
179  object->subdomainSetup();
180 }
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 162 of file MooseObjectWarehouse.h.

163 {
164  checkThreadID(tid);
165  if (hasActiveBlockObjects(id, tid))
166  {
167  const auto & objects = getActiveBlockObjects(id, tid);
168  for (const auto & object : objects)
169  object->subdomainSetup();
170  }
171 }
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 153 of file MooseObjectWarehouse.h.

154 {
155  checkThreadID(tid);
156  for (const auto & object : _active_objects[tid])
157  object->timestepSetup();
158 }
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)
virtual

Update the various active lists.

Reimplemented from MooseObjectWarehouse< Constraint >.

Definition at line 264 of file ConstraintWarehouse.C.

Referenced by NonlinearSystemBase::updateActive().

265 {
268 
269  for (auto & it : _node_face_constraints)
270  it.second.updateActive();
271 
272  for (auto & it : _displaced_node_face_constraints)
273  it.second.updateActive();
274 
275  // FIXME: We call updateActive() on the NodeFaceConstraints again?
276  for (auto & it : _node_face_constraints)
277  it.second.updateActive();
278 
279  for (auto & it : _element_constraints)
280  it.second.updateActive();
281 
282  for (auto & it : _node_elem_constraints)
283  it.second.updateActive();
284 }
MooseObjectWarehouse< NodalConstraint > _nodal_constraints
NodalConstraint objects.
std::map< BoundaryID, MooseObjectWarehouse< NodeFaceConstraint > > _displaced_node_face_constraints
NodeFaceConstraint objects (displaced)
std::map< std::pair< SubdomainID, SubdomainID >, MooseObjectWarehouse< NodeElemConstraint > > _node_elem_constraints
NodeElemConstraint objects.
std::map< unsigned int, MooseObjectWarehouse< ElemElemConstraint > > _element_constraints
ElemElemConstraints (non-displaced)
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 522 of file MooseObjectWarehouseBase.h.

524 {
525  // Clear the active list
526  active.clear();
527 
528  std::copy_if(all.begin(),
529  all.end(),
530  std::back_inserter(active),
531  [](const std::shared_ptr<T> & object) { return object->enabled(); });
532 }

◆ updateBlockMatPropDependency()

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

Definition at line 620 of file MooseObjectWarehouseBase.h.

623 {
624  if (hasActiveBlockObjects(id, tid))
625  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
626 }
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 updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

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

Definition at line 563 of file MooseObjectWarehouseBase.h.

567 {
568  if (hasActiveBlockObjects(id, tid))
569  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
570 }
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< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryMatPropDependency() [1/2]

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

Definition at line 630 of file MooseObjectWarehouseBase.h.

632 {
633  if (hasActiveBoundaryObjects(tid))
634  for (auto & active_bnd_object : _active_boundary_objects[tid])
635  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
636 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating material property dependency vector.
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)

◆ updateBoundaryMatPropDependency() [2/2]

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

Definition at line 640 of file MooseObjectWarehouseBase.h.

642 {
643  if (hasActiveBoundaryObjects(id, tid))
644  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
645 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< Constraint > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryVariableDependency() [1/2]

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

Definition at line 574 of file MooseObjectWarehouseBase.h.

576 {
577  if (hasActiveBoundaryObjects(tid))
578  {
579  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
580  for (const auto & object_pair : _active_boundary_objects[tid])
581  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
582  }
583 }
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< MooseVariableFEBase * > &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< MooseVariableFEBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 587 of file MooseObjectWarehouseBase.h.

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

◆ updateMatPropDependency()

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

Update material property dependency vector.

Definition at line 611 of file MooseObjectWarehouseBase.h.

613 {
614  if (hasActiveObjects(tid))
615  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
616 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating material property dependency vector.

◆ updateMatPropDependencyHelper()

void MooseObjectWarehouseBase< Constraint >::updateMatPropDependencyHelper ( std::set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< Constraint >> &  objects 
)
staticprotectedinherited

Helper method for updating material property dependency vector.

Definition at line 649 of file MooseObjectWarehouseBase.h.

651 {
652  for (auto & object : objects)
653  {
654  auto & mp_deps = object->getMatPropDependencies();
655  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
656  }
657 }

◆ updateVariableDependency()

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

Update variable dependency vector.

Definition at line 554 of file MooseObjectWarehouseBase.h.

556 {
557  if (hasActiveObjects(tid))
558  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
559 }
std::vector< std::vector< std::shared_ptr< Constraint > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Constraint >> &objects)
Helper method for updating variable dependency vector.

◆ updateVariableDependencyHelper()

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

Helper method for updating variable dependency vector.

Definition at line 598 of file MooseObjectWarehouseBase.h.

601 {
602  for (const auto & object : objects)
603  {
604  const auto & mv_deps = object->getMooseVariableDependencies();
605  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
606  }
607 }

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 179 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 185 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 173 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 176 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 182 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 170 of file MooseObjectWarehouseBase.h.

◆ _displaced_element_constraints

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

ElemElemConstraints (displaced)

Definition at line 97 of file ConstraintWarehouse.h.

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

◆ _displaced_node_elem_constraints

std::map<std::pair<SubdomainID, SubdomainID>, MooseObjectWarehouse<NodeElemConstraint> > 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 94 of file ConstraintWarehouse.h.

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

◆ _mortar_constraints

std::map<std::string, MooseObjectWarehouse<MortarConstraint> > ConstraintWarehouse::_mortar_constraints
protected

MortarConstraints.

Definition at line 91 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<NodeElemConstraint> > 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 167 of file MooseObjectWarehouseBase.h.

◆ _variable_objects

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

Variable based storage.

Definition at line 82 of file MooseObjectWarehouse.h.


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