25 #include "libmesh/equation_systems.h" 26 #include "libmesh/system.h" 27 #include "libmesh/dof_map.h" 28 #include "libmesh/string_to_enum.h" 40 "Whether or not to use libMesh's default amount of algebraic and geometric ghosting");
50 _factory(_app.getFactory()),
51 _requires_nonlocal_coupling(false),
52 _default_ghosting(getParam<bool>(
"default_ghosting")),
53 _currently_computing_jacobian(false),
54 _currently_computing_residual_and_jacobian(false),
55 _computing_nonlinear_residual(false),
56 _currently_computing_residual(false),
57 _safe_access_tagged_matrices(false),
58 _safe_access_tagged_vectors(false),
59 _have_ad_objects(false),
60 _output_functors(false),
61 _typed_vector_tags(2),
62 _have_p_refinement(false)
85 mooseError(
"Vector tag type cannot be VECTOR_TAG_ANY");
92 mooseAssert(
_vector_tags[vector_tag._id] == vector_tag,
"Vector tags index mismatch");
93 if (vector_tag._name == tag_name_upper)
95 if (vector_tag._type !=
type)
96 mooseError(
"While attempting to add vector tag with name '",
100 ",\na tag with the same name but type ",
102 " was found.\n\nA tag can only exist with one type.");
104 return vector_tag._id;
112 _vector_tags.emplace_back(new_tag_id, new_tag_type_id, tag_name_upper,
type);
131 if (vector_tag._name == tag_name_upper)
143 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
148 std::vector<VectorTag>
153 std::vector<VectorTag> tags;
154 tags.reserve(tag_ids.size());
155 for (
const auto & tag_id : tag_ids)
160 const std::vector<VectorTag> &
187 return search->second;
189 std::string message =
190 tag_name_upper ==
"TIME" 191 ?
".\n\nThis may occur if " 192 "you have a TimeKernel in your problem but did not specify a transient executioner." 194 mooseError(
"Vector tag '", tag_name_upper,
"' does not exist", message);
202 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
212 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
224 if (vector_tag._id != tag_id)
225 mooseError(
"Vector tag ", vector_tag._id,
" id mismatch in _vector_tags");
227 mooseError(
"Vector tag '", vector_tag._name,
"' has type VECTOR_TAG_ANY");
231 mooseError(
"Vector tag ", vector_tag._id,
" is not in _vector_tags_name_map");
232 else if (search->second != tag_id)
233 mooseError(
"Vector tag ", vector_tag._id,
" has incorrect id in _vector_tags_name_map");
235 unsigned int found_in_type = 0;
240 if (vector_tag_type == vector_tag)
243 if (vector_tag_type._type_id != tag_type_id)
244 mooseError(
"Type ID for Vector tag ", tag_id,
" is incorrect");
248 if (found_in_type == 0)
249 mooseError(
"Vector tag ", tag_id,
" not found in _typed_vector_tags");
250 if (found_in_type > 1)
251 mooseError(
"Vector tag ", tag_id,
" found multiple times in _typed_vector_tags");
254 unsigned int num_typed_vector_tags = 0;
256 num_typed_vector_tags += typed_vector_tags.size();
258 mooseError(
"Size mismatch between _vector_tags and _typed_vector_tags");
260 mooseError(
"Size mismatch between _vector_tags and _vector_tags_name_map");
267 const std::vector<VectorTag> & input_vector_tags,
268 std::set<TagID> & selected_tags)
270 selected_tags.clear();
271 for (
const auto & vector_tag : input_vector_tags)
273 selected_tags.insert(vector_tag._id);
316 "If this is a TimeKernel then this may have happened because you didn't " 317 "specify a Transient Executioner.");
355 const std::set<TagID> &
361 const std::set<TagID> &
396 const std::set<TagID> &
402 const std::set<TagID> &
412 if (!moose_vars.empty())
419 const std::set<MooseVariableFEBase *> &
438 std::set<SubdomainID>
441 std::set<SubdomainID> blocks;
445 const std::set<std::string> & prop_names = it.second;
446 std::set<std::string>::iterator name_it = prop_names.find(prop_name);
447 if (name_it != prop_names.end())
448 blocks.insert(it.first);
454 std::vector<SubdomainName>
458 std::vector<SubdomainName> block_names;
459 block_names.reserve(blocks.size());
460 for (
const auto & block_id : blocks)
466 std::ostringstream oss;
470 block_names.push_back(
name);
483 if (it->second.count(prop_name) > 0)
493 std::set<BoundaryID> boundaries;
497 const std::set<std::string> & prop_names = it.second;
498 std::set<std::string>::iterator name_it = prop_names.find(prop_name);
499 if (name_it != prop_names.end())
500 boundaries.insert(it.first);
506 std::vector<BoundaryName>
510 std::vector<BoundaryName> boundary_names;
511 boundary_names.reserve(boundaries.size());
512 const BoundaryInfo & boundary_info =
mesh().
getMesh().get_boundary_info();
514 for (
const auto & bnd_id : boundaries)
518 name =
"ANY_BOUNDARY_ID";
521 name = boundary_info.get_sideset_name(bnd_id);
524 std::ostringstream oss;
529 boundary_names.push_back(
name);
532 return boundary_names;
542 if (it->second.count(prop_name) > 0)
575 const std::string & name)
583 const std::string & name)
592 std::set<SubdomainID> all_ids(
mesh().meshSubdomains());
594 std::stringstream errors;
602 std::set<SubdomainID> check_ids = {check_id};
605 for (
const auto &
id : check_ids)
608 for (
const auto & prop_it : check_it.second)
617 if (check_name.empty())
618 check_name = std::to_string(
id);
619 errors <<
"Material property '" << prop_it.second <<
"', requested by '" << prop_it.first
620 <<
"' is not defined on block " << check_name <<
"\n";
626 if (!errors.str().empty())
639 std::stringstream errors;
649 std::set<BoundaryID> check_ids{check_id};
650 if (check_id == any_id)
654 for (
const auto &
id : check_ids)
657 for (
const auto & prop_it : check_it.second)
668 if (check_name.empty())
669 check_name = std::to_string(
id);
670 errors <<
"Material property '" << prop_it.second <<
"', requested by '" << prop_it.first
671 <<
"' is not defined on boundary " << check_name <<
"\n";
677 if (!errors.str().empty())
699 const std::map<MooseObjectName, std::set<std::string>> &
732 mooseError(
"This system does not support changing the mesh");
739 std::map<subdomain_id_type, std::string> & name_map =
mesh().
getMesh().set_subdomain_name_map();
740 std::map<subdomain_id_type, std::string>::const_iterator pos = name_map.find(check_id);
741 if (pos != name_map.end())
749 return mesh().
getMesh().get_boundary_info().sideset_name(check_id);
765 template <
typename T>
768 const std::string & var_name,
771 const std::vector<T> & nls,
783 var = &(nls[nl_sys_num]->getVariable(tid, var_name));
791 var = &(nls[nl_sys_num]->getVariable(tid, var_name));
796 std::string expected_var_type_string =
799 expected_var_type_string,
803 "Did you specify an auxiliary variable when you meant to specify a nonlinear " 804 "variable (or vice-versa)?");
809 (expected_var_field_type == var->
fieldType()))
813 std::string expected_var_field_type_string =
818 expected_var_field_type_string,
822 "Did you specify a ",
823 var_field_type_string,
824 " variable when you meant to specify a ",
825 expected_var_field_type_string,
835 const std::vector<Point> *
const pts,
836 const std::vector<Real> *
const weights,
854 nl.reinitElemFace(elem, side, bnd_id, tid);
865 current_assembly.prepareJacobianBlock();
867 current_assembly.prepareResidual();
872 unsigned int neighbor_side,
875 const std::vector<Point> *
const pts,
876 const std::vector<Real> *
const weights,
892 nl.prepareNeighbor(tid);
895 nl.reinitNeighborFace(neighbor_elem, neighbor_side, bnd_id, tid);
910 const std::vector<Point> *
const pts,
911 const std::vector<Real> *
const weights)
922 nl.prepareLowerD(tid);
929 nl.reinitLowerD(tid);
954 EquationSystems & eq =
es();
955 const auto n_sys = eq.n_systems();
958 &algebraic_gf, std::vector<std::shared_ptr<GhostingFunctor>>(n_sys - 1));
959 mooseAssert(pr.second,
"We are adding a duplicate algebraic ghosting functor");
960 auto & clones_vec = pr.first->second;
962 for (MooseIndex(n_sys) i = 1; i < n_sys; ++i)
964 DofMap & dof_map = eq.get_system(i).get_dof_map();
965 std::shared_ptr<GhostingFunctor> clone_alg_gf = algebraic_gf.clone();
967 ->
init(
mesh(), *algebraic_gf.get_mesh(), &dof_map);
968 dof_map.add_algebraic_ghosting_functor(clone_alg_gf, to_mesh);
969 clones_vec[i - 1] = clone_alg_gf;
976 EquationSystems & eq =
es();
977 const auto n_sys = eq.n_systems();
981 eq.get_system(0).get_dof_map().add_algebraic_ghosting_functor(algebraic_gf, to_mesh);
991 &coupling_gf, std::vector<std::shared_ptr<GhostingFunctor>>(num_nl_sys - 1));
992 mooseAssert(pr.second,
"We are adding a duplicate coupling functor");
993 auto & clones_vec = pr.first->second;
995 for (
const auto i :
make_range(std::size_t(1), num_nl_sys))
998 std::shared_ptr<GhostingFunctor> clone_coupling_gf = coupling_gf.clone();
1000 ->
init(
mesh(), *coupling_gf.get_mesh(), &dof_map);
1001 dof_map.add_coupling_functor(clone_coupling_gf, to_mesh);
1002 clones_vec[i - 1] = clone_coupling_gf;
1020 EquationSystems & eq =
es();
1021 const auto n_sys = eq.n_systems();
1024 const DofMap & nl_dof_map = eq.get_system(0).get_dof_map();
1025 const bool found_in_root_sys =
1026 std::find(nl_dof_map.algebraic_ghosting_functors_begin(),
1027 nl_dof_map.algebraic_ghosting_functors_end(),
1028 &algebraic_gf) != nl_dof_map.algebraic_ghosting_functors_end();
1029 const bool found_in_our_map =
1031 mooseAssert(found_in_root_sys == found_in_our_map,
1032 "If the ghosting functor exists in the root DofMap, then we need to have a key for " 1033 "it in our gf to clones map");
1036 eq.get_system(0).get_dof_map().remove_algebraic_ghosting_functor(algebraic_gf);
1042 auto & clones_vec = it->second;
1043 mooseAssert((n_sys - 1) == clones_vec.size(),
1044 "The size of the gf clones vector doesn't match the number of systems minus one");
1045 if (clones_vec.empty())
1047 mooseAssert(n_sys == 1,
"The clones vector should only be empty if there is only one system");
1052 eq.get_system(i + 1).get_dof_map().remove_algebraic_ghosting_functor(*clones_vec[i]);
1060 EquationSystems & eq =
es();
1066 const DofMap & nl_dof_map = eq.get_system(0).get_dof_map();
1067 const bool found_in_root_sys = std::find(nl_dof_map.coupling_functors_begin(),
1068 nl_dof_map.coupling_functors_end(),
1069 &coupling_gf) != nl_dof_map.coupling_functors_end();
1070 const bool found_in_our_map =
1072 mooseAssert(found_in_root_sys == found_in_our_map,
1073 "If the ghosting functor exists in the root DofMap, then we need to have a key for " 1074 "it in our gf to clones map");
1077 eq.get_system(0).get_dof_map().remove_coupling_functor(coupling_gf);
1083 auto & clones_vec = it->second;
1084 mooseAssert((num_nl_sys - 1) == clones_vec.size(),
1085 "The size of the gf clones vector doesn't match the number of systems minus one");
1086 if (clones_vec.empty())
1088 mooseAssert(num_nl_sys == 1,
1089 "The clones vector should only be empty if there is only one nonlinear system");
1094 eq.get_system(i + 1).get_dof_map().remove_coupling_functor(*clones_vec[i]);
1133 for (
auto & pr : map)
1134 pr.second->timestepSetup();
1141 for (
auto & pr : map)
1142 pr.second->customSetup(exec_type);
1149 for (
auto & pr : map)
1150 pr.second->residualSetup();
1157 for (
auto & pr : map)
1158 pr.second->jacobianSetup();
1171 for (
const auto & [functor_wrapper_name, functor_wrapper] : functors)
1173 const auto & [true_functor_type, non_ad_functor, ad_functor] = functor_wrapper;
1174 mooseAssert(non_ad_functor->wrapsNull() == ad_functor->wrapsNull(),
"These must agree");
1175 const auto functor_name =
removeSubstring(functor_wrapper_name,
"wraps_");
1176 if (non_ad_functor->wrapsNull())
1178 "No functor ever provided with name '",
1180 "', which was requested by '",
1184 : ad_functor->ownsWrappedFunctor())
1185 mooseError(
"Functor envelopes should not own the functors they wrap, but '",
1187 "' is owned by the wrapper. Please open a MOOSE issue for help resolving this.");
1194 _console <<
"[DBG] Wrapped functors found in Subproblem" << std::endl;
1195 std::string functor_names =
"[DBG] ";
1196 for (
const auto & functor_pair :
_functors[0])
1197 functor_names += std::regex_replace(functor_pair.first, std::regex(
"wraps_"),
"") +
" ";
1198 if (functor_names.size())
1199 functor_names.pop_back();
1200 _console << functor_names << std::endl;
1208 _console <<
"[DBG] Requestors for wrapped functor " 1209 << std::regex_replace(functor, std::regex(
"wraps_"),
"") << std::endl;
1217 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1219 return (functors.find(
"wraps_" +
name) != functors.end());
1282 if (doing_p_refinement)
1284 std::vector<FEFamily> disable_families(disable_p_refinement_for_families_enum.
size());
1285 for (
const auto i :
index_range(disable_families))
1286 disable_families[i] =
1287 Utility::string_to_enum<FEFamily>(disable_p_refinement_for_families_enum[i]);
1294 for (
const auto family : disable_families)
1295 for (
const auto i :
make_range(eq.n_systems()))
1297 auto & system = eq.get_system(i);
1298 auto & dof_map = system.get_dof_map();
1299 for (
const auto vg :
make_range(system.n_variable_groups()))
1301 const auto & var_group = system.variable_group(vg);
1302 if (var_group.type().family == family)
1303 dof_map.should_p_refine(vg,
false);
1326 const std::string & var_name,
1329 const std::vector<std::shared_ptr<NonlinearSystemBase>> & nls,
1333 const std::string & var_name,
1336 const std::vector<std::unique_ptr<DisplacedSystem>> & nls,
virtual MooseMesh & mesh()=0
virtual void addCachedResidual(const THREAD_ID tid)
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
void reinitNeighborLowerDElem(const Elem *elem, const THREAD_ID tid=0)
reinitialize a neighboring lower dimensional element
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::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid)
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid)
virtual bool hasBoundaryMaterialProperty(BoundaryID boundary_id, const std::string &prop_name)
Check if a material property is defined on a block.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
MooseVariableFieldBase & getVariableHelper(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type, Moose::VarFieldType expected_var_field_type, const std::vector< T > &nls, const SystemBase &aux) const
Helper function called by getVariable that handles the logic for checking whether Variables of the re...
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
const std::set< TagID > & getActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) const
std::string toLower(const std::string &name)
Convert supplied string to lower case.
virtual void reinitNeighborFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)
Compute the values of the variables at all the current points.
virtual std::set< BoundaryID > getMaterialPropertyBoundaryIDs(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
virtual void reinitLowerDElem(const Elem *lower_d_elem, const THREAD_ID tid, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
std::string toUpper(const std::string &name)
Convert supplied string to upper case.
virtual void storeSubdomainZeroMatProp(SubdomainID block_id, const MaterialPropertyName &name)
Adds to a map based on block ids of material properties for which a zero value can be returned...
virtual const std::vector< VectorTag > & currentResidualVectorTags() const =0
Return the residual vector tags we are currently computing.
virtual bool hasBlockMaterialProperty(SubdomainID block_id, const std::string &prop_name)
Check if a material property is defined on a block.
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
std::string restrictionBoundaryCheckName(BoundaryID check_id)
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
static InputParameters validParams()
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)
Reinit assembly info for a side of an element.
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const =0
Return the nonlinear system object as a base class reference given the system number.
const std::set< TagID > & getActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) const
virtual unsigned int currentNlSysNum() const =0
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
Helper for tracking the object that is consuming a property for MaterialPropertyDebugOutput.
std::map< std::string, std::set< std::string > > _functor_to_requestors
The requestors of functors where the key is the prop name and the value is a set of names of requesto...
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFieldBase *> &moose_vars, const THREAD_ID tid)
Set the MOOSE variables to be reinited on each element.
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid)
sets the current boundary ID in assembly
virtual void storeSubdomainDelayedCheckMatProp(const std::string &requestor, SubdomainID block_id, const std::string &name)
Adds to a map based on block ids of material properties to validate.
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid)
Set the current lower dimensional element.
virtual void reinitLowerD(THREAD_ID tid)
Compute the values of the variables on the lower dimensional element.
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
virtual void addCachedJacobian(const THREAD_ID tid)
virtual void residualSetup()
virtual void storeBoundaryZeroMatProp(BoundaryID boundary_id, const MaterialPropertyName &name)
Adds to a map based on boundary ids of material properties for which a zero value can be returned...
Class that hold the whole problem being solved.
std::unordered_map< GhostingFunctor *, std::vector< std::shared_ptr< GhostingFunctor > > > _root_alg_gf_to_sys_clones
A map from a root algebraic ghosting functor, e.g.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
virtual void storeBoundaryDelayedCheckMatProp(const std::string &requestor, BoundaryID boundary_id, const std::string &name)
Adds to a map based on boundary ids of material properties to validate.
void reinitFVFace(const THREAD_ID tid, const FaceInfo &fi)
reinitialize the finite volume assembly data for the provided face and thread
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.
static void selectVectorTagsFromSystem(const SystemBase &system, const std::vector< VectorTag > &input_vector_tags, std::set< TagID > &selected_tags)
Select the vector tags which belong to a specific system.
bool _output_functors
Whether to output a list of the functors used and requested (currently only at initialSetup) ...
void addAlgebraicGhostingFunctor(GhostingFunctor &algebraic_gf, bool to_mesh=true)
Add an algebraic ghosting functor to this problem's DofMaps.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual void jacobianSetup()
void setActiveVariableCoupleableVectorTags(const std::set< TagID > &vtags, THREAD_ID tid)
Set the active vector tags for the variables.
void showFunctors() const
Lists all functors in the problem.
Base class for a system (of equations)
const bool & currentlyComputingResidualAndJacobian() const
Returns true if the problem is in the process of computing the residual and the Jacobian.
std::vector< VectorTag > _vector_tags
The declared vector tags.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid)
Clear the active elemental MooseVariableFieldBase.
virtual const std::string & name() const
Get the name of the class.
virtual void markMatPropRequested(const std::string &)
Helper method for adding a material property name to the _material_property_requested set...
void clearAllDofIndices()
Clear dof indices from variables in nl and aux systems.
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
virtual EquationSystems & es()=0
bool verifyVectorTags() const
Verify the integrity of _vector_tags and _typed_vector_tags.
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
const std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) const
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const
void setActiveScalarVariableCoupleableVectorTags(const std::set< TagID > &vtags, THREAD_ID tid)
Set the active vector tags for the scalar variables.
virtual void customSetup(const ExecFlagType &exec_type)
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
bool automaticScaling() const
Automatic scaling getter.
void reinitLowerDElem(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for a lower dimenesional element with a given set of reference points...
This data structure is used to store geometric and variable related metadata about each cell face in ...
virtual void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, BoundaryID bnd_id, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0)
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
void removeCouplingGhostingFunctor(GhostingFunctor &coupling_gf)
Remove a coupling ghosting functor from this problem's DofMaps.
virtual bool isMatPropRequested(const std::string &prop_name) const
Find out if a material property has been requested by any object.
std::map< MooseObjectName, std::set< std::string > > _consumed_material_properties
void removeAlgebraicGhostingFunctor(GhostingFunctor &algebraic_gf)
Remove an algebraic ghosting functor from this problem's DofMaps.
bool automaticScaling() const
Getter for whether we are performing automatic scaling.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
virtual bool hasNonlocalCoupling() const =0
Whether the simulation has nonlocal coupling which should be accounted for in the Jacobian...
virtual DiracKernelInfo & diracKernelInfo()
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
virtual const SystemBase & systemBaseAuxiliary() const =0
Return the auxiliary system object as a base class reference.
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid)
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
std::vector< std::multimap< std::string, std::pair< bool, bool > > > _functor_to_request_info
A multimap (for each thread) from unfilled functor requests to whether the requests were for AD funct...
boundary_id_type BoundaryID
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const
void hasScalingVector(const unsigned int nl_sys_num)
Tells this problem that the assembly associated with the given nonlinear system number involves a sca...
VarKindType
Framework-wide stuff.
virtual void storeBoundaryMatPropName(BoundaryID boundary_id, const std::string &name)
Adds the given material property to a storage map based on boundary ids.
SubProblem(const InputParameters ¶meters)
virtual void prepareNeighbor(THREAD_ID tid)
Prepare the system for use.
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
std::string restrictionSubdomainCheckName(SubdomainID check_id)
Helper functions for checking MaterialProperties.
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
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 ...
const std::string & type() const
Get the type of this class.
virtual void checkBlockMatProps()
Checks block material properties integrity.
void havePRefinement(const std::vector< FEFamily > &disable_p_refinement_for_families)
Indicate that we have p-refinement.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
std::vector< BoundaryID > getBoundaryIDs(const libMesh::MeshBase &mesh, const std::vector< BoundaryName > &boundary_name, bool generate_unknown, const std::set< BoundaryID > &mesh_boundary_ids)
Gets the boundary IDs with their names.
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, BoundaryID bnd_id, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0)
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
virtual std::vector< SubdomainName > getMaterialPropertyBlockNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
virtual System & system()=0
Get the reference to the libMesh system.
std::string stringify(const T &t)
conversion to string
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
Get the coordinate system type, e.g.
void cloneCouplingGhostingFunctor(GhostingFunctor &coupling_gf, bool to_mesh=true)
Creates (n_sys - 1) clones of the provided coupling ghosting functor (corresponding to the nonlinear ...
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid)
void showFunctorRequestors() const
Lists all functors and all the objects that requested them.
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
bool doingPRefinement() const
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
virtual void cacheJacobianNeighbor(const THREAD_ID tid)
void cloneAlgebraicGhostingFunctor(GhostingFunctor &algebraic_gf, bool to_mesh=true)
Creates (n_sys - 1) clones of the provided algebraic ghosting functor (corresponding to the nonlinear...
std::vector< std::map< std::string, std::unique_ptr< Moose::FunctorAbstract > > > _pbblf_functors
Container to hold PiecewiseByBlockLambdaFunctors.
std::vector< std::set< TagID > > _active_fe_var_coupleable_vector_tags
void reinitFVFace(const FaceInfo &fi)
virtual void cacheResidual(const THREAD_ID tid)
virtual void timestepSetup()
std::unordered_map< GhostingFunctor *, std::vector< std::shared_ptr< GhostingFunctor > > > _root_coupling_gf_to_sys_clones
A map from a root coupling ghosting functor, e.g.
void removeSubstring(std::string &main, const std::string &sub)
find, erase, length algorithm for removing a substring from a string
std::vector< std::set< MooseVariableFieldBase * > > _active_elemental_moose_variables
This is the set of MooseVariableFieldBase that will actually get reinited by a call to reinit(elem) ...
virtual std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
virtual void initialSetup()
bool _have_p_refinement
Whether p-refinement has been requested at any point during the simulation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Class for containing MooseEnum item information.
virtual std::vector< BoundaryName > getMaterialPropertyBoundaryNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for the given neighbor_element on the given side with a given set of reference p...
std::map< TagName, TagID > _vector_tags_name_map
Map of vector tag TagName to TagID.
std::vector< unsigned int > _has_active_elemental_moose_variables
Whether or not there is currently a list of active elemental moose variables.
std::vector< std::vector< VectorTag > > _typed_vector_tags
The vector tags associated with each VectorTagType This is kept separate from _vector_tags for quick ...
void addCouplingGhostingFunctor(GhostingFunctor &coupling_gf, bool to_mesh=true)
Add a coupling functor to this problem's DofMaps.
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
IntRange< T > make_range(T beg, T end)
std::set< std::string > _material_property_requested
set containing all material property names that have been requested by getMaterialProperty* ...
virtual Moose::VarFieldType fieldType() const =0
Filed type of this variable.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual unsigned int numVectorTags(const Moose::VectorTagType type=Moose::VECTOR_TAG_ANY) const
The total number of tags, which can be limited to the tag type.
virtual void prepare(THREAD_ID tid)
Prepare the system for use.
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
void reinitElemFaceRef(const Elem *elem, unsigned int elem_side, Real tolerance, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for the given element on the given side, optionally with a given set of referenc...
std::vector< std::multimap< std::string, std::tuple< TrueFunctorIs, std::unique_ptr< Moose::FunctorEnvelopeBase >, std::unique_ptr< Moose::FunctorEnvelopeBase > > > > _functors
A container holding pointers to all the functors in our problem.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
virtual void cacheResidualNeighbor(const THREAD_ID tid)
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
virtual void prepareLowerD(THREAD_ID tid)
Prepare the system for use for lower dimensional elements.
static InputParameters validParams()
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we're doing is p-refinement.
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
virtual std::size_t numNonlinearSystems() const =0
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
checks whether we have a functor corresponding to name on the thread id tid
const std::map< MooseObjectName, std::set< std::string > > & getConsumedPropertyMap() const
Return the map that tracks the object with consumed material properties.
Storage for all of the information pretaining to a vector tag.
DiracKernelInfo _dirac_kernel_info
nonlocal coupling matrix;
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
virtual std::pair< bool, unsigned int > determineNonlinearSystem(const std::string &var_name, bool error_if_not_found=false) const =0
A class for storing the names of MooseObject by tag and object name.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num)=0
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
std::vector< std::set< TagID > > _active_fe_var_coupleable_matrix_tags
virtual const VectorTag & getVectorTag(const TagID tag_id) const
Get a VectorTag from a TagID.
std::vector< std::set< TagID > > _active_sc_var_coupleable_matrix_tags
void clearAllDofIndices()
Clear all dof indices from moose variables.
auto index_range(const T &sizable)
virtual void storeSubdomainMatPropName(SubdomainID block_id, const std::string &name)
Adds the given material property to a storage map based on block ids.
std::string join(const T &strings, const std::string &delimiter)
Python like join function for strings.
virtual void cacheJacobian(const THREAD_ID tid)
virtual void meshChanged()
void reinitMortarElem(const Elem *elem, const THREAD_ID tid=0)
Reinit a mortar element to obtain a valid JxW.
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
const BoundaryID ANY_BOUNDARY_ID
Key structure for APIs manipulating global vectors/matrices.