26#include "libmesh/equation_systems.h"
27#include "libmesh/system.h"
28#include "libmesh/dof_map.h"
29#include "libmesh/string_to_enum.h"
41 "Whether or not to use libMesh's default amount of algebraic and geometric ghosting");
51 _factory(_app.getFactory()),
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 _show_functors(false),
61 _show_chain_control_data(false),
88 mooseError(
"Vector tag type cannot be VECTOR_TAG_ANY");
95 mooseAssert(
_vector_tags[vector_tag._id] == vector_tag,
"Vector tags index mismatch");
96 if (vector_tag._name == tag_name_upper)
98 if (vector_tag._type !=
type)
99 mooseError(
"While attempting to add vector tag with name '",
103 ",\na tag with the same name but type ",
105 " was found.\n\nA tag can only exist with one type.");
107 return vector_tag._id;
115 _vector_tags.emplace_back(new_tag_id, new_tag_type_id, tag_name_upper,
type);
134 if (vector_tag._name == tag_name_upper)
158 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
163std::vector<VectorTag>
168 std::vector<VectorTag> tags;
169 tags.reserve(tag_ids.size());
170 for (
const auto & tag_id : tag_ids)
175const std::vector<VectorTag> &
202 return search->second;
204 std::string message =
205 tag_name_upper ==
"TIME"
206 ?
".\n\nThis may occur if "
207 "you have a TimeKernel in your problem but did not specify a transient executioner."
209 mooseError(
"Vector tag '", tag_name_upper,
"' does not exist", message);
217 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
227 mooseError(
"Vector tag with ID ", tag_id,
" does not exist");
239 if (vector_tag._id != tag_id)
240 mooseError(
"Vector tag ", vector_tag._id,
" id mismatch in _vector_tags");
242 mooseError(
"Vector tag '", vector_tag._name,
"' has type VECTOR_TAG_ANY");
246 mooseError(
"Vector tag ", vector_tag._id,
" is not in _vector_tags_name_map");
247 else if (search->second != tag_id)
248 mooseError(
"Vector tag ", vector_tag._id,
" has incorrect id in _vector_tags_name_map");
250 unsigned int found_in_type = 0;
255 if (vector_tag_type == vector_tag)
258 if (vector_tag_type._type_id != tag_type_id)
259 mooseError(
"Type ID for Vector tag ", tag_id,
" is incorrect");
263 if (found_in_type == 0)
264 mooseError(
"Vector tag ", tag_id,
" not found in _typed_vector_tags");
265 if (found_in_type > 1)
266 mooseError(
"Vector tag ", tag_id,
" found multiple times in _typed_vector_tags");
269 unsigned int num_typed_vector_tags = 0;
271 num_typed_vector_tags += typed_vector_tags.size();
273 mooseError(
"Size mismatch between _vector_tags and _typed_vector_tags");
275 mooseError(
"Size mismatch between _vector_tags and _vector_tags_name_map");
282 const std::vector<VectorTag> & input_vector_tags,
283 std::set<TagID> & selected_tags)
285 selected_tags.clear();
286 for (
const auto & vector_tag : input_vector_tags)
288 selected_tags.insert(vector_tag._id);
293 const std::map<TagName, TagID> & input_matrix_tags,
294 std::set<TagID> & selected_tags)
296 selected_tags.clear();
297 for (
const auto & matrix_tag_pair : input_matrix_tags)
298 if (system.
hasMatrix(matrix_tag_pair.second))
299 selected_tags.insert(matrix_tag_pair.second);
342 "If this is a TimeKernel then this may have happened because you didn't "
343 "specify a Transient Executioner.");
381const std::set<TagID> &
387const std::set<TagID> &
422const std::set<TagID> &
428const std::set<TagID> &
438 if (!moose_vars.empty())
445const std::set<MooseVariableFEBase *> &
467 std::set<SubdomainID>
blocks;
471 const std::set<std::string> & prop_names = it.second;
472 std::set<std::string>::iterator name_it = prop_names.find(prop_name);
473 if (name_it != prop_names.end())
480std::vector<SubdomainName>
484 std::vector<SubdomainName> block_names;
485 block_names.reserve(
blocks.size());
486 for (
const auto & block_id :
blocks)
492 std::ostringstream oss;
496 block_names.push_back(
name);
509 if (it->second.count(prop_name) > 0)
519 std::set<BoundaryID> boundaries;
523 const std::set<std::string> & prop_names = it.second;
524 std::set<std::string>::iterator name_it = prop_names.find(prop_name);
525 if (name_it != prop_names.end())
526 boundaries.insert(it.first);
532std::vector<BoundaryName>
536 std::vector<BoundaryName> boundary_names;
537 boundary_names.reserve(boundaries.size());
538 const BoundaryInfo & boundary_info =
mesh().
getMesh().get_boundary_info();
540 for (
const auto & bnd_id : boundaries)
544 name =
"ANY_BOUNDARY_ID";
547 name = boundary_info.get_sideset_name(bnd_id);
550 std::ostringstream oss;
555 boundary_names.push_back(
name);
558 return boundary_names;
568 if (it->second.count(prop_name) > 0)
601 const std::string & name)
609 const std::string & name)
618 std::set<SubdomainID> all_ids(
mesh().meshSubdomains());
620 std::stringstream errors;
628 std::set<SubdomainID> check_ids = {check_id};
631 for (
const auto &
id : check_ids)
634 for (
const auto & prop_it : check_it.second)
643 if (check_name.empty())
644 check_name = std::to_string(
id);
645 errors <<
"Material property '" << prop_it.second <<
"', requested by '" << prop_it.first
646 <<
"' is not defined on block " << check_name <<
"\n";
652 if (!errors.str().empty())
663 std::set<BoundaryID> all_ids(
mesh().getBoundaryIDs());
665 std::stringstream errors;
675 std::set<BoundaryID> check_ids{check_id};
676 if (check_id == any_id)
680 for (
const auto &
id : check_ids)
683 for (
const auto & prop_it : check_it.second)
694 if (check_name.empty())
695 check_name = std::to_string(
id);
696 errors <<
"Material property '" << prop_it.second <<
"', requested by '" << prop_it.first
697 <<
"' is not defined on boundary " << check_name <<
"\n";
703 if (!errors.str().empty())
711 "The nonlinear system number is higher than the number of systems we have!");
733const std::map<MooseObjectName, std::set<std::string>> &
767 std::map<subdomain_id_type, std::string> & name_map =
mesh().
getMesh().set_subdomain_name_map();
768 std::map<subdomain_id_type, std::string>::const_iterator pos = name_map.find(check_id);
769 if (pos != name_map.end())
777 return mesh().
getMesh().get_boundary_info().sideset_name(check_id);
811 const std::string & var_name,
814 const std::vector<T> & systems,
826 var = &(systems[sys_num]->getVariable(tid, var_name));
834 var = &(systems[sys_num]->getVariable(tid, var_name));
839 std::string expected_var_type_string =
842 expected_var_type_string,
846 "Did you specify an auxiliary variable when you meant to specify a nonlinear "
847 "variable (or vice-versa)?");
852 (expected_var_field_type == var->
fieldType()))
856 std::string expected_var_field_type_string =
861 expected_var_field_type_string,
865 "Did you specify a ",
866 var_field_type_string,
867 " variable when you meant to specify a ",
868 expected_var_field_type_string,
877 const std::vector<Point> *
const pts,
878 const std::vector<Real> *
const weights,
896 nl.reinitElemFace(elem, side, tid);
907 current_assembly.prepareJacobianBlock();
909 current_assembly.prepareResidual();
914 unsigned int neighbor_side,
916 const std::vector<Point> *
const pts,
917 const std::vector<Real> *
const weights,
933 nl.prepareNeighbor(tid);
936 nl.reinitNeighborFace(neighbor_elem, neighbor_side, tid);
951 const std::vector<Point> *
const pts,
952 const std::vector<Real> *
const weights)
963 nl.prepareLowerD(tid);
970 nl.reinitLowerD(tid);
1015 &algebraic_gf, std::vector<std::shared_ptr<libMesh::GhostingFunctor>>(n_sys - 1));
1016 mooseAssert(pr.second,
"We are adding a duplicate algebraic ghosting functor");
1017 auto & clones_vec = pr.first->second;
1019 for (MooseIndex(n_sys) i = 1; i < n_sys; ++i)
1021 DofMap & dof_map = eq.
get_system(i).get_dof_map();
1022 std::shared_ptr<libMesh::GhostingFunctor> clone_alg_gf = algebraic_gf.
clone();
1023 std::dynamic_pointer_cast<RelationshipManager>(clone_alg_gf)
1025 dof_map.add_algebraic_ghosting_functor(clone_alg_gf, to_mesh);
1026 clones_vec[i - 1] = clone_alg_gf;
1038 eq.
get_system(0).get_dof_map().add_algebraic_ghosting_functor(algebraic_gf, to_mesh);
1048 &coupling_gf, std::vector<std::shared_ptr<libMesh::GhostingFunctor>>(num_nl_sys - 1));
1049 mooseAssert(pr.second,
"We are adding a duplicate coupling functor");
1050 auto & clones_vec = pr.first->second;
1052 for (
const auto i : make_range(std::size_t(1), num_nl_sys))
1055 std::shared_ptr<libMesh::GhostingFunctor> clone_coupling_gf = coupling_gf.
clone();
1056 std::dynamic_pointer_cast<RelationshipManager>(clone_coupling_gf)
1058 dof_map.add_coupling_functor(clone_coupling_gf, to_mesh);
1059 clones_vec[i - 1] = clone_coupling_gf;
1079 DofMap & nl_dof_map = eq.
get_system(0).get_dof_map();
1081 const bool found_in_root_sys =
1082 std::find(nl_dof_map.algebraic_ghosting_functors_begin(),
1083 nl_dof_map.algebraic_ghosting_functors_end(),
1084 &algebraic_gf) != nl_dof_map.algebraic_ghosting_functors_end();
1087 const bool found_in_our_map =
1089 mooseAssert(found_in_root_sys == found_in_our_map,
1090 "If the ghosting functor exists in the root DofMap, then we need to have a key for "
1091 "it in our gf to clones map");
1094 if (found_in_root_sys)
1096 nl_dof_map.remove_algebraic_ghosting_functor(algebraic_gf);
1102 auto & clones_vec = it->second;
1103 mooseAssert((n_sys - 1) == clones_vec.size(),
1104 "The size of the gf clones vector doesn't match the number of systems minus one");
1105 if (clones_vec.empty())
1107 mooseAssert(n_sys == 1,
"The clones vector should only be empty if there is only one system");
1111 for (
const auto i : make_range(n_sys))
1112 eq.
get_system(i + 1).get_dof_map().remove_algebraic_ghosting_functor(*clones_vec[i]);
1125 DofMap & nl_dof_map = eq.
get_system(0).get_dof_map();
1126 const bool found_in_root_sys = std::find(nl_dof_map.coupling_functors_begin(),
1127 nl_dof_map.coupling_functors_end(),
1128 &coupling_gf) != nl_dof_map.coupling_functors_end();
1131 const bool found_in_our_map =
1133 mooseAssert(found_in_root_sys == found_in_our_map,
1134 "If the ghosting functor exists in the root DofMap, then we need to have a key for "
1135 "it in our gf to clones map");
1138 if (found_in_root_sys)
1140 nl_dof_map.remove_coupling_functor(coupling_gf);
1146 auto & clones_vec = it->second;
1147 mooseAssert((num_nl_sys - 1) == clones_vec.size(),
1148 "The size of the gf clones vector doesn't match the number of systems minus one");
1149 if (clones_vec.empty())
1151 mooseAssert(num_nl_sys == 1,
1152 "The clones vector should only be empty if there is only one nonlinear system");
1156 for (
const auto i : make_range(num_nl_sys))
1157 eq.
get_system(i + 1).get_dof_map().remove_coupling_functor(*clones_vec[i]);
1189 for (
auto & pr : map)
1190 pr.second->timestepSetup();
1199 for (
auto & pr : map)
1200 pr.second->customSetup(exec_type);
1207 for (
auto & pr : map)
1208 pr.second->residualSetup();
1215 for (
auto & pr : map)
1216 pr.second->jacobianSetup();
1231 for (
const auto & [functor_wrapper_name, functor_wrapper] : functors)
1233 const auto & [true_functor_type, non_ad_functor, ad_functor] = functor_wrapper;
1234 mooseAssert(non_ad_functor->wrapsNull() == ad_functor->wrapsNull(),
"These must agree");
1235 const auto functor_name =
removeSubstring(functor_wrapper_name,
"wraps_");
1236 if (non_ad_functor->wrapsNull())
1238 "No functor ever provided with name '",
1240 "', which was requested by '",
1244 : ad_functor->ownsWrappedFunctor())
1245 mooseError(
"Functor envelopes should not own the functors they wrap, but '",
1247 "' is owned by the wrapper. Please open a MOOSE issue for help resolving this.");
1254 _console <<
"[DBG] Wrapped functors found in Subproblem" << std::endl;
1255 std::string functor_names =
"[DBG] ";
1256 for (
const auto & functor_pair :
_functors[0])
1257 functor_names += std::regex_replace(functor_pair.first, std::regex(
"wraps_"),
"") +
" ";
1258 if (functor_names.size())
1259 functor_names.pop_back();
1260 _console << functor_names << std::endl;
1268 _console <<
"[DBG] Requestors for wrapped functor "
1269 << std::regex_replace(functor, std::regex(
"wraps_"),
"") << std::endl;
1270 _console <<
"[DBG] " << MooseUtils::join(requestors,
" ") << std::endl;
1277 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1279 return (functors.find(
"wraps_" +
name) != functors.end());
1339 for (
const auto tid : make_range(
numThreads()))
1359 const std::string & var_name,
1362 const std::vector<std::shared_ptr<SolverSystem>> & nls,
1366 const std::string & var_name,
1369 const std::vector<std::unique_ptr<DisplacedSystem>> & nls,
boundary_id_type BoundaryID
subdomain_id_type SubdomainID
void removeSubstring(std::string &main, const std::string &sub)
Key structure for APIs manipulating global vectors/matrices.
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
void reinitFVFace(const FaceInfo &fi)
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 ...
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...
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
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.
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
void preparePRefinement()
Prepare helper FEs for p-refinement.
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
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 ...
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...
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
std::string outputChainControlMap() const
Output the chain control map to a string.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
This data structure is used to store geometric and variable related metadata about each cell face in ...
void reinit()
Completely redo all geometric search objects.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
THREAD_ID numThreads() const
Returns the number of threads this application uses.
const std::string & type() const
Get the type of this class.
const std::string & name() const
Get the name of the class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Class for containing MooseEnum item information.
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
Get the coordinate system type, e.g.
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we're doing includes p-refinement.
A class for storing the names of MooseObject by tag and object name.
MooseApp & _app
The MOOSE application this is associated with.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual Moose::VarFieldType fieldType() const =0
Field type of this variable.
Class that hold the whole problem being solved.
static InputParameters validParams()
const std::map< MooseObjectName, std::set< std::string > > & getConsumedPropertyMap() const
Return the map that tracks the object with consumed material properties.
std::vector< std::map< std::string, std::unique_ptr< Moose::FunctorAbstract > > > _pbblf_functors
Container to hold PiecewiseByBlockLambdaFunctors.
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid)
void showFunctorRequestors() const
Lists all functors and all the objects that requested them.
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
Helper for tracking the object that is consuming a property for MaterialPropertyDebugOutput.
THREAD_ID numThreads() const
std::vector< VectorTag > _vector_tags
The declared vector tags.
virtual void storeSubdomainMatPropName(SubdomainID block_id, const std::string &name)
Adds the given material property to a storage map based on block ids.
void reinitFVFace(const THREAD_ID tid, const FaceInfo &fi)
reinitialize the finite volume assembly data for the provided face and thread
void showFunctors() const
Lists all functors in the problem.
virtual MooseMesh & mesh()=0
virtual unsigned int currentNlSysNum() const =0
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
virtual void cacheJacobianNeighbor(const THREAD_ID tid)
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.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
std::string restrictionBoundaryCheckName(BoundaryID check_id)
void removeAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf)
Remove an algebraic ghosting functor from this problem's DofMaps.
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
std::vector< std::vector< VectorTag > > _typed_vector_tags
The vector tags associated with each VectorTagType This is kept separate from _vector_tags for quick ...
virtual void markMatPropRequested(const std::string &)
Helper method for adding a material property name to the _material_property_requested set.
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
virtual bool hasBoundaryMaterialProperty(BoundaryID boundary_id, const std::string &prop_name)
Check if a material property is defined on a block.
virtual void checkBlockMatProps()
Checks block material properties integrity.
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
std::vector< std::set< TagID > > _active_fe_var_coupleable_vector_tags
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid)
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
virtual std::size_t numNonlinearSystems() const =0
virtual bool hasLinearVariable(const std::string &var_name) const
Whether or not this problem has this linear variable.
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)
void clearAllDofIndices()
Clear dof indices from variables in nl and aux systems.
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
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, 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 const VectorTag & getVectorTag(const TagID tag_id) const
Get a VectorTag from a TagID.
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
virtual void customSetup(const ExecFlagType &exec_type)
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.
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid)
sets the current boundary ID in assembly
virtual void cacheResidual(const THREAD_ID tid)
virtual void jacobianSetup()
virtual void initialSetup()
virtual void cacheJacobian(const THREAD_ID tid)
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
bool doingPRefinement() const
std::map< MooseObjectName, std::set< std::string > > _consumed_material_properties
virtual DiracKernelInfo & diracKernelInfo()
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const
void preparePRefinement()
Prepare DofMap and Assembly classes with our p-refinement information.
static InputParameters validParams()
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
std::unordered_map< libMesh::GhostingFunctor *, std::vector< std::shared_ptr< libMesh::GhostingFunctor > > > _root_coupling_gf_to_sys_clones
A map from a root coupling ghosting functor, e.g.
void reinitNeighborLowerDElem(const Elem *elem, const THREAD_ID tid=0)
reinitialize a neighboring lower dimensional element
virtual void storeBoundaryMatPropName(BoundaryID boundary_id, const std::string &name)
Adds the given material property to a storage map based on boundary ids.
void removeCouplingGhostingFunctor(libMesh::GhostingFunctor &coupling_gf)
Remove a coupling ghosting functor from this problem's DofMaps.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
std::map< TagName, TagID > _vector_tags_name_map
Map of vector tag TagName to TagID.
virtual 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, const THREAD_ID tid=0)
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
virtual bool hasNonlocalCoupling() const =0
Whether the simulation has active nonlocal coupling which should be accounted for in the Jacobian.
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
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 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.
void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)
void cloneCouplingGhostingFunctor(libMesh::GhostingFunctor &coupling_gf, bool to_mesh=true)
Creates (n_sys - 1) clones of the provided coupling ghosting functor (corresponding to the nonlinear ...
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 std::size_t numSolverSystems() const =0
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
void addNotZeroedVectorTag(const TagID tag)
Adds a vector tag to the list of vectors that will not be zeroed when other tagged vectors are.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
std::vector< std::set< TagID > > _active_sc_var_coupleable_matrix_tags
DiracKernelInfo _dirac_kernel_info
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
virtual std::size_t numLinearSystems() const =0
bool _show_chain_control_data
Whether to output a list of all the chain control data.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const =0
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const
void reinitMortarElem(const Elem *elem, const THREAD_ID tid=0)
Reinit a mortar element to obtain a valid JxW.
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 void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual bool solverSystemConverged(const unsigned int sys_num)
bool verifyVectorTags() const
Verify the integrity of _vector_tags and _typed_vector_tags.
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
std::unordered_set< TagID > _not_zeroed_tagged_vectors
the list of vector tags that will not be zeroed when all other tags are
void addCouplingGhostingFunctor(libMesh::GhostingFunctor &coupling_gf, bool to_mesh=true)
Add a coupling functor to this problem's DofMaps.
virtual const SystemBase & systemBaseLinear(const unsigned int sys_num) const =0
Return the linear system object as a base class reference given the system number.
void addAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf, bool to_mesh=true)
Add an algebraic ghosting functor to this problem's DofMaps.
virtual bool hasBlockMaterialProperty(SubdomainID block_id, const std::string &prop_name)
Check if a material property is defined on a block.
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.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
const std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) const
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid)
std::unordered_map< libMesh::GhostingFunctor *, std::vector< std::shared_ptr< libMesh::GhostingFunctor > > > _root_alg_gf_to_sys_clones
A map from a root algebraic ghosting functor, e.g.
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid)
Clear the active elemental MooseVariableFieldBase.
void cloneAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf, bool to_mesh=true)
Creates (n_sys - 1) clones of the provided algebraic ghosting functor (corresponding to the nonlinear...
static void selectMatrixTagsFromSystem(const SystemBase &system, const std::map< TagName, TagID > &input_matrix_tags, std::set< TagID > &selected_tags)
Select the matrix tags which belong to a specific system.
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.
std::string restrictionSubdomainCheckName(SubdomainID check_id)
Helper functions for checking MaterialProperties.
bool vectorTagNotZeroed(const TagID tag) const
Checks if a vector tag is in the list of vectors that will not be zeroed when other tagged vectors ar...
virtual const SystemBase & systemBaseAuxiliary() const =0
Return the auxiliary system object as a base class reference.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid)
Set the current lower dimensional element.
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
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...
virtual std::set< BoundaryID > getMaterialPropertyBoundaryIDs(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
virtual void addCachedResidual(const THREAD_ID tid)
virtual void addCachedJacobian(const THREAD_ID tid)
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
SubProblem(const InputParameters ¶meters)
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
virtual libMesh::EquationSystems & es()=0
std::set< std::string > _material_property_requested
set containing all material property names that have been requested by getMaterialProperty*
bool _show_functors
Whether to output a list of the functors used and requested (currently only at initialSetup)
virtual bool hasAuxiliaryVariable(const std::string &var_name) const
Whether or not this problem has this auxiliary variable.
std::vector< std::set< TagID > > _active_fe_var_coupleable_matrix_tags
virtual std::vector< BoundaryName > getMaterialPropertyBoundaryNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
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 timestepSetup()
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
virtual const std::vector< VectorTag > & currentResidualVectorTags() const =0
Return the residual vector tags we are currently computing.
std::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const =0
Return the solver system object as a base class reference given the system number.
virtual bool nlConverged(const unsigned int nl_sys_num)
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
virtual void cacheResidualNeighbor(const THREAD_ID tid)
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.
const std::set< TagID > & getActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) const
virtual std::vector< SubdomainName > getMaterialPropertyBlockNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
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...
virtual void residualSetup()
virtual bool isMatPropRequested(const std::string &prop_name) const
Find out if a material property has been requested by any object.
const std::set< TagID > & getActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) const
const bool & currentlyComputingResidualAndJacobian() const
Returns true if the problem is in the process of computing the residual and the Jacobian.
std::vector< unsigned int > _has_active_elemental_moose_variables
Whether or not there is currently a list of active elemental moose variables.
virtual GeometricSearchData & geomSearchData()=0
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.
void reinitGeomSearch()
reinitialize this object's geometric search data, e.g.
bool automaticScaling() const
Automatic scaling getter.
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)
Base class for a system (of equations)
virtual void prepareNeighbor(THREAD_ID tid)
Prepare the system for use.
bool automaticScaling() const
Getter for whether we are performing automatic scaling.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid)
Reinit variables at a set of nodes.
virtual void reinitNeighborFace(const Elem *elem, unsigned int side, THREAD_ID tid)
Compute the values of the variables at all the current points.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
void setActiveScalarVariableCoupleableVectorTags(const std::set< TagID > &vtags, THREAD_ID tid)
Set the active vector tags for the scalar variables.
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, THREAD_ID tid)
Reinit variables at a set of neighbor nodes.
virtual void reinitLowerD(THREAD_ID tid)
Compute the values of the variables on the lower dimensional element.
virtual void prepare(THREAD_ID tid)
Prepare the system for use.
virtual void reinitElemFace(const Elem *elem, unsigned int side, THREAD_ID tid)
Reinit assembly info for a side of an element.
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
void clearAllDofIndices()
Clear all dof indices from moose variables.
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
void setActiveVariableCoupleableVectorTags(const std::set< TagID > &vtags, THREAD_ID tid)
Set the active vector tags for the variables.
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
virtual void prepareLowerD(THREAD_ID tid)
Prepare the system for use for lower dimensional elements.
Storage for all of the information pretaining to a vector tag.
void add_coupling_functor(GhostingFunctor &coupling_functor, bool to_mesh=true)
unsigned int n_systems() const
const T_sys & get_system(std::string_view name) const
virtual std::unique_ptr< GhostingFunctor > clone() const=0
const MeshBase * get_mesh() const
const DofMap & get_dof_map() const
std::string toUpper(std::string name)
Convert supplied string to upper case.
std::string toLower(std::string name)
Convert supplied string to lower case.
std::string stringify(const T &t)
conversion to string
VarKindType
Framework-wide stuff.
const BoundaryID ANY_BOUNDARY_ID