https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
MortarUserObjectThread Class Reference

#include <MortarUserObjectThread.h>

Inheritance diagram for MortarUserObjectThread:
[legend]

Public Member Functions

 MortarUserObjectThread (std::vector< MortarUserObject *> &mortar_user_objects, const AutomaticMortarGeneration &amg, SubProblem &subproblem, FEProblemBase &fe_problem, bool displaced, Assembly &assembly)
 
void operator() ()
 Loops over the mortar segment mesh and executes the user objects. More...
 

Protected Attributes

Materials for Mortar

These containers hold the materials whose properties are required by a given set of consumers.

Note that these containers will also hold materials that may not provide properties explicitly needed by the consumers but do provided properties that are dependencies of the materials that do provide properties needed by the consumers

std::map< SubdomainID, std::deque< MaterialBase * > > _secondary_ip_sub_to_mats
 
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 the primary face. More...
 
std::deque< MaterialBase * > _secondary_boundary_mats
 A container that holds the boundary materials that will need to be reinit'd on the secondary face. More...
 

Private Attributes

std::vector< MortarUserObject * > & _mortar_user_objects
 The mortar user objects to loop over when on each mortar segment element. More...
 
const AutomaticMortarGeneration_amg
 Automatic mortar generation (amg) object providing the mortar mesh to loop over. More...
 
SubProblem_subproblem
 A reference to the SubProblem object for reiniting lower-dimensional element quantities. More...
 
FEProblemBase_fe_problem
 A reference to the FEProblemBase object for reiniting higher-dimensional element and neighbor element quantities. More...
 
const bool _displaced
 Whether the mortar user objects are operating on the displaced mesh. More...
 
Assembly_assembly
 A reference to the assembly object. More...
 

Detailed Description

Definition at line 23 of file MortarUserObjectThread.h.

Constructor & Destructor Documentation

◆ MortarUserObjectThread()

MortarUserObjectThread::MortarUserObjectThread ( std::vector< MortarUserObject *> &  mortar_user_objects,
const AutomaticMortarGeneration amg,
SubProblem subproblem,
FEProblemBase fe_problem,
bool  displaced,
Assembly assembly 
)

Definition at line 27 of file MortarUserObjectThread.C.

34  : _mortar_user_objects(mortar_user_objects),
35  _amg(amg),
36  _subproblem(subproblem),
37  _fe_problem(fe_problem),
38  _displaced(displaced),
39  _assembly(assembly)
40 {
43  _amg,
44  0,
48 }
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...
Definition: MortarUtils.h:316
Assembly & _assembly
A reference to the assembly object.
std::map< SubdomainID, std::deque< MaterialBase * > > _secondary_ip_sub_to_mats
SubProblem & _subproblem
A reference to the SubProblem object for reiniting lower-dimensional element quantities.
std::deque< MaterialBase * > _secondary_boundary_mats
A container that holds the boundary materials that will need to be reinit&#39;d on the secondary face...
const bool _displaced
Whether the mortar user objects are operating on the displaced mesh.
std::vector< MortarUserObject * > & _mortar_user_objects
The mortar user objects to loop over when on each mortar segment element.
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&#39;d on...
FEProblemBase & _fe_problem
A reference to the FEProblemBase object for reiniting higher-dimensional element and neighbor element...
const AutomaticMortarGeneration & _amg
Automatic mortar generation (amg) object providing the mortar mesh to loop over.

Member Function Documentation

◆ operator()()

void MortarUserObjectThread::operator() ( )

Loops over the mortar segment mesh and executes the user objects.

Definition at line 51 of file MortarUserObjectThread.C.

