22#include "libmesh/coupling_matrix.h"
23#include "libmesh/parameters.h"
26#include <unordered_map>
55class 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;
179 std::vector<VectorTag>
getVectorTags(
const std::set<TagID> & tag_ids)
const;
195 virtual const std::vector<VectorTag> &
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,
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,
578 const std::string &
name);
589 const std::string &
name);
879 template <
typename T>
882 const std::string & requestor_name,
883 bool requestor_is_ad);
893 template <
typename T>
899 template <
typename T>
916 template <
typename T,
typename PolymorphicLambda>
919 PolymorphicLambda my_lammy,
920 const std::set<ExecFlagType> & clearance_schedule,
922 const std::set<SubdomainID> & block_ids,
969 template <
typename T>
971 const std::string & functor_name,
986 const std::vector<VectorTag> & input_vector_tags,
987 std::set<TagID> & selected_tags);
996 const std::map<TagName, TagID> & input_matrix_tags,
997 std::set<TagID> & selected_tags);
1042 template <
typename T>
1044 const std::string & var_name,
1047 const std::vector<T> & nls,
1141 virtual std::pair<bool, unsigned int>
1155 std::vector<std::multimap<std::string,
1157 std::unique_ptr<Moose::FunctorEnvelopeBase>,
1158 std::unique_ptr<Moose::FunctorEnvelopeBase>>>>
1162 std::vector<std::map<std::string, std::unique_ptr<Moose::FunctorAbstract>>>
_pbblf_functors;
1209 std::vector<std::shared_ptr<libMesh::GhostingFunctor>>>
1216 std::vector<std::shared_ptr<libMesh::GhostingFunctor>>>
1230template <
typename T>
1234 const std::string & requestor_name,
1235 const bool requestor_is_ad)
1237 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1242 constexpr bool requested_functor_is_ad =
1243 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1249 if (
auto find_ret = functors.find(
"wraps_" +
name); find_ret != functors.end())
1251 if (functors.count(
"wraps_" +
name) > 1)
1252 mooseError(
"Attempted to get a functor with the name '",
1254 "' but multiple (" + std::to_string(functors.count(
"wraps_" +
name)) +
1255 ") functors match. Make sure that you do not have functor material "
1256 "properties, functions, postprocessors or variables with the same names.");
1258 auto & [true_functor_is, non_ad_functor, ad_functor] = find_ret->second;
1259 auto & functor_wrapper = requested_functor_is_ad ? *ad_functor : *non_ad_functor;
1263 mooseError(
"A call to SubProblem::getFunctor requested a functor named '",
1265 "' that returns the type: '",
1267 "'. However, that functor already exists and returns a different type: '",
1268 functor_wrapper.returnType(),
1273 functor_to_request_info.emplace(
name,
1274 std::make_pair(requested_functor_is_ad, requestor_is_ad));
1279 mooseError(
"We already have the functor; it should not be unset");
1283 if (!requested_functor_is_ad && requestor_is_ad &&
1288 "' is requesting the functor '",
1290 "' as a non-AD functor even though it is truly an AD functor, which is not "
1291 "allowed, since this may unintentionally drop derivatives.");
1299 functor_to_request_info.emplace(
name, std::make_pair(requested_functor_is_ad, requestor_is_ad));
1300 if constexpr (requested_functor_is_ad)
1302 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1306 functors.emplace(
"wraps_" +
name,
1314 ? std::get<2>(emplace_ret->second)
1315 : std::get<1>(emplace_ret->second)));
1319 typedef T NonADType;
1323 functors.emplace(
"wraps_" +
name,
1331 ? std::get<2>(emplace_ret->second)
1332 : std::get<1>(emplace_ret->second)));
1336template <
typename T>
1340 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1343 const auto & it = functors.find(
"wraps_" +
name);
1344 constexpr bool requested_functor_is_ad =
1345 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1347 if (it == functors.end())
1351 requested_functor_is_ad ? std::get<2>(it->second).get() : std::get<1>(it->second).get());
1354template <
typename T,
typename PolymorphicLambda>
1357 PolymorphicLambda my_lammy,
1358 const std::set<ExecFlagType> & clearance_schedule,
1360 const std::set<SubdomainID> & block_ids,
1365 auto [it, first_time_added] =
1366 pbblf_functors.emplace(
name,
1368 name, my_lammy, clearance_schedule,
mesh, block_ids));
1373 if (first_time_added)
1374 mooseError(
"This should be impossible. If this was the first time we added the functor, then "
1375 "the dynamic cast absolutely should have succeeded");
1377 mooseError(
"Attempted to add a lambda functor with the name '",
1379 "' but another lambda functor of that name returns a different type");
1382 if (first_time_added)
1386 functor->setFunctor(
mesh, block_ids, my_lammy);
1391template <
typename T>
1397 constexpr bool added_functor_is_ad =
1398 !std::is_same<T, typename MetaPhysicL::RawType<T>::value_type>::value;
1400 mooseAssert(tid <
_functors.size(),
"Too large a thread ID");
1404 auto it = functors.find(
"wraps_" +
name);
1405 if (it != functors.end())
1411 auto *
const existing_wrapper_base =
1412 added_functor_is_ad ? std::get<2>(it->second).get() : std::get<1>(it->second).get();
1413 auto *
const existing_wrapper =
dynamic_cast<Moose::Functor<T> *
>(existing_wrapper_base);
1417 auto [request_info_it, request_info_end_it] = functor_to_request_info.equal_range(
name);
1418 if (request_info_it == request_info_end_it)
1419 mooseError(
"We are wrapping a NullFunctor but we don't have any unfilled functor request "
1420 "info. This doesn't make sense.");
1423 while (request_info_it != request_info_end_it)
1425 auto & [requested_functor_is_ad, requestor_is_ad] = request_info_it->second;
1426 if (!requested_functor_is_ad && requestor_is_ad && added_functor_is_ad)
1428 "' from an AD object, but the true functor is AD. This means we could be "
1429 "dropping important derivatives. We will not allow this");
1433 request_info_it = functor_to_request_info.erase(request_info_it);
1437 std::get<0>(it->second) =
1439 existing_wrapper->assign(functor);
1441 if constexpr (added_functor_is_ad)
1443 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1444 auto *
const existing_non_ad_wrapper_base = std::get<1>(it->second).get();
1445 auto *
const existing_non_ad_wrapper =
1448 "Both members of pair should have been wrapping a NullFunctor");
1449 existing_non_ad_wrapper->assign(
1455 auto *
const existing_ad_wrapper_base = std::get<2>(it->second).get();
1456 auto *
const existing_ad_wrapper =
1459 "Both members of pair should have been wrapping a NullFunctor");
1464 else if (!existing_wrapper)
1471 "' is being added with return type '",
1472 MooseUtils::prettyCppType<T>(),
1473 "' but it has already been defined or requested with return type '",
1474 existing_wrapper_base->returnType(),
1480 if constexpr (added_functor_is_ad)
1482 typedef typename MetaPhysicL::RawType<T>::value_type NonADType;
1483 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<NonADType>>(
1484 std::make_unique<Moose::RawValueFunctor<NonADType>>(functor));
1485 auto new_ad_wrapper = std::make_unique<Moose::Functor<T>>(functor);
1488 std::move(new_non_ad_wrapper),
1489 std::move(new_ad_wrapper)));
1494 auto new_non_ad_wrapper = std::make_unique<Moose::Functor<T>>((functor));
1495 auto new_ad_wrapper = std::make_unique<Moose::Functor<ADType>>(
1496 std::make_unique<Moose::ADWrapperFunctor<ADType>>(functor));
1499 std::move(new_non_ad_wrapper),
1500 std::move(new_ad_wrapper)));
1512 const bool currently_computing_residual_and_jacobian)
boundary_id_type BoundaryID
MooseVariableFE< Real > MooseVariable
MooseVariableFE< RealEigenVector > ArrayMooseVariable
MooseVariableFE< RealVectorValue > VectorMooseVariable
Keeps track of stuff related to assembling.
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 ...
Generic factory class for build all sorts of objects.
GeometricSearchType
Used to select groups of geometric search objects to update.
const InputParameters & parameters() const
Get the parameters of the object.
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...
Class for containing MooseEnum item information.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
A class for storing the names of MooseObject by tag and object name.
Class for stuff related to variables.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Class for scalar variables (they are different).
Wraps non-AD functors such that they can be used in objects that have requested the functor as AD.
Base class template for functor objects.
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
A functor that serves as a placeholder during the simulation setup phase if a functor consumer reques...
A material property that is evaluated on-the-fly via calls to various overloads of operator()
Class that hold the whole problem being solved.
Abstract definition of a RestartableData value.
A class for creating restricted objects.
Generic class for solving transient nonlinear problems.
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.
bool _safe_access_tagged_vectors
Is it safe to retrieve data from tagged vectors.
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
virtual void addResidualNeighbor(const THREAD_ID tid)=0
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid)
void showFunctorRequestors() const
Lists all functors and all the objects that requested them.
bool havePRefinement() const
Query whether p-refinement has been requested at any point during the simulation.
virtual void prepareFace(const Elem *elem, 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.
virtual void addJacobianNeighbor(const THREAD_ID tid)=0
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
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
virtual void setCurrentlyComputingResidual(const bool currently_computing_residual)
Set whether or not the problem is in the process of computing the residual.
void showFunctors() const
Lists all functors in the problem.
virtual MooseMesh & mesh()=0
virtual bool computingScalingResidual() const =0
Getter for whether we're computing the scaling residual.
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
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 bool checkResidualForNans() const =0
Whether to check residual for NaN/Inf values.
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid)=0
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)=0
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 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.
virtual bool computingScalingJacobian() const =0
Getter for whether we're computing the scaling jacobian.
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.
void registerUnfilledFunctorRequest(T *functor_interface, const std::string &functor_name, const THREAD_ID tid)
Register an unfulfilled functor request.
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
bool _currently_computing_residual
Whether the residual is being evaluated.
virtual bool hasLinearVariable(const std::string &var_name) const
Whether or not this problem has this linear variable.
bool _computing_nonlinear_residual
Whether the non-linear residual is being evaluated.
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.
virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num)=0
virtual void needFV()=0
marks this problem as including/needing finite volume functionality.
void hasScalingVector(const unsigned int nl_sys_num)
Tells this problem that the assembly associated with the given nonlinear system number involves a sca...
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
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.
std::map< std::string, std::vector< dof_id_type > > _var_dof_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)
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
Factory & _factory
The Factory for building objects.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
virtual void reinitNode(const Node *node, const THREAD_ID tid)=0
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
virtual unsigned int numMatrixTags() const
The total number of tags.
virtual SystemBase & systemBaseSolver(const unsigned int sys_num)=0
bool doingPRefinement() const
std::map< MooseObjectName, std::set< std::string > > _consumed_material_properties
void setCurrentlyComputingJacobian(const bool currently_computing_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
virtual DiracKernelInfo & diracKernelInfo()
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)=0
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const
void preparePRefinement()
Prepare DofMap and Assembly classes with our p-refinement information.
virtual unsigned int currentLinearSysNum() const =0
static InputParameters validParams()
virtual LineSearch * getLineSearch()=0
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid)=0
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
virtual void addGhostedBoundary(BoundaryID boundary_id)=0
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
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 SystemBase & systemBaseLinear(const unsigned int sys_num)=0
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...
virtual void ghostGhostedBoundaries()=0
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
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.
virtual void reinitElemFace(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
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)
void setFunctorOutput(bool set_output)
Setter for debug functor output.
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
virtual void addJacobianNeighborLowerD(const THREAD_ID tid)=0
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 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.
virtual const MooseMesh & mesh() const =0
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 haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
virtual void addResidual(const THREAD_ID tid)=0
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
void markFamilyPRefinement(const InputParameters ¶ms)
Mark a variable family for either disabling or enabling p-refinement with valid parameters of a varia...
std::vector< std::set< TagID > > _active_sc_var_coupleable_matrix_tags
virtual void addGhostedElem(dof_id_type elem_id)=0
Will make sure that all dofs connected to elem_id are ghosted to this processor.
DiracKernelInfo _dirac_kernel_info
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 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 void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid)=0
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const =0
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
virtual SystemBase & systemBaseAuxiliary()=0
void reinitMortarElem(const Elem *elem, const THREAD_ID tid=0)
Reinit a mortar element to obtain a valid JxW.
virtual void setResidual(libMesh::NumericVector< libMesh::Number > &residual, const THREAD_ID tid)=0
bool _safe_access_tagged_matrices
Is it safe to retrieve data from tagged matrices.
virtual void prepareNeighborShapes(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 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 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.
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const =0
void addAlgebraicGhostingFunctor(libMesh::GhostingFunctor &algebraic_gf, bool to_mesh=true)
Add an algebraic ghosting functor to this problem's DofMaps.
bool _default_ghosting
Whether or not to use default libMesh coupling.
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)
virtual bool checkNonlocalCouplingRequirement() const =0
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::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
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 void prepare(const Elem *elem, const THREAD_ID tid)=0
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL)=0
update geometric search data
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...
std::unordered_map< FEFamily, bool > _family_for_p_refinement
Indicate whether a family is disabled for p-refinement.
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 bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
bool _have_p_refinement
Whether p-refinement has been requested at any point during the simulation.
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 haveADObjects() const
Method for reading wehther we have any ad objects.
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 libMesh::System & getSystem(const std::string &var_name)=0
Returns the equation system containing the variable provided.
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid)=0
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 prepareShapes(unsigned int var, const THREAD_ID tid)=0
virtual void onTimestepBegin()=0
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid)
Set the current lower dimensional element.
virtual unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const =0
virtual unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const =0
void setCurrentlyComputingResidualAndJacobian(bool currently_computing_residual_and_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
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
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)
void setChainControlDataOutput(bool set_output)
Setter for debug chain control data output.
const bool & currentlyComputingResidual() const
Returns true if the problem is in the process of computing the residual.
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided.
virtual void addCachedResidual(const THREAD_ID tid)
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
virtual void reinitOffDiagScalars(const THREAD_ID tid)=0
static const std::unordered_set< FEFamily > _default_families_without_p_refinement
The set of variable families by default disable p-refinement.
virtual bool haveFV() const =0
returns true if this problem includes/needs finite volume functionality.
virtual void addCachedJacobian(const THREAD_ID tid)
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
bool _currently_computing_jacobian
Flag to determine whether the problem is currently computing Jacobian.
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< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
virtual void addJacobianNeighbor(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)=0
virtual libMesh::EquationSystems & es()=0
virtual void onTimestepEnd()=0
std::set< std::string > _material_property_requested
set containing all material property names that have been requested by getMaterialProperty*
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 setResidualNeighbor(libMesh::NumericVector< libMesh::Number > &residual, const THREAD_ID tid)=0
bool _show_functors
Whether to output a list of the functors used and requested (currently only at initialSetup)
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 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 addJacobianLowerD(const THREAD_ID tid)=0
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 const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const =0
The coupling matrix defining what blocks exist in the preconditioning matrix.
virtual void prepareAssembly(const THREAD_ID tid)=0
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 hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
virtual void reinitNeighborPhys(const Elem *neighbor, const std::vector< Point > &physical_points, const THREAD_ID tid)=0
virtual void addJacobian(const THREAD_ID tid)=0
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 bool isTransient() const =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.
virtual void clearDiracInfo()=0
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.
virtual bool nlConverged(const unsigned int nl_sys_num)
virtual void reinitElem(const Elem *elem, const THREAD_ID tid)=0
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid)=0
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
virtual void addResidualLower(const THREAD_ID tid)=0
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.
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
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.
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
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.
virtual void prepare(const Elem *elem, unsigned int ivar, unsigned int jvar, const std::vector< dof_id_type > &dof_indices, const THREAD_ID tid)=0
virtual bool haveDisplaced() const =0
Whether we have a displaced problem in our simulation.
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 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)
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.
bool _currently_computing_residual_and_jacobian
Flag to determine whether the problem is currently computing the residual and Jacobian.
virtual const MooseMesh & mesh(bool use_displaced) const =0
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
virtual const Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) const =0
void reinitGeomSearch()
reinitialize this object's geometric search data, e.g.
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid)=0
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)
Storage for all of the information pretaining to a vector tag.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
VarKindType
Framework-wide stuff.
void initial_condition(libMesh::EquationSystems &es, const std::string &system_name)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::string demangle(const char *name)
VectorValue< Real > RealVectorValue