GRINS-0.7.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GRINS::DisplacementFEVariables Class Reference

#include <displacement_fe_variables.h>

Inheritance diagram for GRINS::DisplacementFEVariables:
Inheritance graph
[legend]
Collaboration diagram for GRINS::DisplacementFEVariables:
Collaboration graph
[legend]

Public Member Functions

 DisplacementFEVariables (const GetPot &input, const std::string &physics_name, bool is_2D, bool is_3D, bool is_constraint_var=false)
 Constructor. More...
 
virtual ~DisplacementFEVariables ()
 
virtual void init (libMesh::FEMSystem *system)
 Initialize System variables. More...
 
bool have_v () const
 
bool have_w () const
 
VariableIndex u () const
 
VariableIndex v () const
 
VariableIndex w () const
 
const std::string & u_name () const
 
const std::string & v_name () const
 
const std::string & w_name () const
 
- Public Member Functions inherited from GRINS::MultiVarSingleFETypeVariable
 MultiVarSingleFETypeVariable (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::vector< std::string > &old_var_names, const std::vector< std::string > &default_names, const std::string &subsection, const std::string &default_family, const std::string &default_order, bool is_constraint_var)
 Deprecated, old style constructor. More...
 
 MultiVarSingleFETypeVariable (const GetPot &input, const std::string &subsection, const std::vector< std::string > &default_names, bool is_constraint_var)
 Primary constructor. More...
 
 ~MultiVarSingleFETypeVariable ()
 
- Public Member Functions inherited from GRINS::SingleFETypeVariable
 SingleFETypeVariable (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::string &subsection, const std::string &default_family, const std::string &default_order, bool is_constraint_var)
 Deprecated, old style constructor. More...
 
 SingleFETypeVariable (const GetPot &input, const std::string &subsection, bool is_constraint_var)
 Primary constructor. More...
 
 ~SingleFETypeVariable ()
 
- Public Member Functions inherited from GRINS::FEVariablesBase
 FEVariablesBase (bool is_constraint_var)
 
 ~FEVariablesBase ()
 
bool is_constraint_var () const
 
void set_neumann_bc_is_positive (bool is_positive)
 Reset whetever Neumann bc is postive or not. More...
 
libMesh::Real neumann_bc_sign () const
 
const std::vector< std::string > & active_var_names () const
 Return the var names that are active from this class. More...
 
const std::vector< VariableIndex > & var_indices () const
 

Private Member Functions

std::string subsection () const
 
std::vector< std::string > old_var_names ()
 
std::vector< std::string > default_names ()
 
 DisplacementFEVariables ()
 

Private Attributes

bool _have_v
 
bool _have_w
 
unsigned int _u_idx
 
unsigned int _v_idx
 
unsigned int _w_idx
 
bool _is_2D
 Tracks whether this is a 2D problem. More...
 
bool _is_3D
 Tracks whether this is a 3D problem. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GRINS::SingleFETypeVariable
void parse_family_and_order (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::string &subsection, std::vector< GRINSEnums::FEFamily > &family, std::vector< GRINSEnums::Order > &order, const std::string &default_family, const std::string &default_order)
 Helper function to parse FEFamily and Order. More...
 
void dup_family_order_check (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix) const
 Check (and error if true) for old and new style FEFamily/Order input. More...
 
bool have_family_or_order (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::string &subsection) const
 Check for no presence of FEFamily/Order input. More...
 
void parse_old_style_with_warning (const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::string &default_family, const std::string &default_order, const std::string &subsection, GRINSEnums::FEFamily &family, GRINSEnums::Order &order)
 
void parse_new_style (const GetPot &input, const std::string &subsection, GRINSEnums::FEFamily &family, GRINSEnums::Order &order)
 
- Protected Member Functions inherited from GRINS::FEVariablesBase
void parse_names_from_input (const GetPot &input, const std::string &subsection, std::vector< std::string > &var_names, const std::vector< std::string > &default_names)
 Method to parse variable names from input. More...
 
void duplicate_name_section_check (const GetPot &input) const
 Check for old name style and new name style. If both present, error. More...
 
bool check_dep_name_input (const GetPot &input, const std::string &new_subsection) const
 Check for deprecated variable name input style. More...
 
- Protected Attributes inherited from GRINS::FEVariablesBase
std::vector< VariableIndex_vars
 
std::vector< std::string > _var_names
 
std::vector< GRINSEnums::FEFamily > _family
 
std::vector< GRINSEnums::Order > _order
 
bool _is_constraint_var
 Tracks whether this is a constraint variable. More...
 
libMesh::Real _neumann_bc_sign
 Track the sign of the Neumann BC term. Defaults to 1.0. More...
 

Detailed Description

Definition at line 35 of file displacement_fe_variables.h.

Constructor & Destructor Documentation

GRINS::DisplacementFEVariables::DisplacementFEVariables ( const GetPot &  input,
const std::string &  physics_name,
bool  is_2D,
bool  is_3D,
bool  is_constraint_var = false 
)

Constructor.

The arguments specify whether the spatial mesh is really 2D or 3D. This is needed for cases such as a 1D beam in 2D (is_2D = true) or 3D (is_3D = true) space or 2D shell manifolds in 3D (is_3D = true).

