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"
36 "A Problem object for providing access to the displaced finite element "
37 "mesh and associated variables.");
45 _mproblem(parameters.have_parameter<
FEProblemBase *>(
"_fe_problem_base")
50 _ref_mesh(_mproblem.
mesh()),
51 _displacements(getParam<
std::vector<
std::string>>(
"displacements")),
52 _geometric_search_data(*this, _mesh)
56 _eq.disable_refine_in_reinit();
69 std::to_string(nl_sys_num),
73 for (
unsigned int i = 0; i < n_threads; ++i)
74 _assembly[i].emplace_back(std::make_unique<Assembly>(*displaced_nl, i));
80 std::make_unique<DisplacedSystem>(*
this,
110std::set<dof_id_type> &
122 const bool allow_negative_qweights)
124 for (
unsigned int tid = 0; tid < this->
numThreads(); ++tid)
125 for (
const auto sys_num : index_range(
_assembly[tid]))
127 type, order, volume_order, face_order, block, allow_negative_qweights);
133 for (
unsigned int tid = 0; tid < this->
numThreads(); ++tid)
134 for (
const auto nl_sys_num : index_range(
_assembly[tid]))
141 for (
unsigned int tid = 0; tid < this->
numThreads(); ++tid)
142 for (
const auto nl_sys_num : index_range(
_assembly[tid]))
156 std::vector<std::pair<unsigned int, unsigned short>> disp_numbers_and_directions;
160 const auto & disp_variable =
getVariable(tid, disp_string);
161 if (disp_variable.sys().number() == nl_sys_num)
162 disp_numbers_and_directions.push_back(
163 std::make_pair(disp_variable.number(), cast_int<unsigned short>(direction)));
165 _assembly[tid][nl_sys_num]->assignDisplacements(std::move(disp_numbers_and_directions));
171 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
179 TIME_SECTION(
"eq::init", 2,
"Initializing Displaced Equation System");
211 displaced_nl->saveOldSolutions();
219 displaced_nl->restoreOldSolutions();
233 TIME_SECTION(
"syncSolutions", 5,
"Syncing Displaced Solutions");
238 mooseAssert(nl_sys_num == displaced_nl->number(),
239 "We should have designed things such that the nl system numbers make their system "
240 "numbering in the EquationSystems object");
241 (*displaced_nl->sys().solution) =
250 const std::map<
unsigned int,
const NumericVector<Number> *> & nl_solns,
251 const NumericVector<Number> & aux_soln)
253 TIME_SECTION(
"syncSolutions", 5,
"Syncing Displaced Solutions");
255 for (
const auto [nl_sys_num, nl_soln] : nl_solns)
266 TIME_SECTION(
"updateMesh", 3,
"Updating Displaced Mesh");
340 const NumericVector<Number> & aux_soln)
342 TIME_SECTION(
"updateMesh", 3,
"Updating Displaced Mesh");
430const std::vector<VectorTag> &
482 if (nl->hasVariable(var_name))
492 const std::string & var_name,
499 expected_var_field_type,
508 if (nl->hasVariable(var_name))
509 return nl->getFieldVariable<Real>(tid, var_name);
513 mooseError(
"No variable with name '" + var_name +
"'");
520 if (nl->hasVariable(var_name))
521 return nl->getActualFieldVariable<Real>(tid, var_name);
523 return _displaced_aux->getActualFieldVariable<Real>(tid, var_name);
525 mooseError(
"No variable with name '" + var_name +
"'");
532 if (nl->hasVariable(var_name))
533 return nl->getFieldVariable<RealVectorValue>(tid, var_name);
535 return _displaced_aux->getFieldVariable<RealVectorValue>(tid, var_name);
537 mooseError(
"No variable with name '" + var_name +
"'");
544 if (nl->hasVariable(var_name))
545 return nl->getFieldVariable<RealEigenVector>(tid, var_name);
547 return _displaced_aux->getFieldVariable<RealEigenVector>(tid, var_name);
549 mooseError(
"No variable with name '" + var_name +
"'");
556 if (nl->hasScalarVariable(var_name))
568 if (nl->hasScalarVariable(var_name))
569 return nl->getScalarVariable(tid, var_name);
573 mooseError(
"No variable with name '" + var_name +
"'");
579 for (
const auto sys_num : make_range(
_eq.n_systems()))
581 auto & sys =
_eq.get_system(sys_num);
582 if (sys.has_variable(var_name))
586 mooseError(
"Unable to find a system containing the variable " + var_name);
591 const std::string & name,
593 const unsigned int nl_system_number)
600 const std::string & name,
623 _assembly[tid][nl_sys_num]->reinit(elem);
628 _assembly[tid][nl_sys_num]->prepareJacobianBlock();
629 _assembly[tid][nl_sys_num]->prepareResidual();
645 nl->prepareFace(tid,
true);
653 const std::vector<dof_id_type> & dof_indices,
658 _assembly[tid][nl_sys_num]->reinit(elem);
676 SubdomainID did = elem->neighbor_ptr(side)->subdomain_id();
684 const std::vector<dof_id_type> & idof_indices,
685 const std::vector<dof_id_type> & jdof_indices,
708 unsigned int n_points = points.size();
714 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, points);
731 nl->reinitElem(elem, tid);
737 const std::vector<Point> & phys_points_in_elem,
741 "Are you calling this method with a undisplaced mesh element?");
745 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, phys_points_in_elem);
759 _assembly[tid][nl_sys_num]->reinit(elem, side);
770 _assembly[tid][nl_sys_num]->reinit(node);
781 _assembly[tid][nl_sys_num]->reinit(node);
797 const std::vector<Point> * neighbor_reference_points)
801 const Elem * neighbor = elem->neighbor_ptr(side);
802 unsigned int neighbor_side = neighbor->which_neighbor_am_i(elem);
806 _assembly[tid][nl_sys_num]->reinitElemAndNeighbor(
807 elem, side, neighbor, neighbor_side, neighbor_reference_points);
810 _assembly[tid][nl_sys_num]->prepareNeighbor();
816 nl->reinitElemFace(elem, side, tid);
817 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
825 unsigned int neighbor_side,
826 const std::vector<Point> & physical_points,
830 "Are you calling this method with a undisplaced mesh element?");
835 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
846 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
852 const std::vector<Point> & physical_points,
856 "Are you calling this method with a undisplaced mesh element?");
861 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, physical_points);
872 nl->reinitNeighbor(neighbor, tid);
892 if (lower_d_elem_neighbor &&
896 std::vector<Point> reference_points;
898 lower_d_elem_neighbor->dim(), lower_d_elem_neighbor, qps, reference_points);
906 bool reinit_for_derivative_reordering )
909 nl->reinitScalars(tid, reinit_for_derivative_reordering);
910 _displaced_aux->reinitScalars(tid, reinit_for_derivative_reordering);
969 std::vector<VectorTag> extra_residual_vector_tags;
974 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
975 extra_residual_vector_tags.push_back(vector_tag);
982 extra_residual_vector_tags);
1047 const DofMap & dof_map,
1048 std::vector<dof_id_type> & dof_indices,
1049 const std::set<TagID> & tags,
1060 const DofMap & dof_map,
1061 const std::vector<dof_id_type> & idof_indices,
1062 const std::vector<dof_id_type> & jdof_indices,
1063 const std::set<TagID> & tags,
1074 const DofMap & dof_map,
1075 std::vector<dof_id_type> & dof_indices,
1076 std::vector<dof_id_type> & neighbor_dof_indices,
1077 const std::set<TagID> & tags,
1085 neighbor_dof_indices,
1111 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Displaced GeometricSearch");
1126 if (clean_refinement_flags)
1235const CouplingMatrix *
1269 nl->timestepSetup();
1279 nl->customSetup(exec_type);
1289 nl->residualSetup();
1299 nl->jacobianSetup();
1307 _mproblem.SubProblem::haveADObjects(have_ad_objects);
1310std::pair<bool, unsigned int>
1312 const bool error_if_not_found)
const
1320 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1321 mooseAssert(sys_num <
_assembly[tid].size(),
1322 "System number larger than the assembly container size");
1329 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1330 mooseAssert(sys_num <
_assembly[tid].size(),
1331 "System number larger than the assembly container size");
1353const std::vector<VectorTag> &
1423 _ref_mesh(_displaced_problem.refMesh()),
1424 _nl_soln(_displaced_problem._nl_solution),
1425 _aux_soln(*_displaced_problem._aux_solution),
1426 _has_displacement(false)
1434 _displaced_problem(x._displaced_problem),
1436 _nl_soln(x._nl_soln),
1437 _aux_soln(x._aux_soln),
1438 _sys_to_nonghost_and_ghost_soln(x._sys_to_nonghost_and_ghost_soln),
1439 _sys_to_var_num_and_direction(x._sys_to_var_num_and_direction),
1440 _has_displacement(x._has_displacement)
1447 std::vector<std::string> & displacement_variables = _displaced_problem._displacements;
1448 unsigned int num_displacements = displacement_variables.size();
1449 auto &
es = _displaced_problem.es();
1451 _sys_to_var_num_and_direction.clear();
1452 _sys_to_nonghost_and_ghost_soln.clear();
1454 for (
unsigned int i = 0; i < num_displacements; i++)
1456 std::string displacement_name = displacement_variables[i];
1458 for (
const auto sys_num : make_range(
es.n_systems()))
1460 auto & sys =
es.get_system(sys_num);
1461 if (sys.has_variable(displacement_name))
1463 auto & val = _sys_to_var_num_and_direction[sys.number()];
1464 val.first.push_back(sys.variable_number(displacement_name));
1465 val.second.push_back(i);
1471 for (
const auto & pr : _sys_to_var_num_and_direction)
1473 auto & sys =
es.get_system(pr.first);
1474 mooseAssert(sys.number() <= _nl_soln.size(),
1475 "The system number should always be less than or equal to the number of nonlinear "
1476 "systems. If it is equal, then this system is the auxiliary system");
1477 const NumericVector<Number> *
const nonghost_soln =
1478 sys.number() < _nl_soln.size() ? _nl_soln[sys.number()] : &_aux_soln;
1479 _sys_to_nonghost_and_ghost_soln.emplace(
1481 std::make_pair(nonghost_soln,
1482 NumericVector<Number>::build(nonghost_soln->comm()).release()));
1487 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1489 auto & sys =
es.get_system(sys_num);
1491 this->_fe_problem,
_ref_mesh, var_num_and_direction.first, sys);
1494 auto & [soln, ghost_soln] = libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num);
1497 soln->localize(*ghost_soln, send_list.
send_list());
1500 _has_displacement =
false;
1506 Node & displaced_node = *(*nd);
1510 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1512 auto & var_numbers = var_num_and_direction.first;
1513 auto & directions = var_num_and_direction.second;
1514 for (
const auto i : index_range(var_numbers))
1516 const auto direction = directions[i];
1517 if (reference_node.n_dofs(sys_num, var_numbers[i]) > 0)
1519 Real coord = reference_node(direction) +
1520 (*libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num).second)(
1521 reference_node.dof_number(sys_num, var_numbers[i], 0));
1524 if (!std::isfinite(coord))
1525 throw MooseException(
"Non-finite displaced coordinate in direction ",
1528 displaced_node.id(),
1530 if (displaced_node(direction) != coord)
1532 displaced_node(direction) = coord;
1533 _has_displacement =
true;
boundary_id_type BoundaryID
subdomain_id_type SubdomainID
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 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.
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.
THREAD_ID numThreads() const
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.
void clean_refinement_flags()
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
VarKindType
Framework-wide stuff.
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())