https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DisplacedProblem.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "SubProblem.h"
13#include "DisplacedSystem.h"
14#include "GeometricSearchData.h"
15#include "ThreadedNodeLoop.h"
16
17// libMesh
18#include "libmesh/equation_systems.h"
19#include "libmesh/enum_quadrature_type.h"
20
21// Forward declarations
23class AssemblyData;
24class MooseMesh;
25class Assembly;
26class FEProblemBase;
27class LineSearch;
28
29// libMesh forward declarations
30namespace libMesh
31{
32template <typename T>
33class NumericVector;
34class DofMap;
35}
36
38{
39public:
41
44
47
48 virtual EquationSystems & es() override { return _eq; }
49 virtual MooseMesh & mesh() override { return _mesh; }
50 virtual const MooseMesh & mesh() const override { return _mesh; }
51 const MooseMesh & mesh(bool libmesh_dbg_var(use_displaced)) const override
52 {
53 mooseAssert(use_displaced, "An undisplaced mesh was queried from the displaced problem");
54 return mesh();
55 }
57
58 DisplacedSystem & solverSys(const unsigned int sys_num);
60
61 virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override;
62 virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num) override;
63
64 virtual const SystemBase & systemBaseLinear(const unsigned int sys_num) const override;
65 virtual SystemBase & systemBaseLinear(const unsigned int sys_num) override;
66
67 virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override;
68 virtual SystemBase & systemBaseSolver(const unsigned int sys_num) override;
69
70 virtual const SystemBase & systemBaseAuxiliary() const override { return *_displaced_aux; }
71 virtual SystemBase & systemBaseAuxiliary() override { return *_displaced_aux; }
72
73 // Return a constant reference to the vector of variable names.
74 const std::vector<std::string> & getDisplacementVarNames() const { return _displacements; }
75
76 virtual void createQRules(QuadratureType type,
77 Order order,
78 Order volume_order,
79 Order face_order,
80 SubdomainID block,
81 bool allow_negative_qweights = true);
82
83 void bumpVolumeQRuleOrder(Order order, SubdomainID block);
84 void bumpAllQRuleOrder(Order order, SubdomainID block);
85
86 virtual void init() override;
87 virtual bool solverSystemConverged(const unsigned int solver_sys_num) override;
88 virtual unsigned int nlSysNum(const NonlinearSystemName & nl_sys_name) const override;
89 virtual unsigned int linearSysNum(const LinearSystemName & sys_name) const override;
90 virtual unsigned int solverSysNum(const SolverSystemName & sys_name) const override;
91
93 void addTimeIntegrator();
94
98 virtual void saveOldSolutions();
99
103 virtual void restoreOldSolutions();
104
108 void syncAuxSolution(const NumericVector<Number> & aux_soln);
109
113 void syncSolutions();
114
120 void syncSolutions(const std::map<unsigned int, const NumericVector<Number> *> & nl_solns,
121 const NumericVector<Number> & aux_soln);
122
134 virtual void updateMesh(bool mesh_changing = false);
135
140 virtual void updateMesh(const std::map<unsigned int, const NumericVector<Number> *> & nl_soln,
141 const NumericVector<Number> & aux_soln);
142
143 virtual TagID addVectorTag(const TagName & tag_name,
145 virtual const VectorTag & getVectorTag(const TagID tag_id) const override;
146 virtual TagID getVectorTagID(const TagName & tag_name) const override;
147 virtual TagName vectorTagName(const TagID tag_id) const override;
148 virtual bool vectorTagExists(const TagID tag_id) const override;
149 virtual bool vectorTagExists(const TagName & tag_name) const override;
150 virtual unsigned int
152 virtual const std::vector<VectorTag> &
154 virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const override;
155
156 virtual TagID addMatrixTag(TagName tag_name) override;
157 virtual TagID getMatrixTagID(const TagName & tag_name) const override;
158 virtual TagName matrixTagName(TagID tag) override;
159 virtual bool matrixTagExists(const TagName & tag_name) const override;
160 virtual bool matrixTagExists(TagID tag_id) const override;
161 virtual unsigned int numMatrixTags() const override;
162 virtual bool safeAccessTaggedMatrices() const override;
163 virtual bool safeAccessTaggedVectors() const override;
164
165 virtual bool isTransient() const override;
166
167 // Variables /////
168 virtual bool hasVariable(const std::string & var_name) const override;
170 virtual const MooseVariableFieldBase &
171 getVariable(const THREAD_ID tid,
172 const std::string & var_name,
174 Moose::VarFieldType expected_var_field_type =
176 virtual MooseVariable & getStandardVariable(const THREAD_ID tid,
177 const std::string & var_name) override;
179 const std::string & var_name) override;
181 const std::string & var_name) override;
183 const std::string & var_name) override;
184 virtual bool hasScalarVariable(const std::string & var_name) const override;
186 const std::string & var_name) override;
187 virtual System & getSystem(const std::string & var_name) override;
188
189 virtual void addVariable(const std::string & var_type,
190 const std::string & name,
192 unsigned int nl_system_number);
193 virtual void addAuxVariable(const std::string & var_type,
194 const std::string & name,
196 //
197 // Adaptivity /////
198 virtual void initAdaptivity();
199 void meshChanged(bool contract_mesh, bool clean_refinement_flags);
200
201 // reinit /////
202 virtual void prepare(const Elem * elem, const THREAD_ID tid) override;
203 virtual void prepareNonlocal(const THREAD_ID tid);
204 virtual void prepareFace(const Elem * elem, const THREAD_ID tid) override;
205 virtual void prepare(const Elem * elem,
206 unsigned int ivar,
207 unsigned int jvar,
208 const std::vector<dof_id_type> & dof_indices,
209 const THREAD_ID tid) override;
210 virtual void setCurrentSubdomainID(const Elem * elem, const THREAD_ID tid) override;
211 virtual void
212 setNeighborSubdomainID(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
213 virtual void prepareBlockNonlocal(unsigned int ivar,
214 unsigned int jvar,
215 const std::vector<dof_id_type> & idof_indices,
216 const std::vector<dof_id_type> & jdof_indices,
217 const THREAD_ID tid);
218 virtual void prepareAssembly(const THREAD_ID tid) override;
219 virtual void prepareAssemblyNeighbor(const THREAD_ID tid);
220
221 virtual bool reinitDirac(const Elem * elem, const THREAD_ID tid) override;
222
223 virtual void reinitElem(const Elem * elem, const THREAD_ID tid) override;
224 virtual void reinitElemPhys(const Elem * elem,
225 const std::vector<Point> & phys_points_in_elem,
226 const THREAD_ID tid) override;
227 virtual void reinitElemFace(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
228 virtual void reinitNode(const Node * node, const THREAD_ID tid) override;
229 virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, const THREAD_ID tid) override;
230 virtual void reinitNodes(const std::vector<dof_id_type> & nodes, const THREAD_ID tid) override;
231 virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes,
232 const THREAD_ID tid) override;
233 virtual void reinitNeighbor(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
234
244 void reinitNeighbor(const Elem * elem,
245 unsigned int side,
246 const THREAD_ID tid,
247 const std::vector<Point> * neighbor_reference_points);
248
249 virtual void reinitNeighborPhys(const Elem * neighbor,
250 unsigned int neighbor_side,
251 const std::vector<Point> & physical_points,
252 const THREAD_ID tid) override;
253 virtual void reinitNeighborPhys(const Elem * neighbor,
254 const std::vector<Point> & physical_points,
255 const THREAD_ID tid) override;
256 virtual void
257 reinitElemNeighborAndLowerD(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
258 virtual void reinitScalars(const THREAD_ID tid,
259 bool reinit_for_derivative_reordering = false) override;
260 virtual void reinitOffDiagScalars(const THREAD_ID tid) override;
261
263 virtual void getDiracElements(std::set<const Elem *> & elems) override;
264 virtual void clearDiracInfo() override;
265
266 virtual void addResidual(const THREAD_ID tid) override;
267 virtual void addResidualNeighbor(const THREAD_ID tid) override;
268 virtual void addResidualLower(const THREAD_ID tid) override;
269
270 virtual void addCachedResidualDirectly(NumericVector<Number> & residual, const THREAD_ID tid);
271
272 virtual void setResidual(NumericVector<Number> & residual, const THREAD_ID tid) override;
273 virtual void setResidualNeighbor(NumericVector<Number> & residual, const THREAD_ID tid) override;
274
275 virtual void addJacobian(const THREAD_ID tid) override;
276 virtual void addJacobianNonlocal(const THREAD_ID tid);
277 virtual void addJacobianNeighbor(const THREAD_ID tid) override;
278 virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override;
279 virtual void addJacobianLowerD(const THREAD_ID tid) override;
280 virtual void addJacobianBlockTags(SparseMatrix<Number> & jacobian,
281 unsigned int ivar,
282 unsigned int jvar,
283 const libMesh::DofMap & dof_map,
284 std::vector<dof_id_type> & dof_indices,
285 const std::set<TagID> & tags,
286 const THREAD_ID tid);
287 void addJacobianBlockNonlocal(SparseMatrix<Number> & jacobian,
288 unsigned int ivar,
289 unsigned int jvar,
290 const libMesh::DofMap & dof_map,
291 const std::vector<dof_id_type> & idof_indices,
292 const std::vector<dof_id_type> & jdof_indices,
293 const std::set<TagID> & tags,
294 const THREAD_ID tid);
295 virtual void addJacobianNeighbor(SparseMatrix<Number> & jacobian,
296 unsigned int ivar,
297 unsigned int jvar,
298 const libMesh::DofMap & dof_map,
299 std::vector<dof_id_type> & dof_indices,
300 std::vector<dof_id_type> & neighbor_dof_indices,
301 const std::set<TagID> & tags,
302 const THREAD_ID tid) override;
303
304 virtual void cacheJacobianNonlocal(const THREAD_ID tid);
305
306 virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override;
307 virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override;
308 virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override;
309
310 virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override;
311 virtual const Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) const override;
312
313 // Geom Search /////
314 virtual void updateGeomSearch(
317
318 virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override;
319
320 virtual void onTimestepBegin() override;
321 virtual void onTimestepEnd() override;
322
327 virtual std::set<dof_id_type> & ghostedElems() override;
328
332 virtual void addGhostedElem(dof_id_type elem_id) override;
333
338 virtual void addGhostedBoundary(BoundaryID boundary_id) override;
339
343 virtual void ghostGhostedBoundaries() override;
344
349 void undisplaceMesh();
350
351 virtual LineSearch * getLineSearch() override;
352
353 virtual const CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override;
354
355 virtual bool haveDisplaced() const override final { return true; }
356
357 virtual bool computingScalingJacobian() const override final;
358
359 virtual bool computingScalingResidual() const override final;
360
361 virtual void initialSetup() override;
362 virtual void timestepSetup() override;
363 virtual void customSetup(const ExecFlagType & exec_type) override;
364 virtual void residualSetup() override;
365 virtual void jacobianSetup() override;
366
368 virtual void haveADObjects(bool have_ad_objects) override;
369
370 virtual std::size_t numNonlinearSystems() const override;
371
372 virtual std::size_t numLinearSystems() const override;
373
374 virtual std::size_t numSolverSystems() const override;
375
376 virtual unsigned int currentNlSysNum() const override;
377
378 virtual unsigned int currentLinearSysNum() const override;
379
380 virtual const std::vector<VectorTag> & currentResidualVectorTags() const override;
381
382 virtual void needFV() override;
383 virtual bool haveFV() const override;
384
385 virtual bool hasNonlocalCoupling() const override;
386 virtual bool checkNonlocalCouplingRequirement() const override;
387 virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override;
388
389#ifndef NDEBUG
390 virtual bool checkResidualForNans() const override { return _mproblem.checkResidualForNans(); }
391#endif
392
393protected:
396 EquationSystems _eq;
399 std::vector<std::string> _displacements;
400
401 std::vector<std::unique_ptr<DisplacedSystem>> _displaced_solver_systems;
402 std::unique_ptr<DisplacedSystem> _displaced_aux;
403
405 std::vector<const NumericVector<Number> *> _nl_solution;
406
408 const NumericVector<Number> * _aux_solution;
409
410 std::vector<std::vector<std::unique_ptr<Assembly>>> _assembly;
411
413
414 class UpdateDisplacedMeshThread : public ThreadedNodeLoop<NodeRange, NodeRange::const_iterator>
415 {
416 public:
418
420
421 virtual void onNode(NodeRange::const_iterator & nd) override;
422
424 {
425 if (y._has_displacement)
426 _has_displacement = true;
427 }
428
433 {
434 mooseAssert(!Threads::in_threads,
435 "This function requires a MPI all-gathering operation that cannot be in a "
436 "threaded scope.");
438 return _has_displacement;
439 }
440
441 protected:
442 void init();
443
449 const std::vector<const NumericVector<Number> *> & _nl_soln;
451 const NumericVector<Number> & _aux_soln;
452
453 // Solution vectors with expanded ghosting, for ReplicatedMesh or
454 // for DistributedMesh cases where the standard algebraic ghosting
455 // doesn't reach as far as the geometric ghosting
456 std::map<unsigned int,
457 std::pair<const NumericVector<Number> *, std::shared_ptr<NumericVector<Number>>>>
459
460 private:
462 std::map<unsigned int, std::pair<std::vector<unsigned int>, std::vector<unsigned int>>>
464
468 };
469
470private:
471 virtual std::pair<bool, unsigned int>
472 determineSolverSystem(const std::string & var_name,
473 bool error_if_not_found = false) const override;
474
476 friend class Restartable;
477};
478
479inline DisplacedSystem &
480DisplacedProblem::solverSys(const unsigned int sys_num)
481{
482 mooseAssert(sys_num < _displaced_solver_systems.size(),
483 "System number greater than the number of nonlinear systems");
484 return *_displaced_solver_systems[sys_num];
485}
486
487inline const SystemBase &
488DisplacedProblem::systemBaseNonlinear(const unsigned int sys_num) const
489{
490 mooseAssert(sys_num < _displaced_solver_systems.size(),
491 "System number greater than the number of nonlinear systems");
492 return *_displaced_solver_systems[sys_num];
493}
494
495inline SystemBase &
496DisplacedProblem::systemBaseNonlinear(const unsigned int sys_num)
497{
498 mooseAssert(sys_num < _displaced_solver_systems.size(),
499 "System number greater than the number of nonlinear systems");
500 return *_displaced_solver_systems[sys_num];
501}
502
503inline const SystemBase &
504DisplacedProblem::systemBaseLinear(const unsigned int /*sys_num*/) const
505{
506 mooseError("Linear systems are not supported for displaced problems yet.");
507}
508
509inline SystemBase &
510DisplacedProblem::systemBaseLinear(const unsigned int /*sys_num*/)
511{
512 mooseError("Linear systems are not supported for displaced problems yet.");
513}
514
515inline const SystemBase &
516DisplacedProblem::systemBaseSolver(const unsigned int sys_num) const
517{
518 mooseAssert(sys_num < _displaced_solver_systems.size(),
519 "System number greater than the number of solver systems");
520 return *_displaced_solver_systems[sys_num];
521}
522
523inline SystemBase &
524DisplacedProblem::systemBaseSolver(const unsigned int sys_num)
525{
526 mooseAssert(sys_num < _displaced_solver_systems.size(),
527 "System number greater than the number of solver systems");
528 return *_displaced_solver_systems[sys_num];
529}
boundary_id_type BoundaryID
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
unsigned int TagID
Definition MooseTypes.h:238
unsigned int THREAD_ID
Definition MooseTypes.h:237
std::shared_ptr< DisplacedProblem > displaced_problem
void ErrorVector unsigned int
Keeps track of stuff related to assembling.
Definition Assembly.h:110
std::map< unsigned int, std::pair< const NumericVector< Number > *, std::shared_ptr< NumericVector< Number > > > > _sys_to_nonghost_and_ghost_soln
std::map< unsigned int, std::pair< std::vector< unsigned int >, std::vector< unsigned int > > > _sys_to_var_num_and_direction
To locate the system numbers, variable numbers of all displacement variables.
bool _has_displacement
A flag to be set by operator() for indicating whether the displaced mesh is indeed modified.
const NumericVector< Number > & _aux_soln
Solution vector of the auxliary system on the displaced problem.
void join(const UpdateDisplacedMeshThread &y)
DisplacedProblem & _displaced_problem
Diplaced problem.
virtual void onNode(NodeRange::const_iterator &nd) override
bool hasDisplacement()
Whether the displaced mesh is modified by the latest call to operator()
const std::vector< const NumericVector< Number > * > & _nl_soln
Solution vectors of the nonlinear systems on the displaced problem.
virtual void addJacobianLowerD(const THREAD_ID tid) override
MooseMesh & refMesh()
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.
DisplacedSystem & auxSys()
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 GeometricSearchData & geomSearchData() override
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 &parameters)
virtual const MooseMesh & mesh() const override
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
virtual void updateMesh(const std::map< unsigned int, const NumericVector< Number > * > &nl_soln, const NumericVector< Number > &aux_soln)
Synchronize the solutions on the displaced systems to the given solutions and reinitialize the geomet...
EquationSystems _eq
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 const SystemBase & systemBaseLinear(const unsigned int sys_num) const override
Return the linear system object as a base class reference given the system number.
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 addJacobianNeighbor(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices, const std::set< TagID > &tags, const THREAD_ID tid) override
virtual void prepareAssemblyNeighbor(const THREAD_ID tid)
DisplacedProblem & operator=(DisplacedProblem &&)=delete
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 &parameters, 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 bool haveDisplaced() const override final
Whether we have a displaced problem in our simulation.
virtual MooseMesh & mesh() override
virtual void onTimestepBegin() override
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override
Return the nonlinear system object as a base class reference given the system number.
virtual bool safeAccessTaggedMatrices() const override
Is it safe to access the tagged matrices.
void addTimeIntegrator()
Get the time integrators from the problem.
const MooseMesh & mesh(bool libmesh_dbg_var(use_displaced)) const override
std::unique_ptr< DisplacedSystem > _displaced_aux
virtual std::size_t numSolverSystems() const override
const std::vector< std::string > & getDisplacementVarNames() const
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 const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
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.
DisplacedSystem & solverSys(const unsigned int sys_num)
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.
Definition SubProblem.h:779
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 const SystemBase & systemBaseSolver(const unsigned int sys_num) const override
Return the solver system object as a base class reference given the system number.
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 SystemBase & systemBaseAuxiliary() 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.
virtual bool checkResidualForNans() const override
Whether to check residual for NaN/Inf values.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual bool checkResidualForNans() const override
Whether to check residual for NaN/Inf values.
GeometricSearchType
Used to select groups of geometric search objects to update.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
Class for containing MooseEnum item information.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
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).
A class for creating restricted objects.
Definition Restartable.h:29
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
Base class for a system (of equations)
Definition SystemBase.h:87
void max(const T &r, T &o, Request &req) const
Storage for all of the information pretaining to a vector tag.
Definition VectorTag.h:18
const Parallel::Communicator & comm() const
@ VAR_FIELD_ANY
Definition MooseTypes.h:781
@ VECTOR_TAG_ANY
@ VECTOR_TAG_RESIDUAL
VarKindType
Framework-wide stuff.
Definition MooseTypes.h:769
@ VAR_ANY
Definition MooseTypes.h:772
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...