52 {
53  const auto & secondary_elems_to_mortar_segments = _amg.secondariesToMortarSegments();
54  typedef decltype(secondary_elems_to_mortar_segments.begin()) it_type;
55 
56  std::vector<it_type> iterators;
57  for (auto it = secondary_elems_to_mortar_segments.begin();
58  it != secondary_elems_to_mortar_segments.end();
59  ++it)
60  {
61  auto * const secondary_elem = _subproblem.mesh().getMesh().query_elem_ptr(it->first);
62 
63  if (secondary_elem && secondary_elem->processor_id() == _subproblem.processor_id() &&
64  !it->second.empty())
65  {
66  // This is local and the mortar segment set isn't empty, so include
67  iterators.push_back(it);
68  mooseAssert(secondary_elem->active(),
69  "We loop over active elements when building the mortar segment mesh, so we golly "
70  "well hope this is active.");
71  }
72  }
73 
74  auto act_functor = [this]()
75  {
76  for (auto * const mc : _mortar_user_objects)
77  {
78  mc->setNormals();
79  mc->execute();
80  }
81  };
82 
84  _assembly,
87  _amg,
88  _displaced,
90  0,
94  act_functor,
95  /*reinit_mortar_user_objects=*/false);
96 }
virtual MooseMesh & mesh()=0
std::vector< MortarFilterIter > secondariesToMortarSegments(const Node &node) const
Assembly & _assembly
A reference to the assembly object.
std::map< SubdomainID, std::deque< MaterialBase * > > _secondary_ip_sub_to_mats
SubProblem & _subproblem
A reference to the SubProblem object for reiniting lower-dimensional element quantities.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3443
std::deque< MaterialBase * > _secondary_boundary_mats
A container that holds the boundary materials that will need to be reinit&#39;d on the secondary face...
const bool _displaced
Whether the mortar user objects are operating on the displaced mesh.
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...
Definition: MortarUtils.h:69
std::vector< MortarUserObject * > & _mortar_user_objects
The mortar user objects to loop over when on each mortar segment element.
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&#39;d on...
processor_id_type processor_id() const
FEProblemBase & _fe_problem
A reference to the FEProblemBase object for reiniting higher-dimensional element and neighbor element...
const AutomaticMortarGeneration & _amg
Automatic mortar generation (amg) object providing the mortar mesh to loop over.

Member Data Documentation

◆ _amg

const AutomaticMortarGeneration& MortarUserObjectThread::_amg
private

Automatic mortar generation (amg) object providing the mortar mesh to loop over.

Definition at line 43 of file MortarUserObjectThread.h.

Referenced by MortarUserObjectThread(), and operator()().

◆ _assembly

Assembly& MortarUserObjectThread::_assembly
private

A reference to the assembly object.

Definition at line 57 of file MortarUserObjectThread.h.

Referenced by operator()().

◆ _displaced

const bool MortarUserObjectThread::_displaced
private

Whether the mortar user objects are operating on the displaced mesh.

Definition at line 54 of file MortarUserObjectThread.h.

Referenced by operator()().

◆ _fe_problem

FEProblemBase& MortarUserObjectThread::_fe_problem
private

A reference to the FEProblemBase object for reiniting higher-dimensional element and neighbor element quantities.

We use the FEProblemBase object for reiniting these because we may be using material properties from either undisplaced or displaced materials

Definition at line 51 of file MortarUserObjectThread.h.

Referenced by MortarUserObjectThread(), and operator()().

◆ _mortar_user_objects

std::vector<MortarUserObject *>& MortarUserObjectThread::_mortar_user_objects
private

The mortar user objects to loop over when on each mortar segment element.

Definition at line 40 of file MortarUserObjectThread.h.

Referenced by MortarUserObjectThread(), and operator()().

◆ _primary_ip_sub_to_mats

std::map<SubdomainID, std::deque<MaterialBase *> > MortarExecutorInterface::_primary_ip_sub_to_mats
protectedinherited

A map from primary interior parent subdomain IDs to the block materials that will need to reinit'd on the primary face.

Definition at line 43 of file MortarExecutorInterface.h.

Referenced by ComputeMortarFunctor::ComputeMortarFunctor(), MortarUserObjectThread(), operator()(), and ComputeMortarFunctor::operator()().

◆ _secondary_boundary_mats

std::deque<MaterialBase *> MortarExecutorInterface::_secondary_boundary_mats
protectedinherited

A container that holds the boundary materials that will need to be reinit'd on the secondary face.

Definition at line 47 of file MortarExecutorInterface.h.

Referenced by ComputeMortarFunctor::ComputeMortarFunctor(), MortarUserObjectThread(), operator()(), and ComputeMortarFunctor::operator()().

◆ _secondary_ip_sub_to_mats

std::map<SubdomainID, std::deque<MaterialBase *> > MortarExecutorInterface::_secondary_ip_sub_to_mats
protectedinherited

A map from secondary interior parent subdomain IDs to the block materials that will need to reinit'd on the secondary face

Definition at line 39 of file MortarExecutorInterface.h.

Referenced by ComputeMortarFunctor::ComputeMortarFunctor(), MortarUserObjectThread(), operator()(), and ComputeMortarFunctor::operator()().

◆ _subproblem

SubProblem& MortarUserObjectThread::_subproblem
private

A reference to the SubProblem object for reiniting lower-dimensional element quantities.

Definition at line 46 of file MortarUserObjectThread.h.

Referenced by operator()().


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