21 #include "libmesh/threads.h" 22 #include "libmesh/quadrature.h" 29 std::vector<std::vector<std::unique_ptr<Assembly>>> & assembly)
31 _fe_problem(fe_problem),
32 _material_props(material_props),
33 _bnd_material_props(bnd_material_props),
34 _neighbor_material_props(neighbor_material_props),
35 _materials(_fe_problem.getRegularMaterialsWarehouse()),
36 _interface_materials(_fe_problem.getInterfaceMaterialsWarehouse()),
37 _discrete_materials(_fe_problem.getDiscreteMaterialWarehouse()),
39 _need_internal_side_material(false),
40 _has_stateful_props(_material_props.hasStatefulProperties()),
41 _has_bnd_stateful_props(_bnd_material_props.hasStatefulProperties()),
42 _has_neighbor_stateful_props(_neighbor_material_props.hasStatefulProperties())
50 _fe_problem(x._fe_problem),
51 _material_props(x._material_props),
52 _bnd_material_props(x._bnd_material_props),
53 _neighbor_material_props(x._neighbor_material_props),
54 _materials(x._materials),
55 _interface_materials(x._interface_materials),
56 _discrete_materials(x._discrete_materials),
57 _assembly(x._assembly),
58 _need_internal_side_material(x._need_internal_side_material),
59 _has_stateful_props(_material_props.hasStatefulProperties()),
60 _has_bnd_stateful_props(_bnd_material_props.hasStatefulProperties()),
61 _has_neighbor_stateful_props(_neighbor_material_props.hasStatefulProperties())
71 std::set<MooseVariableFEBase *> needed_moose_vars;
76 std::set<TagID> needed_fe_var_vector_tags;
95 unsigned int n_points =
_assembly[
_tid][0]->qRule()->n_points();
96 material_data.resize(n_points);
119 unsigned int face_n_points =
_assembly[
_tid][0]->qRuleFace()->n_points();
157 const Elem * neighbor = elem->neighbor_ptr(side);
160 unsigned int face_n_points =
_assembly[
_tid][0]->qRuleFace()->n_points();
182 unsigned int neighbor_side = neighbor->which_neighbor_am_i(
_assembly[
_tid][0]->elem());
188 neighbor->subdomain_id(),
_tid))
192 neighbor->subdomain_id(),
_tid),
201 neighbor->subdomain_id(),
_tid),
216 unsigned int face_n_points =
_assembly[
_tid][0]->qRuleFace()->n_points();
250 const Elem * neighbor = elem->neighbor_ptr(side);
251 unsigned int neighbor_side = neighbor->which_neighbor_am_i(
_assembly[
_tid][0]->elem());
256 if (neighbor->active() &&
265 neighbor->subdomain_id(),
_tid))
269 neighbor->subdomain_id(),
_tid),
void updateVariableDependency(std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
Base class for assembly-like calculations.
const bool _has_neighbor_stateful_props
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void join(const ComputeMaterialsObjectThread &)
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
MaterialPropertyStorage & _material_props
Stores the stateful material properties computed by materials.
bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
These methods are used to determine whether stateful material properties need to be stored on interna...
const bool _has_stateful_props
const MaterialWarehouse & _interface_materials
This is populated using _fe_problem.getResidualInterfaceMaterialsWarehouse because it has the union o...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
const MaterialWarehouse & _materials
This is populated using _fe_problem.getResidualMaterialsWarehouse because it has the union of traditi...
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid)
virtual void onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id, const Elem *lower_d_elem=nullptr) override
Called when doing boundary assembling.
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, const THREAD_ID tid) override
boundary_id_type BoundaryID
virtual void onInternalSide(const Elem *elem, unsigned int side) override
Called when doing internal edge assembling.
bool _need_internal_side_material
MaterialPropertyStorage & _neighbor_material_props
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
void updateBlockFEVariableCoupledVectorTagDependency(SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
Update FE variable coupleable vector tag vector.
std::vector< std::vector< std::unique_ptr< Assembly > > > & _assembly
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
ComputeMaterialsObjectThread(FEProblemBase &fe_problem, MaterialPropertyStorage &material_props, MaterialPropertyStorage &bnd_material_props, MaterialPropertyStorage &neighbor_material_props, std::vector< std::vector< std::unique_ptr< Assembly >>> &assembly)
const bool _has_bnd_stateful_props
MaterialData & getMaterialData(const THREAD_ID tid)
bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
SubdomainID _subdomain
The subdomain for the current element.
virtual void post() override
Called after the element range loop.
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
void initStatefulProps(const THREAD_ID tid, const std::vector< std::shared_ptr< MaterialBase >> &mats, const unsigned int n_qpoints, const Elem &elem, const unsigned int side=0)
Initialize stateful material properties.
virtual void onInterface(const Elem *elem, unsigned int side, BoundaryID bnd_id) override
Called when doing interface assembling.
MaterialPropertyStorage & _bnd_material_props
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
const MaterialWarehouse & _discrete_materials
void resize(unsigned int n_qpoints)
Resize the data to hold properties for n_qpoints quadrature points.
FEProblemBase & _fe_problem