21 #include "libmesh/fe_base.h" 22 #include "libmesh/quadrature.h" 23 #include "libmesh/elem.h" 24 #include "libmesh/point.h" 25 #include "libmesh/mesh_base.h" 28 const std::vector<std::shared_ptr<MortarConstraintBase>> & mortar_constraints,
35 _subproblem(subproblem),
36 _fe_problem(fe_problem),
37 _displaced(displaced),
41 for (
auto mc : mortar_constraints)
55 const std::set<TagID> & vector_tag_ids,
56 const std::set<TagID> & )
60 unsigned int num_cached = 0;
64 typedef decltype(secondary_elems_to_mortar_segments.begin()) it_type;
66 std::vector<it_type> iterators;
67 for (
auto it = secondary_elems_to_mortar_segments.begin();
68 it != secondary_elems_to_mortar_segments.end();
77 iterators.push_back(it);
78 mooseAssert(secondary_elem->active(),
79 "We loop over active elements when building the mortar segment mesh, so we golly " 80 "well hope this is active.");
84 auto act_functor = [
this, &num_cached, compute_type, &vector_tags]()
95 mc->computeResidual();
102 if (num_cached % 20 == 0)
113 mc->computeJacobian();
118 if (num_cached % 20 == 0)
128 mc->computeResidualAndJacobian();
136 if (num_cached % 20 == 0)
172 catch (MetaPhysicL::LogicError & e)
virtual MooseMesh & mesh()=0
void cacheResidualNeighbor(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Rn of all field variables and appends them to the cached ...
std::vector< MortarFilterIter > secondariesToMortarSegments(const Node &node) const
virtual const char * what() const
Get out the error message.
void cacheResidualLower(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Rl and appends them to the cached values.
Keeps track of stuff related to assembling.
void setupMortarMaterials(const Consumers &consumers, FEProblemBase &fe_problem, const AutomaticMortarGeneration &amg, const THREAD_ID tid, std::map< SubdomainID, std::deque< MaterialBase *>> &secondary_ip_sub_to_mats, std::map< SubdomainID, std::deque< MaterialBase *>> &primary_ip_sub_to_mats, std::deque< MaterialBase *> &secondary_boundary_mats)
This function creates containers of materials necessary to execute the mortar method for a supplied s...
SubProblem & _subproblem
A reference to the SubProblem object for reiniting lower-dimensional element quantities.
const AutomaticMortarGeneration & _amg
Automatic mortar generation (amg) object providing the mortar mesh to loop over.
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
const Parallel::Communicator & comm() const
const std::unordered_set< const Elem * > & getInactiveLMElems() const
std::map< SubdomainID, std::deque< MaterialBase * > > _secondary_ip_sub_to_mats
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const bool _displaced
Whether the mortar constraints are operating on the displaced mesh.
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
ComputeMortarFunctor(const std::vector< std::shared_ptr< MortarConstraintBase >> &mortar_constraints, const AutomaticMortarGeneration &amg, SubProblem &subproblem, FEProblemBase &fe_problem, bool displaced, Assembly &assembly)
void cacheResidual(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Re of all field variables and appends them to the cached ...
std::deque< MaterialBase * > _secondary_boundary_mats
A container that holds the boundary materials that will need to be reinit'd on the secondary face...
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
void loopOverMortarSegments(const Iterators &secondary_elems_to_mortar_segments, Assembly &assembly, SubProblem &subproblem, FEProblemBase &fe_problem, const AutomaticMortarGeneration &amg, const bool displaced, const Consumers &consumers, const THREAD_ID tid, const std::map< SubdomainID, std::deque< MaterialBase *>> &secondary_ip_sub_to_mats, const std::map< SubdomainID, std::deque< MaterialBase *>> &primary_ip_sub_to_mats, const std::deque< MaterialBase *> &secondary_boundary_mats, const ActionFunctor act, const bool reinit_mortar_user_objects)
This method will loop over pairs of secondary elements and their corresponding mortar segments...
ComputeType
The type of nonlinear computation being performed.
std::vector< MortarConstraintBase * > _mortar_constraints
The mortar constraints to loop over when on each element.
Provides a way for users to bail out of the current solve.
Generic class for solving transient nonlinear problems.
bool computingResidual() const
bool incorrectEdgeDropping() const
std::map< SubdomainID, std::deque< MaterialBase * > > _primary_ip_sub_to_mats
A map from primary interior parent subdomain IDs to the block materials that will need to reinit'd on...
void operator()(Moose::ComputeType compute_type, const std::set< TagID > &vector_tag_ids, const std::set< TagID > &matrix_tag_ids)
Loops over the mortar segment mesh and computes the residual/Jacobian.
const std::unordered_set< const Node * > & getInactiveLMNodes() const
bool computingJacobian() const
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
processor_id_type processor_id() const
FEProblemBase & _fe_problem
A reference to the FEProblemBase object for reiniting higher-dimensional element and neighbor element...
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Assembly & _assembly
A reference to the assembly object.
Key structure for APIs manipulating global vectors/matrices.