www.mooseframework.org
DisplacedSystem.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 "DisplacedSystem.h"
11 #include "DisplacedProblem.h"
12 
13 #include "libmesh/transient_system.h"
14 #include "libmesh/explicit_system.h"
15 #include "libmesh/default_coupling.h"
16 #include "libmesh/dof_map.h"
17 
19  SystemBase & undisplaced_system,
20  const std::string & name,
21  Moose::VarKindType var_kind)
22  : SystemBase(problem, name, var_kind),
23  _undisplaced_system(undisplaced_system),
24  _sys(problem.es().add_system<TransientExplicitSystem>(name))
25 {
26  if (!problem.defaultGhosting())
27  {
28  auto & dof_map = _sys.get_dof_map();
29  dof_map.remove_algebraic_ghosting_functor(dof_map.default_algebraic_ghosting());
30  dof_map.set_implicit_neighbor_dofs(false);
31  }
32 }
33 
35 
37 DisplacedSystem::getVector(const std::string & name)
38 {
39  if (_sys.have_vector(name))
40  return _sys.get_vector(name);
41  else
43 }
44 
46 DisplacedSystem::getVector(const std::string & name) const
47 {
48  if (_sys.have_vector(name))
49  return _sys.get_vector(name);
50  else
52 }
53 
54 void
55 DisplacedSystem::addTimeIntegrator(std::shared_ptr<TimeIntegrator> ti)
56 {
57  _time_integrator = ti;
58 }
59 
60 System &
62 {
63  return _sys;
64 }
65 
66 const System &
68 {
69  return _sys;
70 }
std::string name(const ElemQuality q)
TransientExplicitSystem & _sys
DisplacedSystem(DisplacedSystem &&)=delete
Base class for a system (of equations)
Definition: SystemBase.h:84
virtual const std::string & name() const
Definition: SystemBase.C:1297
void addTimeIntegrator(std::shared_ptr< TimeIntegrator > ti) override
SystemBase & _undisplaced_system
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:627
TransientSystem< ExplicitSystem > TransientExplicitSystem
virtual System & system() override
Get the reference to the libMesh system.
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:973
virtual ~DisplacedSystem()
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
Definition: SubProblem.h:122
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882
virtual NumericVector< Number > & getVector(TagID tag_id) override
Get a raw NumericVector by tag.