22 #include "libmesh/coupling_matrix.h" 23 #include "libmesh/parameters.h" 26 #include <unordered_map> 35 class GhostingFunctor;
55 class FunctorEnvelopeBase;
61 class EquationSystems;
83 virtual EquationSystems &
es() = 0;
106 virtual unsigned int nlSysNum(
const NonlinearSystemName & nl_sys_name)
const = 0;
111 virtual unsigned int linearSysNum(
const LinearSystemName & linear_sys_name)
const = 0;
116 virtual unsigned int solverSysNum(
const SolverSystemName & solver_sys_name)
const = 0;
124 virtual void needFV() = 0;
127 virtual bool haveFV()
const = 0;
151 std::vector<VectorTag>
getVectorTags(
const std::set<TagID> & tag_ids)
const;
167 virtual const std::vector<VectorTag> &
228 virtual bool hasVariable(
const std::string & var_name)
const = 0;
241 const std::string & var_name,
246 const std::string & var_name,
251 tid, var_name, expected_var_type, expected_var_field_type));
256 const std::string & var_name) = 0;
260 const std::string & var_name) = 0;
264 const std::string & var_name) = 0;
268 const std::string & var_name) = 0;
273 return var_name +
"_" + std::to_string(i);
281 const std::string & var_name) = 0;
284 virtual System &
getSystem(
const std::string & var_name) = 0;
301 virtual const std::set<MooseVariableFieldBase *> &
373 const DofMap & dof_map,
374 std::vector<dof_id_type> & dof_indices,
375 std::vector<dof_id_type> & neighbor_dof_indices,
376 const std::set<TagID> & tags,
385 virtual void prepare(
const Elem * elem,
388 const std::vector<dof_id_type> & dof_indices,
397 const std::vector<Point> & phys_points_in_elem,
403 const std::vector<Point> *
const pts =
nullptr,
404 const std::vector<Real> *
const weights =
nullptr);
411 unsigned int neighbor_side,
412 const std::vector<Point> & physical_points,
415 const std::vector<Point> & physical_points,
426 bool reinit_for_derivative_reordering =
false) = 0;
442 const std::vector<Point> *
const pts,
443 const std::vector<Real> *
const weights =
nullptr,
453 unsigned int neighbor_side,
456 const std::vector<Point> *
const pts,
457 const std::vector<Real> *
const weights =
nullptr,
540 const std::string &
name);
551 const std::string &
name);
748 virtual const CouplingMatrix *
couplingMatrix(
const unsigned int nl_sys_num)
const = 0;
841 template <
typename T>
844 const std::string & requestor_name,
845 bool requestor_is_ad);
855 template <
typename T>
861 template <
typename T>
878 template <
typename T,
typename PolymorphicLambda>
881 PolymorphicLambda my_lammy,
882 const std::set<ExecFlagType> & clearance_schedule,
884 const std::set<SubdomainID> & block_ids,
924 template <
typename T>
926 const std::string & functor_name,
941 const std::vector<VectorTag> & input_vector_tags,
942 std::set<TagID> & selected_tags);
951 const std::map<TagName, TagID> & input_matrix_tags,
952 std::set<TagID> & selected_tags);
992 template <
typename T>
994 const std::string & var_name,
997 const std::vector<T> & nls,
1093 virtual std::pair<bool, unsigned int>
1107 std::vector<std::multimap<std::string,
1109 std::unique_ptr<Moose::FunctorEnvelopeBase>,
1110 std::unique_ptr<Moose::FunctorEnvelopeBase>>>>
1114 std::vector<std::map<std::string, std::unique_ptr<Moose::FunctorAbstract>>>
_pbblf_functors;
1157 std::unordered_map<GhostingFunctor *, std::vector<std::shared_ptr<GhostingFunctor>>>
1163 std::unordered_map<GhostingFunctor *, std::vector<std::shared_ptr<GhostingFunctor>>>
1172 template <
typename T>
1176 const std::string & requestor_name,
1177 const bool requestor_is_ad)
1179 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1184 constexpr
bool requested_functor_is_ad =
1185 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1191 if (
auto find_ret = functors.find(
"wraps_" +
name); find_ret != functors.end())
1193 if (functors.count(
"wraps_" +
name) > 1)
1194 mooseError(
"Attempted to get a functor with the name '",
1196 "' but multiple functors match. Make sure that you do not have functor material " 1197 "properties, functions, postprocessors or variables with the same names");
1199 auto & [true_functor_is, non_ad_functor, ad_functor] = find_ret->second;
1200 auto & functor_wrapper = requested_functor_is_ad ? *ad_functor : *non_ad_functor;
1204 mooseError(
"A call to SubProblem::getFunctor requested a functor named '",
1206 "' that returns the type: '",
1208 "'. However, that functor already exists and returns a different type: '",
1209 functor_wrapper.returnType(),
1214 functor_to_request_info.emplace(
name,
1215 std::make_pair(requested_functor_is_ad, requestor_is_ad));
1220 mooseError(
"We already have the functor; it should not be unset");
1223 if (!requested_functor_is_ad && requestor_is_ad &&
1225 mooseError(
"We are requesting a non-AD functor from an AD object, but the true functor is " 1227 "means we could be dropping important derivatives. We will not allow this");
1235 functor_to_request_info.emplace(
name, std::make_pair(requested_functor_is_ad, requestor_is_ad));
1236 if constexpr (requested_functor_is_ad)
1238 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1242 functors.emplace(
"wraps_" +
name,
1250 ? std::get<2>(emplace_ret->second)
1251 : std::get<1>(emplace_ret->second)));
1255 typedef T NonADType;
1259 functors.emplace(
"wraps_" +
name,
1267 ? std::get<2>(emplace_ret->second)
1268 : std::get<1>(emplace_ret->second)));
1272 template <
typename T>
1276 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1279 const auto & it = functors.find(
"wraps_" +
name);
1280 constexpr
bool requested_functor_is_ad =
1281 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1283 if (it == functors.end())
1287 requested_functor_is_ad ? std::get<2>(it->second).
get() : std::get<1>(it->second).
get());
1290 template <
typename T,
typename PolymorphicLambda>
1293 PolymorphicLambda my_lammy,
1294 const std::set<ExecFlagType> & clearance_schedule,
1296 const std::set<SubdomainID> & block_ids,
1301 auto [it, first_time_added] =
1302 pbblf_functors.emplace(
name,
1304 name, my_lammy, clearance_schedule,
mesh, block_ids));
1309 if (first_time_added)
1310 mooseError(
"This should be impossible. If this was the first time we added the functor, then " 1311 "the dynamic cast absolutely should have succeeded");
1313 mooseError(
"Attempted to add a lambda functor with the name '",
1315 "' but another lambda functor of that name returns a different type");
1318 if (first_time_added)
1322 functor->setFunctor(
mesh, block_ids, my_lammy);
1327 template <
typename T>
1333 constexpr
bool added_functor_is_ad =
1334 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1336 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1340 auto it = functors.find(
"wraps_" +
name);
1341 if (it != functors.end())
1347 auto *
const existing_wrapper_base =
1348 added_functor_is_ad ? std::get<2>(it->second).
get() : std::get<1>(it->second).
get();
1349 auto *
const existing_wrapper =
dynamic_cast<Moose::Functor<T> *
>(existing_wrapper_base);
1353 auto [request_info_it, request_info_end_it] = functor_to_request_info.equal_range(
name);
1354 if (request_info_it == request_info_end_it)
1355 mooseError(
"We are wrapping a NullFunctor but we don't have any unfilled functor request " 1356 "info. This doesn't make sense.");
1359 while (request_info_it != request_info_end_it)
1361 auto & [requested_functor_is_ad, requestor_is_ad] = request_info_it->second;
1362 if (!requested_functor_is_ad && requestor_is_ad && added_functor_is_ad)
1363 mooseError(
"We are requesting a non-AD functor from an AD object, but the true functor " 1364 "is AD. This means we could be dropping important derivatives. We will not " 1369 request_info_it = functor_to_request_info.erase(request_info_it);
1373 std::get<0>(it->second) =
1375 existing_wrapper->assign(functor);
1377 if constexpr (added_functor_is_ad)
1379 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1380 auto *
const existing_non_ad_wrapper_base = std::get<1>(it->second).
get();
1381 auto *
const existing_non_ad_wrapper =
1384 "Both members of pair should have been wrapping a NullFunctor");
1385 existing_non_ad_wrapper->assign(
1391 auto *
const existing_ad_wrapper_base = std::get<2>(it->second).
get();
1392 auto *
const existing_ad_wrapper =
1395 "Both members of pair should have been wrapping a NullFunctor");
1403 if constexpr (added_functor_is_ad)
1405 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1406 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<NonADType>>(
1407 std::make_unique<Moose::RawValueFunctor<NonADType>>(functor));
1408 auto new_ad_wrapper = std::make_unique<Moose::Functor<T>>(functor);
1411 std::move(new_non_ad_wrapper),
1412 std::move(new_ad_wrapper)));
1417 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<T>>((functor));
1418 auto new_ad_wrapper = std::make_unique<Moose::Functor<ADType>>(
1419 std::make_unique<Moose::ADWrapperFunctor<ADType>>(functor));
1422 std::move(new_non_ad_wrapper),
1423 std::move(new_ad_wrapper)));
1435 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.
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 void setResidualNeighbor(NumericVector< Number > &residual, const THREAD_ID tid)=0
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
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)
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
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 initial_condition(EquationSystems &es, const std::string &system_name)
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)
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...
virtual bool converged(const unsigned int nl_sys_num)
Eventually we want to convert this virtual over to taking a nonlinear system number argument...
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 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
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
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)
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...
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
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.
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) ...
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()
virtual bool computingInitialResidual(const unsigned int nl_sys_num) const =0
Returns true if the problem is in the process of computing it's initial residual. ...
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.
std::vector< CouplingMatrix > _nonlocal_cm
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
virtual bool nlConverged(const unsigned int nl_sys_num)
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
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.
virtual EquationSystems & es()=0
bool verifyVectorTags() const
Verify the integrity of _vector_tags and _typed_vector_tags.
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 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...
virtual void reinitNode(const Node *node, const THREAD_ID tid)=0
virtual LineSearch * getLineSearch()=0
void removeCouplingGhostingFunctor(GhostingFunctor &coupling_gf)
Remove a coupling ghosting functor from this problem's DofMaps.
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.
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.
virtual void clearDiracInfo()=0
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
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)
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...
virtual void setResidual(NumericVector< Number > &residual, const THREAD_ID tid)=0
boundary_id_type BoundaryID
virtual const CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const =0
The coupling matrix defining what blocks exist in the preconditioning matrix.
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)
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 onTimestepBegin()=0
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
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.
virtual bool checkNonlocalCouplingRequirement()
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 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.
subdomain_id_type SubdomainID
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)
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 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...
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)
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
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
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.
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
static std::string arrayVariableComponent(const std::string &var_name, unsigned int i)
Returns the variable name of a component of an array variable.
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 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.
virtual void initialSetup()
bool _have_p_refinement
Whether p-refinement has been requested at any point during the simulation.
virtual System & getSystem(const std::string &var_name)=0
Returns the equation system containing the variable provided.
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
void addCouplingGhostingFunctor(GhostingFunctor &coupling_gf, bool to_mesh=true)
Add a coupling functor to this problem's DofMaps.
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 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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
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
nonlocal coupling matrix;
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.
const CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const
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
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, const THREAD_ID tid)=0
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)
virtual void meshChanged()
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 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.
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