22 #include "libmesh/coupling_matrix.h" 23 #include "libmesh/parameters.h" 26 #include <unordered_map> 35 class GhostingFunctor;
55 class FunctorEnvelopeBase;
105 virtual bool nlConverged(
const unsigned int nl_sys_num);
118 virtual unsigned int nlSysNum(
const NonlinearSystemName & nl_sys_name)
const = 0;
123 virtual unsigned int linearSysNum(
const LinearSystemName & linear_sys_name)
const = 0;
128 virtual unsigned int solverSysNum(
const SolverSystemName & solver_sys_name)
const = 0;
136 virtual void needFV() = 0;
139 virtual bool haveFV()
const = 0;
179 std::vector<VectorTag>
getVectorTags(
const std::set<TagID> & tag_ids)
const;
195 virtual const std::vector<VectorTag> &
256 virtual bool hasVariable(
const std::string & var_name)
const = 0;
275 const std::string & var_name,
280 const std::string & var_name,
285 tid, var_name, expected_var_type, expected_var_field_type));
290 const std::string & var_name) = 0;
294 const std::string & var_name) = 0;
298 const std::string & var_name) = 0;
302 const std::string & var_name) = 0;
309 const std::string & var_name) = 0;
329 virtual const std::set<MooseVariableFieldBase *> &
409 std::vector<dof_id_type> & dof_indices,
410 std::vector<dof_id_type> & neighbor_dof_indices,
411 const std::set<TagID> & tags,
420 virtual void prepare(
const Elem * elem,
423 const std::vector<dof_id_type> & dof_indices,
432 const std::vector<Point> & phys_points_in_elem,
437 const std::vector<Point> *
const pts =
nullptr,
438 const std::vector<Real> *
const weights =
nullptr);
445 unsigned int neighbor_side,
446 const std::vector<Point> & physical_points,
449 const std::vector<Point> & physical_points,
460 bool reinit_for_derivative_reordering =
false) = 0;
475 const std::vector<Point> *
const pts,
476 const std::vector<Real> *
const weights =
nullptr,
486 unsigned int neighbor_side,
488 const std::vector<Point> *
const pts,
489 const std::vector<Real> *
const weights =
nullptr,
570 const std::string &
name);
581 const std::string &
name);
871 template <
typename T>
874 const std::string & requestor_name,
875 bool requestor_is_ad);
885 template <
typename T>
891 template <
typename T>
908 template <
typename T,
typename PolymorphicLambda>
911 PolymorphicLambda my_lammy,
912 const std::set<ExecFlagType> & clearance_schedule,
914 const std::set<SubdomainID> & block_ids,
954 template <
typename T>
956 const std::string & functor_name,
971 const std::vector<VectorTag> & input_vector_tags,
972 std::set<TagID> & selected_tags);
981 const std::map<TagName, TagID> & input_matrix_tags,
982 std::set<TagID> & selected_tags);
1021 template <
typename T>
1023 const std::string & var_name,
1026 const std::vector<T> & nls,
1126 virtual std::pair<bool, unsigned int>
1140 std::vector<std::multimap<std::string,
1142 std::unique_ptr<Moose::FunctorEnvelopeBase>,
1143 std::unique_ptr<Moose::FunctorEnvelopeBase>>>>
1147 std::vector<std::map<std::string, std::unique_ptr<Moose::FunctorAbstract>>>
_pbblf_functors;
1191 std::vector<std::shared_ptr<libMesh::GhostingFunctor>>>
1198 std::vector<std::shared_ptr<libMesh::GhostingFunctor>>>
1212 template <
typename T>
1216 const std::string & requestor_name,
1217 const bool requestor_is_ad)
1219 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1224 constexpr
bool requested_functor_is_ad =
1225 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1231 if (
auto find_ret = functors.find(
"wraps_" +
name); find_ret != functors.end())
1233 if (functors.count(
"wraps_" +
name) > 1)
1234 mooseError(
"Attempted to get a functor with the name '",
1236 "' but multiple (" + std::to_string(functors.count(
"wraps_" +
name)) +
1237 ") functors match. Make sure that you do not have functor material " 1238 "properties, functions, postprocessors or variables with the same names.");
1240 auto & [true_functor_is, non_ad_functor, ad_functor] = find_ret->second;
1241 auto & functor_wrapper = requested_functor_is_ad ? *ad_functor : *non_ad_functor;
1245 mooseError(
"A call to SubProblem::getFunctor requested a functor named '",
1247 "' that returns the type: '",
1249 "'. However, that functor already exists and returns a different type: '",
1250 functor_wrapper.returnType(),
1255 functor_to_request_info.emplace(
name,
1256 std::make_pair(requested_functor_is_ad, requestor_is_ad));
1261 mooseError(
"We already have the functor; it should not be unset");
1265 if (!requested_functor_is_ad && requestor_is_ad &&
1270 "' is requesting the functor '",
1272 "' as a non-AD functor even though it is truly an AD functor, which is not " 1273 "allowed, since this may unintentionally drop derivatives.");
1281 functor_to_request_info.emplace(
name, std::make_pair(requested_functor_is_ad, requestor_is_ad));
1282 if constexpr (requested_functor_is_ad)
1284 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1288 functors.emplace(
"wraps_" +
name,
1296 ? std::get<2>(emplace_ret->second)
1297 : std::get<1>(emplace_ret->second)));
1301 typedef T NonADType;
1305 functors.emplace(
"wraps_" +
name,
1313 ? std::get<2>(emplace_ret->second)
1314 : std::get<1>(emplace_ret->second)));
1318 template <
typename T>
1322 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1325 const auto & it = functors.find(
"wraps_" +
name);
1326 constexpr
bool requested_functor_is_ad =
1327 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1329 if (it == functors.end())
1333 requested_functor_is_ad ? std::get<2>(it->second).
get() : std::get<1>(it->second).
get());
1336 template <
typename T,
typename PolymorphicLambda>
1339 PolymorphicLambda my_lammy,
1340 const std::set<ExecFlagType> & clearance_schedule,
1342 const std::set<SubdomainID> & block_ids,
1347 auto [it, first_time_added] =
1348 pbblf_functors.emplace(
name,
1350 name, my_lammy, clearance_schedule,
mesh, block_ids));
1355 if (first_time_added)
1356 mooseError(
"This should be impossible. If this was the first time we added the functor, then " 1357 "the dynamic cast absolutely should have succeeded");
1359 mooseError(
"Attempted to add a lambda functor with the name '",
1361 "' but another lambda functor of that name returns a different type");
1364 if (first_time_added)
1368 functor->setFunctor(
mesh, block_ids, my_lammy);
1373 template <
typename T>
1379 constexpr
bool added_functor_is_ad =
1380 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1382 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1386 auto it = functors.find(
"wraps_" +
name);
1387 if (it != functors.end())
1393 auto *
const existing_wrapper_base =
1394 added_functor_is_ad ? std::get<2>(it->second).
get() : std::get<1>(it->second).
get();
1395 auto *
const existing_wrapper =
dynamic_cast<Moose::Functor<T> *
>(existing_wrapper_base);
1399 auto [request_info_it, request_info_end_it] = functor_to_request_info.equal_range(
name);
1400 if (request_info_it == request_info_end_it)
1401 mooseError(
"We are wrapping a NullFunctor but we don't have any unfilled functor request " 1402 "info. This doesn't make sense.");
1405 while (request_info_it != request_info_end_it)
1407 auto & [requested_functor_is_ad, requestor_is_ad] = request_info_it->second;
1408 if (!requested_functor_is_ad && requestor_is_ad && added_functor_is_ad)
1410 "' from an AD object, but the true functor is AD. This means we could be " 1411 "dropping important derivatives. We will not allow this");
1415 request_info_it = functor_to_request_info.erase(request_info_it);
1419 std::get<0>(it->second) =
1421 existing_wrapper->assign(functor);
1423 if constexpr (added_functor_is_ad)
1425 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1426 auto *
const existing_non_ad_wrapper_base = std::get<1>(it->second).
get();
1427 auto *
const existing_non_ad_wrapper =
1430 "Both members of pair should have been wrapping a NullFunctor");
1431 existing_non_ad_wrapper->assign(
1437 auto *
const existing_ad_wrapper_base = std::get<2>(it->second).
get();
1438 auto *
const existing_ad_wrapper =
1441 "Both members of pair should have been wrapping a NullFunctor");
1446 else if (!existing_wrapper)
1453 "' is being added with return type '",
1454 MooseUtils::prettyCppType<T>(),
1455 "' but it has already been defined or requested with return type '",
1456 existing_wrapper_base->returnType(),
1462 if constexpr (added_functor_is_ad)
1464 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1465 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<NonADType>>(
1466 std::make_unique<Moose::RawValueFunctor<NonADType>>(functor));
1467 auto new_ad_wrapper = std::make_unique<Moose::Functor<T>>(functor);
1470 std::move(new_non_ad_wrapper),
1471 std::move(new_ad_wrapper)));
1476 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<T>>((functor));
1477 auto new_ad_wrapper = std::make_unique<Moose::Functor<ADType>>(
1478 std::make_unique<Moose::ADWrapperFunctor<ADType>>(functor));
1481 std::move(new_non_ad_wrapper),
1482 std::move(new_ad_wrapper)));
1494 const bool currently_computing_residual_and_jacobian)
virtual void prepareShapes(unsigned int var, const THREAD_ID tid)=0
virtual void getDiracElements(std::set< const Elem *> &elems)=0
Fills "elems" with the elements that should be looped over for Dirac Kernels.
virtual MooseMesh & mesh()=0
virtual void addCachedResidual(const THREAD_ID tid)
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid)=0
virtual bool computingScalingResidual() const =0
Getter for whether we're computing the scaling residual.
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 ...
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
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
virtual const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const =0
The coupling matrix defining what blocks exist in the preconditioning matrix.
std::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
A material property that is evaluated on-the-fly via calls to various overloads of operator() ...
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.
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false)=0
fills the VariableValue arrays for scalar variables from the solution vector
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
A class for creating restricted objects.
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
Factory & _factory
The Factory for building objects.
virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested VectorMooseVariable which may be in any system...
const std::set< TagID > & getActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) const
void removeCouplingGhostingFunctor(libMesh::GhostingFunctor &coupling_gf)
Remove a coupling ghosting functor from this problem's DofMaps.
virtual std::set< BoundaryID > getMaterialPropertyBoundaryIDs(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
virtual void addJacobianNeighborLowerD(const THREAD_ID tid)=0
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
virtual void addResidual(const THREAD_ID tid)=0
Base class template for functor objects.
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)
void addAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf, bool to_mesh=true)
Add an algebraic ghosting functor to this problem's DofMaps.
virtual MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested MooseVariableField which may be in any system...
Keeps track of stuff related to assembling.
Class for stuff related to variables.
virtual void reinitOffDiagScalars(const THREAD_ID tid)=0
virtual void setCurrentlyComputingResidual(const bool currently_computing_residual)
Set whether or not the problem is in the process of computing the residual.
virtual void reinitElem(const Elem *elem, const THREAD_ID tid)=0
virtual void onTimestepEnd()=0
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 bool checkNonlocalCouplingRequirement() const =0
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)
Generic factory class for build all sorts of objects.
virtual bool computingScalingJacobian() const =0
Getter for whether we're computing the scaling jacobian.
MooseVariableFE< RealVectorValue > VectorMooseVariable
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...
VectorValue< Real > RealVectorValue
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
std::unordered_set< TagID > _not_zeroed_tagged_vectors
the list of vector tags that will not be zeroed when all other tags are
virtual unsigned int currentNlSysNum() const =0
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)=0
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
Helper for tracking the object that is consuming a property for MaterialPropertyDebugOutput.
bool _currently_computing_jacobian
Flag to determine whether the problem is currently computing Jacobian.
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 prepareNeighborShapes(unsigned int var, const THREAD_ID tid)=0
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)
void initial_condition(libMesh::EquationSystems &es, const std::string &system_name)
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...
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
Class that hold the whole problem being solved.
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
Wraps non-AD functors such that they can be used in objects that have requested the functor as AD...
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 void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
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.
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 void addJacobianNeighbor(const THREAD_ID tid)=0
void reinitFVFace(const THREAD_ID tid, const FaceInfo &fi)
reinitialize the finite volume assembly data for the provided face and thread
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid)=0
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) ...
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual void jacobianSetup()
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void setCurrentlyComputingResidualAndJacobian(bool currently_computing_residual_and_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
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.
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
std::vector< VectorTag > _vector_tags
The declared vector tags.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid)
Clear the active elemental MooseVariableFieldBase.
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
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.
virtual void addResidualLower(const THREAD_ID tid)=0
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const =0
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
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...
virtual void reinitElemFace(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
virtual void addJacobian(const THREAD_ID tid)=0
const bool & currentlyComputingResidual() const
Returns true if the problem is in the process of computing the residual.
bool verifyVectorTags() const
Verify the integrity of _vector_tags and _typed_vector_tags.
void preparePRefinement()
Prepare DofMap and Assembly classes with our p-refinement information.
void setCurrentlyComputingJacobian(const bool currently_computing_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
const std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) const
bool _computing_nonlinear_residual
Whether the non-linear residual is being evaluated.
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
virtual void customSetup(const ExecFlagType &exec_type)
std::map< std::string, std::vector< dof_id_type > > _var_dof_map
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
virtual void ghostGhostedBoundaries()=0
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
bool automaticScaling() const
Automatic scaling getter.
This data structure is used to store geometric and variable related metadata about each cell face in ...
virtual libMesh::EquationSystems & es()=0
std::unordered_map< FEFamily, bool > _family_for_p_refinement
Indicate whether a family is disabled for p-refinement.
virtual void reinitNode(const Node *node, const THREAD_ID tid)=0
virtual LineSearch * getLineSearch()=0
bool havePRefinement() const
Query whether p-refinement has been requested at any point during the simulation. ...
virtual bool isMatPropRequested(const std::string &prop_name) const
Find out if a material property has been requested by any object.
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const =0
Returns true if the problem is in the process of computing it's initial residual. ...
std::map< MooseObjectName, std::set< std::string > > _consumed_material_properties
static const std::unordered_set< FEFamily > _default_families_without_p_refinement
The set of variable families by default disable p-refinement.
virtual void clearDiracInfo()=0
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
void removeAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf)
Remove an algebraic ghosting functor from this problem's DofMaps.
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
virtual bool hasNonlocalCoupling() const =0
Whether the simulation has active 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)
bool _safe_access_tagged_vectors
Is it safe to retrieve data from tagged vectors.
bool hasFunctorWithType(const std::string &name, const THREAD_ID tid) const
checks whether we have a functor of type T corresponding to name on the thread id tid ...
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 std::size_t numSolverSystems() const =0
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)
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.
virtual bool isTransient() const =0
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
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 void onTimestepBegin()=0
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
virtual bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
void markFamilyPRefinement(const InputParameters ¶ms)
Mark a variable family for either disabling or enabling p-refinement with valid parameters of a varia...
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided...
const std::string & type() const
Get the type of this class.
virtual void checkBlockMatProps()
Checks block material properties integrity.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested MooseVariable which may be in any system.
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested ArrayMooseVariable which may be in any system...
virtual void addJacobianLowerD(const THREAD_ID tid)=0
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 const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual GeometricSearchData & geomSearchData()=0
std::string demangle(const char *name)
virtual void prepare(const Elem *elem, const THREAD_ID tid)=0
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
bool haveADObjects() const
Method for reading wehther we have any ad objects.
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid)
virtual std::map< TagName, TagID > & getMatrixTags()
Return all matrix tags in the system, where a tag is represented by a map from name to ID...
virtual libMesh::System & getSystem(const std::string &var_name)=0
Returns the equation system containing the variable provided.
void showFunctorRequestors() const
Lists all functors and all the objects that requested them.
GeometricSearchType
Used to select groups of geometric search objects to update.
bool doingPRefinement() const
virtual void cacheJacobianNeighbor(const THREAD_ID tid)
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
virtual void prepareFace(const Elem *elem, const THREAD_ID tid)=0
virtual void cacheResidual(const THREAD_ID tid)
virtual void timestepSetup()
virtual unsigned int numMatrixTags() const
The total number of tags.
virtual unsigned int currentLinearSysNum() const =0
virtual void addResidualNeighbor(const THREAD_ID tid)=0
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid)=0
Returns true if the Problem has Dirac kernels it needs to compute on elem.
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid)=0
void registerUnfilledFunctorRequest(T *functor_interface, const std::string &functor_name, const THREAD_ID tid)
Register an unfulfilled functor request.
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 bool nlConverged(const unsigned int nl_sys_num)
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
bool _default_ghosting
Whether or not to use default libMesh coupling.
virtual std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
void addCouplingGhostingFunctor(libMesh::GhostingFunctor &coupling_gf, bool to_mesh=true)
Add a coupling functor to this problem's DofMaps.
virtual void setResidualNeighbor(libMesh::NumericVector< libMesh::Number > &residual, const THREAD_ID tid)=0
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
Generic class for solving transient nonlinear problems.
virtual void needFV()=0
marks this problem as including/needing finite volume functionality.
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.
virtual MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY)
std::map< TagName, TagID > _vector_tags_name_map
Map of vector tag TagName to TagID.
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL)=0
std::vector< unsigned int > _has_active_elemental_moose_variables
Whether or not there is currently a list of active elemental moose variables.
virtual void addGhostedBoundary(BoundaryID boundary_id)=0
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
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 reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
virtual void addGhostedElem(dof_id_type elem_id)=0
Will make sure that all dofs connected to elem_id are ghosted to this processor.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
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.
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.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const =0
Class for scalar variables (they are different).
virtual void prepareAssembly(const THREAD_ID tid)=0
const Moose::FunctorBase< T > & addPiecewiseByBlockLambdaFunctor(const std::string &name, PolymorphicLambda my_lammy, const std::set< ExecFlagType > &clearance_schedule, const MooseMesh &mesh, const std::set< SubdomainID > &block_ids, const THREAD_ID tid)
Add a functor that has block-wise lambda definitions, e.g.
MooseVariableFE< RealEigenVector > ArrayMooseVariable
std::set< std::string > _material_property_requested
set containing all material property names that have been requested by getMaterialProperty* ...
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 setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const =0
const InputParameters & parameters() const
Get the parameters of the object.
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 bool hasLinearVariable(const std::string &var_name) const
Whether or not this problem has this linear variable.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
static InputParameters validParams()
bool _currently_computing_residual
Whether the residual is being evaluated.
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
void setFunctorOutput(bool set_output)
Setter for debug functor output.
virtual bool haveDisplaced() const =0
Whether we have a displaced problem in our simulation.
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
virtual void computingNonlinearResid(const bool computing_nonlinear_residual)
Set whether or not the problem is in the process of computing the nonlinear residual.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
virtual std::size_t numNonlinearSystems() const =0
virtual bool haveFV() const =0
returns true if this problem includes/needs finite volume functionality.
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.
bool _safe_access_tagged_matrices
Is it safe to retrieve data from tagged matrices.
MooseVariableFE< Real > MooseVariable
DiracKernelInfo _dirac_kernel_info
virtual bool solverSystemConverged(const unsigned int sys_num)
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid)=0
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
A class for storing the names of MooseObject by tag and object name.
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
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.
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
A functor that serves as a placeholder during the simulation setup phase if a functor consumer reques...
virtual void storeSubdomainMatPropName(SubdomainID block_id, const std::string &name)
Adds the given material property to a storage map based on block ids.
virtual void cacheJacobian(const THREAD_ID tid)
Abstract definition of a RestartableData value.
void reinitMortarElem(const Elem *elem, const THREAD_ID tid=0)
Reinit a mortar element to obtain a valid JxW.
virtual std::size_t numLinearSystems() const =0
virtual bool hasAuxiliaryVariable(const std::string &var_name) const
Whether or not this problem has this auxiliary variable.
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
virtual void setResidual(libMesh::NumericVector< libMesh::Number > &residual, const THREAD_ID tid)=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 void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid)=0
virtual unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const =0
bool _currently_computing_residual_and_jacobian
Flag to determine whether the problem is currently computing the residual and Jacobian.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)=0
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const =0