23#include "libmesh/numeric_vector.h"
24#include "libmesh/fe_interface.h"
25#include "libmesh/mesh_base.h"
26#include "libmesh/transient_system.h"
27#include "libmesh/explicit_system.h"
38 "A Problem object for providing access to the displaced finite element "
39 "mesh and associated variables.");
47 _mproblem(parameters.have_parameter<
FEProblemBase *>(
"_fe_problem_base")
52 _ref_mesh(_mproblem.
mesh()),
53 _displacements(getParam<
std::vector<
std::string>>(
"displacements")),
54 _geometric_search_data(*this, _mesh)
71 std::to_string(nl_sys_num),
75 for (
unsigned int i = 0; i <
n_threads; ++i)
76 _assembly[i].emplace_back(std::make_unique<Assembly>(*displaced_nl, i));
82 std::make_unique<DisplacedSystem>(*
this,
112std::set<dof_id_type> &
124 const bool allow_negative_qweights)
129 type, order, volume_order, face_order, block, allow_negative_qweights);
158 std::vector<std::pair<unsigned int, unsigned short>> disp_numbers_and_directions;
162 const auto & disp_variable =
getVariable(tid, disp_string);
163 if (disp_variable.sys().number() == nl_sys_num)
164 disp_numbers_and_directions.push_back(
165 std::make_pair(disp_variable.number(), cast_int<unsigned short>(direction)));
167 _assembly[tid][nl_sys_num]->assignDisplacements(std::move(disp_numbers_and_directions));
173 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
181 TIME_SECTION(
"eq::init", 2,
"Initializing Displaced Equation System");
213 displaced_nl->saveOldSolutions();
221 displaced_nl->restoreOldSolutions();
235 TIME_SECTION(
"syncSolutions", 5,
"Syncing Displaced Solutions");
240 mooseAssert(nl_sys_num == displaced_nl->number(),
241 "We should have designed things such that the nl system numbers make their system "
242 "numbering in the EquationSystems object");
243 (*displaced_nl->sys().solution) =
255 TIME_SECTION(
"syncSolutions", 5,
"Syncing Displaced Solutions");
257 for (
const auto [nl_sys_num, nl_soln] : nl_solns)
268 TIME_SECTION(
"updateMesh", 3,
"Updating Displaced Mesh");
342 TIME_SECTION(
"updateMesh", 3,
"Updating Displaced Mesh");
350 UpdateDisplacedMeshThread udmt(
_mproblem, *
this);
373 if (udmt.hasDisplacement())
428const std::vector<VectorTag> &
480 if (nl->hasVariable(var_name))
490 const std::string & var_name,
497 expected_var_field_type,
506 if (nl->hasVariable(var_name))
507 return nl->getFieldVariable<
Real>(tid, var_name);
511 mooseError(
"No variable with name '" + var_name +
"'");
518 if (nl->hasVariable(var_name))
519 return nl->getActualFieldVariable<
Real>(tid, var_name);
523 mooseError(
"No variable with name '" + var_name +
"'");
530 if (nl->hasVariable(var_name))
535 mooseError(
"No variable with name '" + var_name +
"'");
542 if (nl->hasVariable(var_name))
547 mooseError(
"No variable with name '" + var_name +
"'");
554 if (nl->hasScalarVariable(var_name))
566 if (nl->hasScalarVariable(var_name))
567 return nl->getScalarVariable(tid, var_name);
571 mooseError(
"No variable with name '" + var_name +
"'");
580 if (sys.has_variable(var_name))
584 mooseError(
"Unable to find a system containing the variable " + var_name);
589 const std::string & name,
591 const unsigned int nl_system_number)
598 const std::string & name,
621 _assembly[tid][nl_sys_num]->reinit(elem);
626 _assembly[tid][nl_sys_num]->prepareJacobianBlock();
627 _assembly[tid][nl_sys_num]->prepareResidual();
643 nl->prepareFace(tid,
true);
651 const std::vector<dof_id_type> & dof_indices,
656 _assembly[tid][nl_sys_num]->reinit(elem);
682 const std::vector<dof_id_type> & idof_indices,
683 const std::vector<dof_id_type> & jdof_indices,
706 unsigned int n_points = points.size();
712 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, points);
729 nl->reinitElem(elem, tid);
735 const std::vector<Point> & phys_points_in_elem,
739 "Are you calling this method with a undisplaced mesh element?");
743 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, phys_points_in_elem);
757 _assembly[tid][nl_sys_num]->reinit(elem, side);
768 _assembly[tid][nl_sys_num]->reinit(node);
779 _assembly[tid][nl_sys_num]->reinit(node);
789 nl->reinitNodes(nodes, tid);
797 nl->reinitNodesNeighbor(nodes, tid);
811 const std::vector<Point> * neighbor_reference_points)
820 _assembly[tid][nl_sys_num]->reinitElemAndNeighbor(
821 elem, side, neighbor, neighbor_side, neighbor_reference_points);
824 _assembly[tid][nl_sys_num]->prepareNeighbor();
830 nl->reinitElemFace(elem, side, tid);
831 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
839 unsigned int neighbor_side,
840 const std::vector<Point> & physical_points,
844 "Are you calling this method with a undisplaced mesh element?");
849 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
860 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
866 const std::vector<Point> & physical_points,
870 "Are you calling this method with a undisplaced mesh element?");
875 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, physical_points);
886 nl->reinitNeighbor(neighbor, tid);
906 if (lower_d_elem_neighbor &&
910 std::vector<Point> reference_points;
912 lower_d_elem_neighbor->
dim(), lower_d_elem_neighbor, qps, reference_points);
920 bool reinit_for_derivative_reordering )
923 nl->reinitScalars(tid, reinit_for_derivative_reordering);
924 _displaced_aux->reinitScalars(tid, reinit_for_derivative_reordering);
983 std::vector<VectorTag> extra_residual_vector_tags;
988 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
989 extra_residual_vector_tags.push_back(vector_tag);
996 extra_residual_vector_tags);
1062 std::vector<dof_id_type> & dof_indices,
1063 const std::set<TagID> & tags,
1075 const std::vector<dof_id_type> & idof_indices,
1076 const std::vector<dof_id_type> & jdof_indices,
1077 const std::set<TagID> & tags,
1089 std::vector<dof_id_type> & dof_indices,
1090 std::vector<dof_id_type> & neighbor_dof_indices,
1091 const std::set<TagID> & tags,
1099 neighbor_dof_indices,
1125 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Displaced GeometricSearch");
1140 if (clean_refinement_flags)
1283 nl->timestepSetup();
1293 nl->customSetup(exec_type);
1303 nl->residualSetup();
1313 nl->jacobianSetup();
1321 _mproblem.SubProblem::haveADObjects(have_ad_objects);
1324std::pair<bool, unsigned int>
1326 const bool error_if_not_found)
const
1334 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1335 mooseAssert(sys_num <
_assembly[tid].size(),
1336 "System number larger than the assembly container size");
1343 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1344 mooseAssert(sys_num <
_assembly[tid].size(),
1345 "System number larger than the assembly container size");
1367const std::vector<VectorTag> &
1437 _ref_mesh(_displaced_problem.refMesh()),
1438 _nl_soln(_displaced_problem._nl_solution),
1439 _aux_soln(*_displaced_problem._aux_solution),
1440 _has_displacement(false)
1448 _displaced_problem(x._displaced_problem),
1450 _nl_soln(x._nl_soln),
1451 _aux_soln(x._aux_soln),
1452 _sys_to_nonghost_and_ghost_soln(x._sys_to_nonghost_and_ghost_soln),
1453 _sys_to_var_num_and_direction(x._sys_to_var_num_and_direction),
1454 _has_displacement(x._has_displacement)
1461 std::vector<std::string> & displacement_variables = _displaced_problem._displacements;
1462 unsigned int num_displacements = displacement_variables.size();
1463 auto &
es = _displaced_problem.es();
1465 _sys_to_var_num_and_direction.
clear();
1466 _sys_to_nonghost_and_ghost_soln.clear();
1468 for (
unsigned int i = 0; i < num_displacements; i++)
1470 std::string displacement_name = displacement_variables[i];
1475 if (sys.has_variable(displacement_name))
1477 auto & val = _sys_to_var_num_and_direction[sys.number()];
1478 val.first.push_back(sys.variable_number(displacement_name));
1479 val.second.push_back(i);
1485 for (
const auto & pr : _sys_to_var_num_and_direction)
1488 mooseAssert(sys.number() <= _nl_soln.size(),
1489 "The system number should always be less than or equal to the number of nonlinear "
1490 "systems. If it is equal, then this system is the auxiliary system");
1492 sys.number() < _nl_soln.
size() ? _nl_soln[sys.number()] : &_aux_soln;
1493 _sys_to_nonghost_and_ghost_soln.emplace(
1495 std::make_pair(nonghost_soln,
1501 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1505 this->_fe_problem,
_ref_mesh, var_num_and_direction.first, sys);
1508 auto & [soln, ghost_soln] = libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num);
1511 soln->localize(*ghost_soln, send_list.
send_list());
1514 _has_displacement =
false;
1520 Node & displaced_node = *(*nd);
1524 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1526 auto & var_numbers = var_num_and_direction.first;
1527 auto & directions = var_num_and_direction.second;
1530 const auto direction = directions[i];
1531 if (reference_node.
n_dofs(sys_num, var_numbers[i]) > 0)
1533 Real coord = reference_node(direction) +
1534 (*libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num).second)(
1535 reference_node.
dof_number(sys_num, var_numbers[i], 0));
1536 if (displaced_node(direction) != coord)
1538 displaced_node(direction) = coord;
1539 _has_displacement =
true;
boundary_id_type BoundaryID
registerMooseObject("MooseApp", DisplacedProblem)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
std::shared_ptr< DisplacedProblem > displaced_problem
void extraSendList(std::vector< dof_id_type > &send_list, void *context)
///< Type of coordinate system
const std::vector< dof_id_type > & send_list() const
Key structure for APIs manipulating global vectors/matrices.
Keeps track of stuff related to assembling.
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
const NumericVector< Number > *const & currentSolution() const override
The solution vector that is currently being operated on.
void clearPoints()
Remove all of the current points and elements.
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
UpdateDisplacedMeshThread(FEProblemBase &fe_problem, DisplacedProblem &displaced_problem)
virtual void onNode(NodeRange::const_iterator &nd) override
bool hasDisplacement()
Whether the displaced mesh is modified by the latest call to operator()
virtual void addJacobianLowerD(const THREAD_ID tid) override
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const override
virtual LineSearch * getLineSearch() override
virtual unsigned int currentLinearSysNum() const override
virtual void addResidual(const THREAD_ID tid) override
std::vector< const NumericVector< Number > * > _nl_solution
The nonlinear system solutions.
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual TagID getMatrixTagID(const TagName &tag_name) const override
Get a TagID from a TagName.
std::vector< std::unique_ptr< DisplacedSystem > > _displaced_solver_systems
void meshChanged(bool contract_mesh, bool clean_refinement_flags)
virtual void updateMesh(bool mesh_changing=false)
Copy the solutions on the undisplaced systems to the displaced systems and reinitialize the geometry ...
virtual bool checkNonlocalCouplingRequirement() const override
virtual void addAuxVariable(const std::string &var_type, const std::string &name, InputParameters ¶meters)
virtual void addCachedResidualDirectly(NumericVector< Number > &residual, const THREAD_ID tid)
virtual void jacobianSetup() override
virtual void addResidualNeighbor(const THREAD_ID tid) override
virtual unsigned int solverSysNum(const SolverSystemName &sys_name) const override
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
virtual void addResidualLower(const THREAD_ID tid) override
virtual void getDiracElements(std::set< const Elem * > &elems) override
Fills "elems" with the elements that should be looped over for Dirac Kernels.
virtual bool isTransient() const override
virtual void addJacobian(const THREAD_ID tid) override
virtual unsigned int currentNlSysNum() const override
virtual bool matrixTagExists(const TagName &tag_name) const override
Check to see if a particular Tag exists.
virtual void initialSetup() override
virtual TagID getVectorTagID(const TagName &tag_name) const override
Get a TagID from a TagName.
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override
void syncAuxSolution(const NumericVector< Number > &aux_soln)
Copy the provided solution into the displaced auxiliary system.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false) override
fills the VariableValue arrays for scalar variables from the solution vector
virtual void setResidual(NumericVector< Number > &residual, const THREAD_ID tid) override
virtual void addJacobianBlockTags(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
const NumericVector< Number > * _aux_solution
The auxiliary system solution.
virtual System & getSystem(const std::string &var_name) override
Returns the equation system containing the variable provided.
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
virtual void prepareBlockNonlocal(unsigned int ivar, unsigned int jvar, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, const THREAD_ID tid)
virtual bool safeAccessTaggedVectors() const override
Is it safe to access the tagged vectors.
virtual void prepareAssembly(const THREAD_ID tid) override
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
void undisplaceMesh()
Resets the displaced mesh to the reference mesh.
virtual void prepareAssemblyNeighbor(const THREAD_ID tid)
virtual bool vectorTagExists(const TagID tag_id) const override
Check to see if a particular Tag exists.
virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
virtual const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
virtual std::size_t numNonlinearSystems() const override
virtual void addJacobianNeighbor(const THREAD_ID tid) override
virtual const std::vector< VectorTag > & getVectorTags(const Moose::VectorTagType type=Moose::VECTOR_TAG_ANY) const override
Return all vector tags, where a tag is represented by a map from name to ID.
MooseMesh & _ref_mesh
reference mesh
static InputParameters validParams()
virtual const VectorTag & getVectorTag(const TagID tag_id) const override
Get a VectorTag from a TagID.
virtual void cacheJacobianNonlocal(const THREAD_ID tid)
virtual void addVariable(const std::string &var_type, const std::string &name, InputParameters ¶meters, unsigned int nl_system_number)
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual std::set< dof_id_type > & ghostedElems() override
Return the list of elements that should have their DoFs ghosted to this processor.
virtual unsigned int numMatrixTags() const override
The total number of tags.
virtual const CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
void bumpAllQRuleOrder(Order order, SubdomainID block)
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const override
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested VectorMooseVariable which may be in any system.
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested ArrayMooseVariable which may be in any system.
virtual bool computingScalingResidual() const override final
Getter for whether we're computing the scaling residual.
virtual void init() override
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it's initial residual.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
void addJacobianBlockNonlocal(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided.
virtual bool computingScalingJacobian() const override final
Getter for whether we're computing the scaling jacobian.
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
virtual void customSetup(const ExecFlagType &exec_type) override
virtual void timestepSetup() override
virtual void onTimestepBegin() override
virtual bool safeAccessTaggedMatrices() const override
Is it safe to access the tagged matrices.
void addTimeIntegrator()
Get the time integrators from the problem.
std::unique_ptr< DisplacedSystem > _displaced_aux
virtual std::size_t numSolverSystems() const override
virtual MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariableField which may be in any system.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual unsigned int numVectorTags(const Moose::VectorTagType type=Moose::VECTOR_TAG_ANY) const override
The total number of tags, which can be limited to the tag type.
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual void addJacobianNonlocal(const THREAD_ID tid)
virtual void setResidualNeighbor(NumericVector< Number > &residual, const THREAD_ID tid) override
GeometricSearchData _geometric_search_data
virtual TagName vectorTagName(const TagID tag_id) const override
Retrieve the name associated with a TagID.
virtual std::size_t numLinearSystems() const override
FEProblemBase & _mproblem
virtual TagName matrixTagName(TagID tag) override
Retrieve the name associated with a TagID.
virtual bool hasNonlocalCoupling() const override
Whether the simulation has active nonlocal coupling which should be accounted for in the Jacobian.
DisplacedProblem(DisplacedProblem &&)=delete
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
bool haveADObjects() const
Method for reading wehther we have any ad objects.
virtual void reinitElemFace(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
virtual bool solverSystemConverged(const unsigned int solver_sys_num) override
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
void bumpVolumeQRuleOrder(Order order, SubdomainID block)
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL) override
Create a Tag.
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
update geometric search data
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
virtual void residualSetup() override
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
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 override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual EquationSystems & es() override
virtual void prepareNonlocal(const THREAD_ID tid)
virtual void needFV() override
marks this problem as including/needing finite volume functionality.
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
virtual TagID addMatrixTag(TagName tag_name) override
Create a Tag.
virtual unsigned int linearSysNum(const LinearSystemName &sys_name) const override
virtual void onTimestepEnd() override
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
std::vector< std::string > _displacements
virtual void reinitOffDiagScalars(const THREAD_ID tid) override
virtual void initAdaptivity()
virtual void createQRules(QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block, bool allow_negative_qweights=true)
void syncSolutions()
Copy the solutions on the undisplaced systems to the displaced systems.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
bool hasJacobian() const
Returns _has_jacobian.
virtual std::size_t numLinearSystems() const override
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
virtual unsigned int currentLinearSysNum() const override
AuxiliarySystem & getAuxiliarySystem()
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
virtual std::size_t numSolverSystems() const override
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class,...
virtual std::size_t numNonlinearSystems() const override
virtual const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
LineSearch * getLineSearch() override
getter for the MOOSE line search
virtual void needFV() override
marks this problem as including/needing finite volume functionality.
void computingScalingJacobian(bool computing_scaling_jacobian)
Setter for whether we're computing the scaling jacobian.
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual bool hasNonlocalCoupling() const override
Whether the simulation has active nonlocal coupling which should be accounted for in the Jacobian.
virtual void checkExceptionAndStopSolve(bool print_message=true)
Check to see if an exception has occurred on any processor and, if possible, force the solve to fail,...
virtual unsigned int currentNlSysNum() const override
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
virtual bool checkNonlocalCouplingRequirement() const override
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
void automaticScaling(bool automatic_scaling) override
Automatic scaling setter.
virtual void meshDisplaced()
Update data after a mesh displaced.
virtual bool isTransient() const override
void computingScalingResidual(bool computing_scaling_residual)
Setter for whether we're computing the scaling residual.
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const override
Determine what solver system the provided variable name lies in.
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it's initial residual.
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void reinit()
Completely redo all geometric search objects.
GeometricSearchType
Used to select groups of geometric search objects to update.
void update(GeometricSearchType type=ALL)
Update all of the search objects.
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.
Class for containing MooseEnum item information.
Provides a way for users to bail out of the current solve.
virtual const char * what() const
Get out the error message.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
void setupFiniteVolumeMeshData() const
Sets up the additional data needed for finite volume computations.
const Elem * getLowerDElem(const Elem *, unsigned short int) const
Returns a const pointer to a lower dimensional element that corresponds to a side of a higher dimensi...
void meshChanged()
Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.
virtual const Node & nodeRef(const dof_id_type i) const
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void setCoordData(const MooseMesh &other_mesh)
Set the coordinate system data to that of other_mesh.
void clearQuadratureNodes()
Clear out any existing quadrature nodes.
virtual Elem * queryElemPtr(const dof_id_type i)
const std::set< SubdomainID > & interiorLowerDBlocks() const
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).
Generic class for solving transient nonlinear problems.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
virtual const VectorTag & getVectorTag(const TagID tag_id) const
Get a VectorTag from a TagID.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
virtual void customSetup(const ExecFlagType &exec_type)
virtual void jacobianSetup()
virtual void initialSetup()
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
virtual unsigned int numMatrixTags() const
The total number of tags.
static InputParameters validParams()
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
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 TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
DiracKernelInfo _dirac_kernel_info
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
virtual bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
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 bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
virtual void timestepSetup()
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
virtual void residualSetup()
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
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)
virtual const std::string & name() const
void update()
Update the system (doing libMesh magic)
Storage for all of the information pretaining to a vector tag.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
unsigned int which_neighbor_am_i(const Elem *e) const
virtual unsigned short dim() const=0
subdomain_id_type subdomain_id() const
const Elem * neighbor_ptr(unsigned int i) const
unsigned int n_systems() const
const T_sys & get_system(std::string_view name) const
void disable_refine_in_reinit()
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
virtual bool is_serial() const
virtual bool contract()=0
void clear_point_locator()
virtual void gather_to_zero()
virtual bool is_serial_on_zero() const
void clean_refinement_flags()
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
virtual numeric_index_type size() const=0
const Parallel::Communicator & comm() const
vec_type::const_iterator const_iterator
VarKindType
Framework-wide stuff.
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
auto index_range(const T &sizable)
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)