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)
125 for (
const auto sys_num : index_range(
_assembly[tid]))
127 type, order, volume_order, face_order, block, allow_negative_qweights);
134 for (
const auto nl_sys_num : index_range(
_assembly[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");
338 const NumericVector<Number> & aux_soln)
340 TIME_SECTION(
"updateMesh", 3,
"Updating Displaced Mesh");
426const std::vector<VectorTag> &
478 if (nl->hasVariable(var_name))
488 const std::string & var_name,
495 expected_var_field_type,
504 if (nl->hasVariable(var_name))
505 return nl->getFieldVariable<Real>(tid, var_name);
509 mooseError(
"No variable with name '" + var_name +
"'");
516 if (nl->hasVariable(var_name))
517 return nl->getActualFieldVariable<Real>(tid, var_name);
519 return _displaced_aux->getActualFieldVariable<Real>(tid, var_name);
521 mooseError(
"No variable with name '" + var_name +
"'");
528 if (nl->hasVariable(var_name))
529 return nl->getFieldVariable<RealVectorValue>(tid, var_name);
531 return _displaced_aux->getFieldVariable<RealVectorValue>(tid, var_name);
533 mooseError(
"No variable with name '" + var_name +
"'");
540 if (nl->hasVariable(var_name))
541 return nl->getFieldVariable<RealEigenVector>(tid, var_name);
543 return _displaced_aux->getFieldVariable<RealEigenVector>(tid, var_name);
545 mooseError(
"No variable with name '" + var_name +
"'");
552 if (nl->hasScalarVariable(var_name))
564 if (nl->hasScalarVariable(var_name))
565 return nl->getScalarVariable(tid, var_name);
569 mooseError(
"No variable with name '" + var_name +
"'");
575 for (
const auto sys_num : make_range(
_eq.n_systems()))
577 auto & sys =
_eq.get_system(sys_num);
578 if (sys.has_variable(var_name))
582 mooseError(
"Unable to find a system containing the variable " + var_name);
587 const std::string & name,
589 const unsigned int nl_system_number)
596 const std::string & name,
619 _assembly[tid][nl_sys_num]->reinit(elem);
624 _assembly[tid][nl_sys_num]->prepareJacobianBlock();
625 _assembly[tid][nl_sys_num]->prepareResidual();
641 nl->prepareFace(tid,
true);
649 const std::vector<dof_id_type> & dof_indices,
654 _assembly[tid][nl_sys_num]->reinit(elem);
672 SubdomainID did = elem->neighbor_ptr(side)->subdomain_id();
680 const std::vector<dof_id_type> & idof_indices,
681 const std::vector<dof_id_type> & jdof_indices,
704 unsigned int n_points = points.size();
710 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, points);
727 nl->reinitElem(elem, tid);
733 const std::vector<Point> & phys_points_in_elem,
737 "Are you calling this method with a undisplaced mesh element?");
741 _assembly[tid][nl_sys_num]->reinitAtPhysical(elem, phys_points_in_elem);
755 _assembly[tid][nl_sys_num]->reinit(elem, side);
766 _assembly[tid][nl_sys_num]->reinit(node);
777 _assembly[tid][nl_sys_num]->reinit(node);
793 const std::vector<Point> * neighbor_reference_points)
797 const Elem * neighbor = elem->neighbor_ptr(side);
798 unsigned int neighbor_side = neighbor->which_neighbor_am_i(elem);
802 _assembly[tid][nl_sys_num]->reinitElemAndNeighbor(
803 elem, side, neighbor, neighbor_side, neighbor_reference_points);
806 _assembly[tid][nl_sys_num]->prepareNeighbor();
812 nl->reinitElemFace(elem, side, tid);
813 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
821 unsigned int neighbor_side,
822 const std::vector<Point> & physical_points,
826 "Are you calling this method with a undisplaced mesh element?");
831 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
842 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
848 const std::vector<Point> & physical_points,
852 "Are you calling this method with a undisplaced mesh element?");
857 _assembly[tid][nl_sys_num]->reinitNeighborAtPhysical(neighbor, physical_points);
868 nl->reinitNeighbor(neighbor, tid);
888 if (lower_d_elem_neighbor &&
892 std::vector<Point> reference_points;
894 lower_d_elem_neighbor->dim(), lower_d_elem_neighbor, qps, reference_points);
902 bool reinit_for_derivative_reordering )
905 nl->reinitScalars(tid, reinit_for_derivative_reordering);
906 _displaced_aux->reinitScalars(tid, reinit_for_derivative_reordering);
965 std::vector<VectorTag> extra_residual_vector_tags;
970 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
971 extra_residual_vector_tags.push_back(vector_tag);
978 extra_residual_vector_tags);
1043 const DofMap & dof_map,
1044 std::vector<dof_id_type> & dof_indices,
1045 const std::set<TagID> & tags,
1056 const DofMap & dof_map,
1057 const std::vector<dof_id_type> & idof_indices,
1058 const std::vector<dof_id_type> & jdof_indices,
1059 const std::set<TagID> & tags,
1070 const DofMap & dof_map,
1071 std::vector<dof_id_type> & dof_indices,
1072 std::vector<dof_id_type> & neighbor_dof_indices,
1073 const std::set<TagID> & tags,
1081 neighbor_dof_indices,
1107 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Displaced GeometricSearch");
1122 if (clean_refinement_flags)
1231const CouplingMatrix *
1265 nl->timestepSetup();
1275 nl->customSetup(exec_type);
1285 nl->residualSetup();
1295 nl->jacobianSetup();
1303 _mproblem.SubProblem::haveADObjects(have_ad_objects);
1306std::pair<bool, unsigned int>
1308 const bool error_if_not_found)
const
1316 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1317 mooseAssert(sys_num <
_assembly[tid].size(),
1318 "System number larger than the assembly container size");
1325 mooseAssert(tid <
_assembly.size(),
"Assembly objects not initialized");
1326 mooseAssert(sys_num <
_assembly[tid].size(),
1327 "System number larger than the assembly container size");
1349const std::vector<VectorTag> &
1419 _ref_mesh(_displaced_problem.refMesh()),
1420 _nl_soln(_displaced_problem._nl_solution),
1421 _aux_soln(*_displaced_problem._aux_solution),
1422 _has_displacement(false)
1430 _displaced_problem(x._displaced_problem),
1432 _nl_soln(x._nl_soln),
1433 _aux_soln(x._aux_soln),
1434 _sys_to_nonghost_and_ghost_soln(x._sys_to_nonghost_and_ghost_soln),
1435 _sys_to_var_num_and_direction(x._sys_to_var_num_and_direction),
1436 _has_displacement(x._has_displacement)
1443 std::vector<std::string> & displacement_variables = _displaced_problem._displacements;
1444 unsigned int num_displacements = displacement_variables.size();
1445 auto &
es = _displaced_problem.es();
1447 _sys_to_var_num_and_direction.clear();
1448 _sys_to_nonghost_and_ghost_soln.clear();
1450 for (
unsigned int i = 0; i < num_displacements; i++)
1452 std::string displacement_name = displacement_variables[i];
1454 for (
const auto sys_num : make_range(
es.n_systems()))
1456 auto & sys =
es.get_system(sys_num);
1457 if (sys.has_variable(displacement_name))
1459 auto & val = _sys_to_var_num_and_direction[sys.number()];
1460 val.first.push_back(sys.variable_number(displacement_name));
1461 val.second.push_back(i);
1467 for (
const auto & pr : _sys_to_var_num_and_direction)
1469 auto & sys =
es.get_system(pr.first);
1470 mooseAssert(sys.number() <= _nl_soln.size(),
1471 "The system number should always be less than or equal to the number of nonlinear "
1472 "systems. If it is equal, then this system is the auxiliary system");
1473 const NumericVector<Number> *
const nonghost_soln =
1474 sys.number() < _nl_soln.size() ? _nl_soln[sys.number()] : &_aux_soln;
1475 _sys_to_nonghost_and_ghost_soln.emplace(
1477 std::make_pair(nonghost_soln,
1478 NumericVector<Number>::build(nonghost_soln->comm()).release()));
1483 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1485 auto & sys =
es.get_system(sys_num);
1487 this->_fe_problem,
_ref_mesh, var_num_and_direction.first, sys);
1490 auto & [soln, ghost_soln] = libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num);
1493 soln->localize(*ghost_soln, send_list.
send_list());
1496 _has_displacement =
false;
1502 Node & displaced_node = *(*nd);
1506 for (
auto & [sys_num, var_num_and_direction] : _sys_to_var_num_and_direction)
1508 auto & var_numbers = var_num_and_direction.first;
1509 auto & directions = var_num_and_direction.second;
1510 for (
const auto i : index_range(var_numbers))
1512 const auto direction = directions[i];
1513 if (reference_node.n_dofs(sys_num, var_numbers[i]) > 0)
1515 Real coord = reference_node(direction) +
1516 (*libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num).second)(
1517 reference_node.dof_number(sys_num, var_numbers[i], 0));
1518 if (displaced_node(direction) != coord)
1520 displaced_node(direction) = coord;
1521 _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.
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())