Definition at line 35 of file displacement_fe_variables.C.

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  {}
std::vector< std::string > old_var_names()
bool _is_2D
Tracks whether this is a 2D problem.
bool _is_3D
Tracks whether this is a 3D problem.
std::vector< std::string > default_names()
MultiVarSingleFETypeVariable(const GetPot &input, const std::string &physics_name, const std::string &old_var_prefix, const std::vector< std::string > &old_var_names, const std::vector< std::string > &default_names, const std::string &subsection, const std::string &default_family, const std::string &default_order, bool is_constraint_var)
Deprecated, old style constructor.
bool is_constraint_var() const
virtual GRINS::DisplacementFEVariables::~DisplacementFEVariables ( )
inlinevirtual

Definition at line 48 of file displacement_fe_variables.h.

48 {};
GRINS::DisplacementFEVariables::DisplacementFEVariables ( )
private

Member Function Documentation

std::vector<std::string> GRINS::DisplacementFEVariables::default_names ( )
inlineprivate

Definition at line 78 of file displacement_fe_variables.h.

79  {
80  std::vector<std::string> var_names(3);
81  var_names[0] = "u";
82  var_names[1] = "v";
83  var_names[2] = "w";
84  return var_names;
85  }
bool GRINS::DisplacementFEVariables::have_v ( ) const
inline

Definition at line 123 of file displacement_fe_variables.h.

References _have_v.

124  {
125  return _have_v;
126  }
bool GRINS::DisplacementFEVariables::have_w ( ) const
inline

Definition at line 129 of file displacement_fe_variables.h.

References _have_w.

130  {
131  return _have_w;
132  }
void GRINS::DisplacementFEVariables::init ( libMesh::FEMSystem *  system)
virtual

Initialize System variables.

Reimplemented from GRINS::SingleFETypeVariable.

Definition at line 50 of file displacement_fe_variables.C.

References _have_v, _have_w, _is_2D, _is_3D, GRINS::FEVariablesBase::_var_names, and GRINS::SingleFETypeVariable::init().

Referenced by GRINS::SolidMechanicsAbstract::init_variables().

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  }
virtual void init(libMesh::FEMSystem *system)
Add variables to the system.
bool _is_2D
Tracks whether this is a 2D problem.
bool _is_3D
Tracks whether this is a 3D problem.
std::vector< std::string > _var_names
std::vector<std::string> GRINS::DisplacementFEVariables::old_var_names ( )
inlineprivate

Definition at line 69 of file displacement_fe_variables.h.

70  {
71  std::vector<std::string> var_names(3);
72  var_names[0] = "u_displacment";
73  var_names[1] = "v_displacment";
74  var_names[2] = "w_displacment";
75  return var_names;
76  }
std::string GRINS::DisplacementFEVariables::subsection ( ) const
inlineprivate
VariableIndex GRINS::DisplacementFEVariables::u ( ) const
inline
const std::string & GRINS::DisplacementFEVariables::u_name ( ) const
inline

Definition at line 135 of file displacement_fe_variables.h.

References _u_idx, and GRINS::FEVariablesBase::_var_names.

136  {
137  return this->_var_names[_u_idx];
138  }
std::vector< std::string > _var_names
VariableIndex GRINS::DisplacementFEVariables::v ( ) const
inline
const std::string & GRINS::DisplacementFEVariables::v_name ( ) const
inline

Definition at line 141 of file displacement_fe_variables.h.

References _v_idx, and GRINS::FEVariablesBase::_var_names.

142  {
143  return this->_var_names[_v_idx];
144  }
std::vector< std::string > _var_names
VariableIndex GRINS::DisplacementFEVariables::w ( ) const
inline
const std::string & GRINS::DisplacementFEVariables::w_name ( ) const
inline

Definition at line 147 of file displacement_fe_variables.h.

References GRINS::FEVariablesBase::_var_names, and _w_idx.

148  {
149  return this->_var_names[_w_idx];
150  }
std::vector< std::string > _var_names

Member Data Documentation

bool GRINS::DisplacementFEVariables::_have_v
private

Definition at line 89 of file displacement_fe_variables.h.

Referenced by have_v(), init(), and v().

bool GRINS::DisplacementFEVariables::_have_w
private

Definition at line 90 of file displacement_fe_variables.h.

Referenced by have_w(), init(), and w().

bool GRINS::DisplacementFEVariables::_is_2D
private

Tracks whether this is a 2D problem.

Definition at line 95 of file displacement_fe_variables.h.

Referenced by init().

bool GRINS::DisplacementFEVariables::_is_3D
private

Tracks whether this is a 3D problem.

Definition at line 98 of file displacement_fe_variables.h.

Referenced by init().

unsigned int GRINS::DisplacementFEVariables::_u_idx
private

Definition at line 92 of file displacement_fe_variables.h.

Referenced by u(), and u_name().

unsigned int GRINS::DisplacementFEVariables::_v_idx
private

Definition at line 92 of file displacement_fe_variables.h.

Referenced by v(), and v_name().

unsigned int GRINS::DisplacementFEVariables::_w_idx
private

Definition at line 92 of file displacement_fe_variables.h.

Referenced by w(), and w_name().


The documentation for this class was generated from the following files:

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