GRINS-0.7.0
displacement_fe_variables.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 // This class
27 
28 // libMesh
29 #include "libmesh/getpot.h"
30 #include "libmesh/fem_system.h"
31 
32 namespace GRINS
33 {
34 
36  const std::string& physics_name,
37  bool is_2D, bool is_3D,
38  bool is_constraint_var )
39  : MultiVarSingleFETypeVariable(input,physics_name,"",this->old_var_names(),this->default_names(),
40  this->subsection(),"LAGRANGE","FIRST",is_constraint_var),
41  _have_v(false),
42  _have_w(false),
43  _u_idx(0),
44  _v_idx(1),
45  _w_idx(2),
46  _is_2D(is_2D),
47  _is_3D(is_3D)
48  {}
49 
50  void DisplacementFEVariables::init( libMesh::FEMSystem* system )
51  {
52  unsigned int mesh_dim = system->get_mesh().mesh_dimension();
53 
54  // The order matters here. We *must* do w first since we use pop_back().
55  if ( mesh_dim == 3 || _is_3D )
56  _have_w = true;
57  else
58  _var_names.pop_back();
59 
60  if ( mesh_dim >= 2 || _is_2D || _is_3D)
61  _have_v = true;
62  else
63  _var_names.pop_back();
64 
66  }
67 
68 } // end namespace GRINS
virtual void init(libMesh::FEMSystem *system)
Add variables to the system.
Base class for variables with multiple components that all have the same FEType.
bool _is_2D
Tracks whether this is a 2D problem.
GRINS namespace.
bool _is_3D
Tracks whether this is a 3D problem.
virtual void init(libMesh::FEMSystem *system)
Initialize System variables.
std::vector< std::string > _var_names

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10