www.mooseframework.org
AuxiliarySystem.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "AuxiliarySystem.h"
11 #include "FEProblem.h"
12 #include "Factory.h"
13 #include "AuxKernel.h"
14 #include "AuxScalarKernel.h"
15 #include "MaterialData.h"
16 #include "Assembly.h"
17 #include "GeometricSearchData.h"
22 #include "Parser.h"
23 #include "TimeIntegrator.h"
24 #include "Conversion.h"
25 
26 #include "libmesh/quadrature_gauss.h"
27 #include "libmesh/node_range.h"
28 #include "libmesh/numeric_vector.h"
29 
30 // AuxiliarySystem ////////
31 
32 AuxiliarySystem::AuxiliarySystem(FEProblemBase & subproblem, const std::string & name)
33  : SystemBase(subproblem, name, Moose::VAR_AUXILIARY),
34  PerfGraphInterface(subproblem.getMooseApp().perfGraph(), "AuxiliarySystem"),
35  _fe_problem(subproblem),
36  _sys(subproblem.es().add_system<TransientExplicitSystem>(name)),
37  _current_solution(NULL),
38  _serialized_solution(*NumericVector<Number>::build(_fe_problem.comm()).release()),
39  _solution_previous_nl(NULL),
40  _u_dot(NULL),
41  _u_dotdot(NULL),
42  _u_dot_old(NULL),
43  _u_dotdot_old(NULL),
44  _need_serialized_solution(false),
45  _aux_scalar_storage(_app.getExecuteOnEnum()),
46  _nodal_aux_storage(_app.getExecuteOnEnum()),
47  _elemental_aux_storage(_app.getExecuteOnEnum()),
48  _nodal_vec_aux_storage(_app.getExecuteOnEnum()),
49  _elemental_vec_aux_storage(_app.getExecuteOnEnum()),
50  _compute_scalar_vars_timer(registerTimedSection("computeScalarVars", 1)),
51  _compute_nodal_vars_timer(registerTimedSection("computeNodalVars", 1)),
52  _compute_nodal_vec_vars_timer(registerTimedSection("computeNodalVecVars", 1)),
53  _compute_elemental_vars_timer(registerTimedSection("computeElementalVars", 1)),
54  _compute_elemental_vec_vars_timer(registerTimedSection("computeElementalVecVars", 1))
55 {
56  _nodal_vars.resize(libMesh::n_threads());
57  _nodal_std_vars.resize(libMesh::n_threads());
58  _nodal_vec_vars.resize(libMesh::n_threads());
59  _elem_vars.resize(libMesh::n_threads());
60  _elem_std_vars.resize(libMesh::n_threads());
61  _elem_vec_vars.resize(libMesh::n_threads());
62 }
63 
65 
66 void
68 {
69 }
70 
71 void
73 {
75  _u_dot = &addVector("u_dot", true, GHOSTED);
77  _u_dotdot = &addVector("u_dotdot", true, GHOSTED);
79  _u_dot_old = &addVector("u_dot_old", true, GHOSTED);
81  _u_dotdot_old = &addVector("u_dotdot_old", true, GHOSTED);
82 }
83 
84 void
86 {
88  _solution_previous_nl = &addVector("u_previous_newton", true, GHOSTED);
89 }
90 
91 void
93 {
94  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
95  {
98 
99  _nodal_aux_storage.sort(tid);
100  _nodal_aux_storage.initialSetup(tid);
101 
102  _nodal_vec_aux_storage.sort(tid);
103  _nodal_vec_aux_storage.initialSetup(tid);
104 
105  _elemental_aux_storage.sort(tid);
106  _elemental_aux_storage.initialSetup(tid);
107 
108  _elemental_vec_aux_storage.sort(tid);
109  _elemental_vec_aux_storage.initialSetup(tid);
110  }
111 }
112 
113 void
115 {
116  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
117  {
119  _nodal_aux_storage.timestepSetup(tid);
120  _nodal_vec_aux_storage.timestepSetup(tid);
121  _elemental_aux_storage.timestepSetup(tid);
122  _elemental_vec_aux_storage.timestepSetup(tid);
123  }
124 }
125 
126 void
128 {
129  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
130  {
132  _nodal_aux_storage.subdomainSetup(tid);
133  _nodal_vec_aux_storage.subdomainSetup(tid);
134  _elemental_aux_storage.subdomainSetup(tid);
135  _elemental_vec_aux_storage.subdomainSetup(tid);
136  }
137 }
138 
139 void
141 {
142  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
143  {
145  _nodal_aux_storage.jacobianSetup(tid);
146  _nodal_vec_aux_storage.jacobianSetup(tid);
147  _elemental_aux_storage.jacobianSetup(tid);
148  _elemental_vec_aux_storage.jacobianSetup(tid);
149  }
150 }
151 
152 void
154 {
155  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
156  {
158  _nodal_aux_storage.residualSetup(tid);
159  _nodal_vec_aux_storage.residualSetup(tid);
160  _elemental_aux_storage.residualSetup(tid);
161  _elemental_vec_aux_storage.residualSetup(tid);
162  }
163 }
164 
165 void
167 {
169  _nodal_aux_storage.updateActive(tid);
170  _nodal_vec_aux_storage.updateActive(tid);
171  _elemental_aux_storage.updateActive(tid);
172  _elemental_vec_aux_storage.updateActive(tid);
173 }
174 
175 void
176 AuxiliarySystem::addVariable(const std::string & var_name,
177  const FEType & type,
178  Real scale_factor,
179  const std::set<SubdomainID> * const active_subdomains /* = NULL*/)
180 {
181  SystemBase::addVariable(var_name, type, scale_factor, active_subdomains);
182  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
183  {
184  if (type.family == LAGRANGE_VEC)
185  {
186  VectorMooseVariable * var = _vars[tid].getFieldVariable<RealVectorValue>(var_name);
187  if (var)
188  {
189  _nodal_vars[tid].push_back(var);
190  _nodal_vec_vars[tid].push_back(var);
191  }
192  }
193 
194  else
195  {
196  MooseVariable * var = _vars[tid].getFieldVariable<Real>(var_name);
197 
198  if (var)
199  {
200  if (var->feType().family == LAGRANGE)
201  {
202  _nodal_vars[tid].push_back(var);
203  _nodal_std_vars[tid].push_back(var);
204  }
205  else
206  {
207  _elem_vars[tid].push_back(var);
208  _elem_std_vars[tid].push_back(var);
209  }
210  }
211  }
212  }
213 }
214 
215 void
217  const std::string & name,
218  InputParameters parameters)
219 {
220  parameters.set<SystemBase *>("_sys") = this;
222 }
223 
224 void
225 AuxiliarySystem::addKernel(const std::string & kernel_name,
226  const std::string & name,
227  InputParameters parameters)
228 {
229  parameters.set<AuxiliarySystem *>("_aux_sys") = this;
230 
231  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
232  {
233  if (parameters.get<std::string>("_moose_base") == "AuxKernel")
234  {
235  std::shared_ptr<AuxKernel> kernel =
236  _factory.create<AuxKernel>(kernel_name, name, parameters, tid);
237  if (kernel->isNodal())
238  _nodal_aux_storage.addObject(kernel, tid);
239  else
240  _elemental_aux_storage.addObject(kernel, tid);
241  }
242 
243  else if (parameters.get<std::string>("_moose_base") == "VectorAuxKernel")
244  {
245  std::shared_ptr<VectorAuxKernel> kernel =
246  _factory.create<VectorAuxKernel>(kernel_name, name, parameters, tid);
247  if (kernel->isNodal())
248  _nodal_vec_aux_storage.addObject(kernel, tid);
249  else
250  _elemental_vec_aux_storage.addObject(kernel, tid);
251  }
252  }
253 }
254 
255 void
256 AuxiliarySystem::addScalarKernel(const std::string & kernel_name,
257  const std::string & name,
258  InputParameters parameters)
259 {
260  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
261  {
262  std::shared_ptr<AuxScalarKernel> kernel =
263  _factory.create<AuxScalarKernel>(kernel_name, name, parameters, tid);
264  _aux_scalar_storage.addObject(kernel, tid);
265  }
266 }
267 
268 void
269 AuxiliarySystem::reinitElem(const Elem * /*elem*/, THREAD_ID tid)
270 {
271  for (auto * var : _nodal_vars[tid])
272  var->computeElemValues();
273 
274  for (auto * var : _elem_vars[tid])
275  {
276  var->reinitAux();
277  var->computeElemValues();
278  }
279 }
280 
281 void
282 AuxiliarySystem::reinitElemFace(const Elem * /*elem*/,
283  unsigned int /*side*/,
284  BoundaryID /*bnd_id*/,
285  THREAD_ID tid)
286 {
287  for (auto * var : _nodal_vars[tid])
288  var->computeElemValuesFace();
289 
290  for (auto * var : _elem_vars[tid])
291  {
292  var->reinitAux();
293  var->reinitAuxNeighbor();
294  var->computeElemValuesFace();
295  }
296 }
297 
298 NumericVector<Number> &
300 {
302  return _serialized_solution;
303 }
304 
305 void
307 {
309  _sys.n_dofs() > 0) // libMesh does not like serializing of empty vectors
310  {
311  if (!_serialized_solution.initialized() || _serialized_solution.size() != _sys.n_dofs())
312  {
313  _serialized_solution.clear();
314  _serialized_solution.init(_sys.n_dofs(), false, SERIAL);
315  }
316 
317  solution().localize(_serialized_solution);
318  }
319 }
320 
321 void
323 {
324  // avoid division by dt which might be zero.
325  if (_fe_problem.dt() > 0. && _time_integrator)
326  _time_integrator->preStep();
327 
328  // We need to compute time derivatives every time each kind of the variables is finished, because:
329  //
330  // a) the user might want to use the aux variable value somewhere, thus we need to provide the
331  // up-to-date value
332  // b) time integration system works with the whole vectors of solutions, thus we cannot update
333  // only a part of the vector
334  //
335 
336  if (_vars[0].scalars().size() > 0)
337  {
339  // compute time derivatives of scalar aux variables _after_ the values were updated
340  if (_fe_problem.dt() > 0. && _time_integrator)
341  _time_integrator->computeTimeDerivatives();
342  }
343 
344  if (_vars[0].fieldVariables().size() > 0)
345  {
350 
351  // compute time derivatives of nodal aux variables _after_ the values were updated
352  if (_fe_problem.dt() > 0. && _time_integrator)
353  _time_integrator->computeTimeDerivatives();
354  }
355 
358 }
359 
360 std::set<std::string>
362 {
363  std::set<std::string> depend_objects;
364 
365  // Elemental AuxKernels
366  {
367  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
368  _elemental_aux_storage[type].getActiveObjects();
369  for (const auto & aux : auxs)
370  {
371  const std::set<std::string> & uo = aux->getDependObjects();
372  depend_objects.insert(uo.begin(), uo.end());
373  }
374  }
375 
376  // Elemental VectorAuxKernels
377  {
378  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
379  _elemental_vec_aux_storage[type].getActiveObjects();
380  for (const auto & aux : auxs)
381  {
382  const std::set<std::string> & uo = aux->getDependObjects();
383  depend_objects.insert(uo.begin(), uo.end());
384  }
385  }
386 
387  // Nodal AuxKernels
388  {
389  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
390  _nodal_aux_storage[type].getActiveObjects();
391  for (const auto & aux : auxs)
392  {
393  const std::set<std::string> & uo = aux->getDependObjects();
394  depend_objects.insert(uo.begin(), uo.end());
395  }
396  }
397 
398  // Nodal VectorAuxKernels
399  {
400  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
401  _nodal_vec_aux_storage[type].getActiveObjects();
402  for (const auto & aux : auxs)
403  {
404  const std::set<std::string> & uo = aux->getDependObjects();
405  depend_objects.insert(uo.begin(), uo.end());
406  }
407  }
408 
409  return depend_objects;
410 }
411 
412 std::set<std::string>
414 {
415  std::set<std::string> depend_objects;
416 
417  // Elemental AuxKernels
418  {
419  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
420  _elemental_aux_storage.getActiveObjects();
421  for (const auto & aux : auxs)
422  {
423  const std::set<std::string> & uo = aux->getDependObjects();
424  depend_objects.insert(uo.begin(), uo.end());
425  }
426  }
427 
428  // Elemental VectorAuxKernels
429  {
430  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
431  _elemental_vec_aux_storage.getActiveObjects();
432  for (const auto & aux : auxs)
433  {
434  const std::set<std::string> & uo = aux->getDependObjects();
435  depend_objects.insert(uo.begin(), uo.end());
436  }
437  }
438 
439  // Nodal AuxKernels
440  {
441  const std::vector<std::shared_ptr<AuxKernel>> & auxs = _nodal_aux_storage.getActiveObjects();
442  for (const auto & aux : auxs)
443  {
444  const std::set<std::string> & uo = aux->getDependObjects();
445  depend_objects.insert(uo.begin(), uo.end());
446  }
447  }
448 
449  // Nodal VectorAuxKernels
450  {
451  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
452  _nodal_vec_aux_storage.getActiveObjects();
453  for (const auto & aux : auxs)
454  {
455  const std::set<std::string> & uo = aux->getDependObjects();
456  depend_objects.insert(uo.begin(), uo.end());
457  }
458  }
459 
460  return depend_objects;
461 }
462 
463 NumericVector<Number> &
464 AuxiliarySystem::addVector(const std::string & vector_name,
465  const bool project,
466  const ParallelType type)
467 {
468  if (hasVector(vector_name))
469  return getVector(vector_name);
470 
471  NumericVector<Number> * vec = &_sys.add_vector(vector_name, project, type);
472 
473  return *vec;
474 }
475 
476 void
478 {
480  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects = storage.getActiveObjects(0);
481 
482  std::set<TagID> needed_sc_var_matrix_tags;
483  std::set<TagID> needed_sc_var_vector_tags;
484  for (const auto & obj : objects)
485  {
486  auto & sc_var_coup_vtags = obj->getScalarVariableCoupleableVectorTags();
487  needed_sc_var_vector_tags.insert(sc_var_coup_vtags.begin(), sc_var_coup_vtags.end());
488 
489  auto & sc_var_coup_mtags = obj->getScalarVariableCoupleableMatrixTags();
490  needed_sc_var_matrix_tags.insert(sc_var_coup_mtags.begin(), sc_var_coup_mtags.end());
491  }
492 
493  _fe_problem.setActiveScalarVariableCoupleableMatrixTags(needed_sc_var_matrix_tags, 0);
494  _fe_problem.setActiveScalarVariableCoupleableVectorTags(needed_sc_var_vector_tags, 0);
495 }
496 
497 void
499 {
502 }
503 
504 void
506 {
508 
509  // Reference to the current storage container
511 
512  if (storage.hasActiveObjects())
513  {
514  TIME_SECTION(_compute_scalar_vars_timer);
515 
516  PARALLEL_TRY
517  {
518  // FIXME: run multi-threaded
519  THREAD_ID tid = 0;
520  if (storage.hasActiveObjects())
521  {
523 
524  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects =
525  storage.getActiveObjects(tid);
526 
527  // Call compute() method on all active AuxScalarKernel objects
528  for (const auto & obj : objects)
529  obj->compute();
530 
531  const std::vector<MooseVariableScalar *> & scalar_vars = getScalarVariables(tid);
532  for (const auto & var : scalar_vars)
533  var->insert(solution());
534  }
535  }
536  PARALLEL_CATCH;
537 
538  solution().close();
539  _sys.update();
540  }
541 
543 }
544 
545 void
547 {
549  computeNodalVarsHelper<AuxKernel>(nodal, _nodal_std_vars, _compute_nodal_vars_timer);
550 }
551 
552 void
554 {
556  computeNodalVarsHelper<VectorAuxKernel>(nodal, _nodal_vec_vars, _compute_nodal_vec_vars_timer);
557 }
558 
559 void
561 {
563  computeElementalVarsHelper<AuxKernel>(elemental, _elem_std_vars, _compute_elemental_vars_timer);
564 }
565 
566 void
568 {
570  computeElementalVarsHelper<VectorAuxKernel>(
572 }
573 
574 void
575 AuxiliarySystem::augmentSparsity(SparsityPattern::Graph & /*sparsity*/,
576  std::vector<dof_id_type> & /*n_nz*/,
577  std::vector<dof_id_type> & /*n_oz*/)
578 {
579 }
580 
581 Order
583 {
584  Order order = CONSTANT;
585  std::vector<MooseVariableFEBase *> vars = _vars[0].fieldVariables();
586  for (const auto & var : vars)
587  {
588  if (!var->isNodal()) // nodal aux variables do not need quadrature
589  {
590  FEType fe_type = var->feType();
591  if (fe_type.default_quadrature_order() > order)
592  order = fe_type.default_quadrature_order();
593  }
594  }
595 
596  return order;
597 }
598 
599 bool
601 {
602  return _elemental_aux_storage.hasActiveBoundaryObjects(bnd_id) ||
603  _elemental_vec_aux_storage.hasActiveBoundaryObjects(bnd_id);
604 }
605 
606 void
608 {
609  // Evaluate aux variables to get the solution vector
611 }
612 
613 template <typename AuxKernelType>
614 void
616  const MooseObjectWarehouse<AuxKernelType> & warehouse,
617  const std::vector<std::vector<MooseVariableFEBase *>> & vars,
618  const PerfID timer)
619 {
620  if (warehouse.hasActiveBlockObjects())
621  {
622  TIME_SECTION(timer);
623 
624  // Block Elemental AuxKernels
625  PARALLEL_TRY
626  {
627  ConstElemRange & range = *_mesh.getActiveLocalElementRange();
628  ComputeElemAuxVarsThread<AuxKernelType> eavt(_fe_problem, warehouse, vars, true);
629  Threads::parallel_reduce(range, eavt);
630 
631  solution().close();
632  _sys.update();
633  }
634  PARALLEL_CATCH;
635  }
636 
637  // Boundary Elemental AuxKernels
638  if (warehouse.hasActiveBoundaryObjects())
639  {
640  TIME_SECTION(_compute_elemental_vec_vars_timer);
641 
642  PARALLEL_TRY
643  {
645  ComputeElemAuxBcsThread<AuxKernelType> eabt(_fe_problem, warehouse, vars, true);
646  Threads::parallel_reduce(bnd_elems, eabt);
647 
648  solution().close();
649  _sys.update();
650  }
651  PARALLEL_CATCH;
652  }
653 }
654 
655 template <typename AuxKernelType>
656 void
658  const MooseObjectWarehouse<AuxKernelType> & warehouse,
659  const std::vector<std::vector<MooseVariableFEBase *>> & vars,
660  const PerfID timer)
661 {
662  if (warehouse.hasActiveBlockObjects())
663  {
664  TIME_SECTION(timer);
665 
666  // Block Nodal AuxKernels
667  PARALLEL_TRY
668  {
669  ConstNodeRange & range = *_mesh.getLocalNodeRange();
671  Threads::parallel_reduce(range, navt);
672 
673  solution().close();
674  _sys.update();
675  }
676  PARALLEL_CATCH;
677  }
678 
679  if (warehouse.hasActiveBoundaryObjects())
680  {
681  TIME_SECTION(timer);
682 
683  // Boundary Nodal AuxKernels
684  PARALLEL_TRY
685  {
688  Threads::parallel_reduce(bnd_nodes, nabt);
689 
690  solution().close();
691  _sys.update();
692  }
693  PARALLEL_CATCH;
694  }
695 }
696 
697 template void AuxiliarySystem::computeElementalVarsHelper<AuxKernel>(
699  const std::vector<std::vector<MooseVariableFEBase *>> &,
700  const PerfID);
701 template void AuxiliarySystem::computeElementalVarsHelper<VectorAuxKernel>(
703  const std::vector<std::vector<MooseVariableFEBase *>> &,
704  const PerfID);
705 template void AuxiliarySystem::computeNodalVarsHelper<AuxKernel>(
707  const std::vector<std::vector<MooseVariableFEBase *>> &,
708  const PerfID);
709 template void AuxiliarySystem::computeNodalVarsHelper<VectorAuxKernel>(
711  const std::vector<std::vector<MooseVariableFEBase *>> &,
712  const PerfID);
std::vector< std::vector< MooseVariableFEBase * > > _elem_std_vars
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:737
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
NumericVector< Number > & _serialized_solution
Serialized version of the solution vector.
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:614
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void computeScalarVars(ExecFlagType type)
void sort(THREAD_ID tid=0)
Performs a sort using the DependencyResolver.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:701
std::vector< std::vector< MooseVariableFEBase * > > _elem_vec_vars
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored...
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot
Class for stuff related to variables.
Definition: Adaptivity.h:29
virtual void augmentSparsity(SparsityPattern::Graph &, std::vector< dof_id_type > &, std::vector< dof_id_type > &) override
Will modify the sparsity pattern to add logical geometric connections.
VectorValue< Real > RealVectorValue
Definition: Assembly.h:31
virtual void addVariable(const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
Adds a variable to the system.
Definition: SystemBase.C:613
NumericVector< Number > * _u_dot
solution vector for u^dot
virtual bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > ConstBndElemRange
Definition: MooseMesh.h:1259
AuxiliarySystem(FEProblemBase &subproblem, const std::string &name)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void updateActive(THREAD_ID tid)
const PerfID _compute_elemental_vec_vars_timer
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid) override
virtual void clearActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) override
Factory & _factory
Definition: SystemBase.h:738
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void residualSetup(THREAD_ID tid=0) const
Base class for a system (of equations)
Definition: SystemBase.h:92
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual void addExtraVectors() override
Method called during initialSetup to add extra system vector if they are required by the simulation...
bool needMaterialOnSide(BoundaryID bnd_id)
Indicated whether this system needs material properties on boundaries.
virtual void reinitElem(const Elem *elem, THREAD_ID tid) override
Reinit an element assembly info.
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:774
virtual void clearActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void residualSetup()
const FEType & feType() const
Get the type of finite element object.
unsigned int PerfID
Definition: MooseTypes.h:163
void addDotVectors()
Adds u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator...
virtual void timestepSetup()
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const PerfID _compute_nodal_vars_timer
virtual const std::string & name() const
Definition: SystemBase.C:1088
void jacobianSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
const PerfID _compute_nodal_vec_vars_timer
void setScalarVariableCoupleableTags(ExecFlagType type)
void clearScalarVariableCoupleableTags()
std::set< std::string > getDependObjects()
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
void computeElementalVars(ExecFlagType type)
virtual void setPreviousNewtonSolution()
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type) override
Adds a solution length vector to the system.
Base class for making kernels that work on auxiliary scalar variables.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_std_vars
boundary_id_type BoundaryID
virtual void jacobianSetup()
FEProblemBase & _fe_problem
virtual void timestepSetup(THREAD_ID tid=0) const
virtual Order getMinQuadratureOrder() override
Get the minimum quadrature order for evaluating elemental auxiliary variables.
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
NumericVector< Number > & solution() override
TransientSystem< ExplicitSystem > TransientExplicitSystem
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vec_vars
void computeNodalVarsHelper(const MooseObjectWarehouse< AuxKernelType > &warehouse, const std::vector< std::vector< MooseVariableFEBase *>> &vars, const PerfID timer)
void computeElementalVarsHelper(const MooseObjectWarehouse< AuxKernelType > &warehouse, const std::vector< std::vector< MooseVariableFEBase *>> &vars, const PerfID timer)
const ExecFlagType EXEC_LINEAR
const PerfID _compute_elemental_vars_timer
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
TransientExplicitSystem & _sys
Interface for objects that needs transient capabilities.
const PerfID _compute_scalar_vars_timer
Timers.
void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters parameters) override
Add a time integrator.
bool _need_serialized_solution
Whether or not a copy of the residual needs to be made.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
virtual void compute(ExecFlagType type)
Compute auxiliary variables.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:745
MatType type
virtual void reinitScalars(THREAD_ID tid) override
Base class for time integrators.
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
MooseMesh & _mesh
Definition: SystemBase.h:740
bool hasActiveObjects(THREAD_ID tid=0) const
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
MPI_Comm comm
void computeNodalVars(ExecFlagType type)
void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
Adds a scalar kernel.
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override
Reinit assembly info for a side of an element.
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
virtual NumericVector< Number > & serializedSolution() override
Returns a reference to a serialized version of the solution vector for this subproblem.
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:33
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:801
Definition: Moose.h:112
virtual void serializeSolution()
void computeNodalVecVars(ExecFlagType type)
virtual void initialSetup()
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:1258
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.
virtual void addVariable(const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL) override
Adds a variable to the system.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.
virtual void init() override
Initialize the system.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:751
virtual Real & dt() const
NumericVector< Number > * _solution_previous_nl
Solution vector of the previous nonlinear iterate.
virtual ~AuxiliarySystem()
virtual void subdomainSetup(THREAD_ID tid=0) const
A system that holds auxiliary variables.
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:788
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid) override
void computeElementalVecVars(ExecFlagType type)
unsigned int THREAD_ID
Definition: MooseTypes.h:161
void addKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
Adds an auxiliary kernel.
virtual void subdomainSetup()