GRINS-0.8.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GRINS::ElasticMembraneConstantPressure Class Reference

#include <elastic_membrane_constant_pressure.h>

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

Public Member Functions

 ElasticMembraneConstantPressure (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~ElasticMembraneConstantPressure ()
 
virtual void element_time_derivative (bool compute_jacobian, AssemblyContext &context)
 Time dependent part(s) of physics for element interiors. More...
 
void reset_pressure (libMesh::Real pressure_in)
 
- Public Member Functions inherited from GRINS::ElasticMembraneAbstract
 ElasticMembraneAbstract (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~ElasticMembraneAbstract ()
 
virtual void init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
- Public Member Functions inherited from GRINS::SolidMechanicsAbstract
 SolidMechanicsAbstract (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~SolidMechanicsAbstract ()
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Set which variables are time evolving. More...
 
- Public Member Functions inherited from GRINS::Physics
 Physics (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~Physics ()
 
virtual void init_variables (libMesh::FEMSystem *)
 Initialize variables for this physics. More...
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void preassembly (MultiphysicsSystem &)
 Perform any necessary setup before element assembly begins. More...
 
virtual void reinit (MultiphysicsSystem &)
 Any reinitialization that needs to be done. More...
 
virtual void side_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void element_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for element interiors. More...
 
virtual void side_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void damping_residual (bool, AssemblyContext &)
 Damping matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void nonlocal_mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for scalar variables. More...
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
virtual void compute_element_time_derivative_cache (AssemblyContext &)
 
virtual void compute_side_time_derivative_cache (AssemblyContext &)
 
virtual void compute_nonlocal_time_derivative_cache (AssemblyContext &)
 
virtual void compute_element_constraint_cache (AssemblyContext &)
 
virtual void compute_side_constraint_cache (AssemblyContext &)
 
virtual void compute_nonlocal_constraint_cache (AssemblyContext &)
 
virtual void compute_damping_residual_cache (AssemblyContext &)
 
virtual void compute_mass_residual_cache (AssemblyContext &)
 
virtual void compute_nonlocal_mass_residual_cache (AssemblyContext &)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
ICHandlingBaseget_ic_handler ()
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Private Member Functions

 ElasticMembraneConstantPressure ()
 

Private Attributes

libMesh::Real _pressure
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::Physics
static void set_is_axisymmetric (bool is_axisymmetric)
 Set whether we should treat the problem as axisymmetric. More...
 
static bool is_axisymmetric ()
 
- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 
- Protected Types inherited from GRINS::SolidMechanicsAbstract
typedef const libMesh::DenseSubVector< libMesh::Number > &(libMesh::DiffContext::* VarFuncType) (unsigned int) const
 
typedef void(libMesh::FEMContext::* InteriorFuncType) (unsigned int, unsigned int, libMesh::Real &) const
 
typedef libMesh::Real(libMesh::DiffContext::* VarDerivType) () const
 
- Protected Member Functions inherited from GRINS::ElasticMembraneAbstract
const libMesh::FEGenericBase< libMesh::Real > * get_fe (const AssemblyContext &context)
 
- Protected Member Functions inherited from GRINS::Physics
libMesh::UniquePtr< libMesh::FEGenericBase< libMesh::Real > > build_new_fe (const libMesh::Elem *elem, const libMesh::FEGenericBase< libMesh::Real > *fe, const libMesh::Point p)
 
void parse_enabled_subdomains (const GetPot &input, const std::string &physics_name)
 
void check_var_subdomain_consistency (const FEVariablesBase &var) const
 Check that var is enabled on at least the subdomains this Physics is. More...
 
- Protected Attributes inherited from GRINS::SolidMechanicsAbstract
DisplacementVariable_disp_vars
 
- Protected Attributes inherited from GRINS::Physics
const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 
- Static Protected Attributes inherited from GRINS::Physics
static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 
static bool _is_axisymmetric = false
 Caches whether we are solving an axisymmetric problem or not. More...
 

Detailed Description

Definition at line 33 of file elastic_membrane_constant_pressure.h.

Constructor & Destructor Documentation

GRINS::ElasticMembraneConstantPressure::ElasticMembraneConstantPressure ( const GRINS::PhysicsName physics_name,
const GetPot &  input 
)

Definition at line 40 of file elastic_membrane_constant_pressure.C.

References GRINS::SolidMechanicsAbstract::_disp_vars, _pressure, GRINS::MultcomponentVectorVariable::dim(), GRINS::PhysicsNaming::elastic_membrane(), GRINS::PhysicsNaming::elastic_membrane_constant_pressure(), GRINS::Physics::parse_enabled_subdomains(), and GRINS::ParameterUser::set_parameter().

41  : ElasticMembraneAbstract(physics_name,input),
42  _pressure(0.0)
43  {
44  if( !input.have_variable("Physics/"+physics_name+"/pressure") )
45  {
46  std::cerr << "Error: Must input pressure for "+physics_name+"." << std::endl
47  << " Please set Physics/"+physics_name+"/pressure." << std::endl;
48  libmesh_error();
49  }
50 
51  this->set_parameter
52  (_pressure, input, "Physics/"+physics_name+"/pressure", _pressure );
53 
54  // If the user specified enabled subdomains in this Physics section,
55  // that's an error; we're slave to ElasticMembrane.
56  if( input.have_variable("Physics/"+PhysicsNaming::elastic_membrane_constant_pressure()+"/enabled_subdomains" ) )
57  libmesh_error_msg("ERROR: Cannot specify subdomains for "
59  +"! Must specify subdomains through "
61 
63 
64  if( this->_disp_vars.dim() != 3 )
65  libmesh_error_msg("ERROR: ElasticMembraneConstantPressure only valid for three dimensions! Make sure you have three components in your Displacement type variable.");
66  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
static PhysicsName elastic_membrane_constant_pressure()
static PhysicsName elastic_membrane()
void parse_enabled_subdomains(const GetPot &input, const std::string &physics_name)
Definition: physics.C:65
unsigned int dim() const
Number of components.
virtual GRINS::ElasticMembraneConstantPressure::~ElasticMembraneConstantPressure ( )
inlinevirtual

Definition at line 40 of file elastic_membrane_constant_pressure.h.

40 {};
GRINS::ElasticMembraneConstantPressure::ElasticMembraneConstantPressure ( )
private

Member Function Documentation

void GRINS::ElasticMembraneConstantPressure::element_time_derivative ( bool  compute_jacobian,
AssemblyContext context 
)
virtual

Time dependent part(s) of physics for element interiors.

Reimplemented from GRINS::Physics.

Definition at line 69 of file elastic_membrane_constant_pressure.C.

71  {
72  const unsigned int n_u_dofs = context.get_dof_indices(_disp_vars.u()).size();
73 
74  const std::vector<libMesh::Real> &JxW =
75  this->get_fe(context)->get_JxW();
76 
77  const std::vector<std::vector<libMesh::Real> >& u_phi =
78  this->get_fe(context)->get_phi();
79 
80  libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(_disp_vars.u());
81  libMesh::DenseSubVector<libMesh::Number> &Fv = context.get_elem_residual(_disp_vars.v());
82  libMesh::DenseSubVector<libMesh::Number> &Fw = context.get_elem_residual(_disp_vars.w());
83 
84  libMesh::DenseSubMatrix<libMesh::Number>& Kuv = context.get_elem_jacobian(_disp_vars.u(),_disp_vars.v());
85  libMesh::DenseSubMatrix<libMesh::Number>& Kuw = context.get_elem_jacobian(_disp_vars.u(),_disp_vars.w());
86 
87  libMesh::DenseSubMatrix<libMesh::Number>& Kvu = context.get_elem_jacobian(_disp_vars.v(),_disp_vars.u());
88  libMesh::DenseSubMatrix<libMesh::Number>& Kvw = context.get_elem_jacobian(_disp_vars.v(),_disp_vars.w());
89 
90  libMesh::DenseSubMatrix<libMesh::Number>& Kwu = context.get_elem_jacobian(_disp_vars.w(),_disp_vars.u());
91  libMesh::DenseSubMatrix<libMesh::Number>& Kwv = context.get_elem_jacobian(_disp_vars.w(),_disp_vars.v());
92 
93  unsigned int n_qpoints = context.get_element_qrule().n_points();
94 
95  // All shape function gradients are w.r.t. master element coordinates
96  const std::vector<std::vector<libMesh::Real> >& dphi_dxi =
97  this->get_fe(context)->get_dphidxi();
98 
99  const std::vector<std::vector<libMesh::Real> >& dphi_deta =
100  this->get_fe(context)->get_dphideta();
101 
102  const libMesh::DenseSubVector<libMesh::Number>& u_coeffs = context.get_elem_solution( _disp_vars.u() );
103  const libMesh::DenseSubVector<libMesh::Number>& v_coeffs = context.get_elem_solution( _disp_vars.v() );
104  const libMesh::DenseSubVector<libMesh::Number>& w_coeffs = context.get_elem_solution( _disp_vars.w() );
105 
106  const std::vector<libMesh::RealGradient>& dxdxi = this->get_fe(context)->get_dxyzdxi();
107  const std::vector<libMesh::RealGradient>& dxdeta = this->get_fe(context)->get_dxyzdeta();
108 
109  for (unsigned int qp=0; qp != n_qpoints; qp++)
110  {
111  // sqrt(det(a_cov)), a_cov being the covariant metric tensor of undeformed body
112  libMesh::Real sqrt_a = sqrt( dxdxi[qp]*dxdxi[qp]*dxdeta[qp]*dxdeta[qp]
113  - dxdxi[qp]*dxdeta[qp]*dxdeta[qp]*dxdxi[qp] );
114 
115  // Gradients are w.r.t. master element coordinates
116  libMesh::Gradient grad_u, grad_v, grad_w;
117  for( unsigned int d = 0; d < n_u_dofs; d++ )
118  {
119  libMesh::RealGradient u_gradphi( dphi_dxi[d][qp], dphi_deta[d][qp] );
120  grad_u += u_coeffs(d)*u_gradphi;
121  grad_v += v_coeffs(d)*u_gradphi;
122  grad_w += w_coeffs(d)*u_gradphi;
123  }
124 
125  libMesh::RealGradient dudxi( grad_u(0), grad_v(0), grad_w(0) );
126  libMesh::RealGradient dudeta( grad_u(1), grad_v(1), grad_w(1) );
127 
128  libMesh::RealGradient A_1 = dxdxi[qp] + dudxi;
129  libMesh::RealGradient A_2 = dxdeta[qp] + dudeta;
130 
131  libMesh::RealGradient A_3 = A_1.cross(A_2);
132 
133  /* The formula here is actually
134  P*\sqrt{\frac{A}{a}}*A_3, where A_3 is a unit vector
135  But, |A_3| = \sqrt{A} so the normalizing part kills
136  the \sqrt{A} in the numerator, so we can leave it out
137  and *not* normalize A_3.
138  */
139  libMesh::RealGradient traction = _pressure/sqrt_a*A_3;
140 
141  libMesh::Real jac = JxW[qp];
142 
143  for (unsigned int i=0; i != n_u_dofs; i++)
144  {
145  Fu(i) -= traction(0)*u_phi[i][qp]*jac;
146 
147  Fv(i) -= traction(1)*u_phi[i][qp]*jac;
148 
149  Fw(i) -= traction(2)*u_phi[i][qp]*jac;
150 
151  if( compute_jacobian )
152  {
153  for (unsigned int j=0; j != n_u_dofs; j++)
154  {
155  libMesh::RealGradient u_gradphi( dphi_dxi[j][qp], dphi_deta[j][qp] );
156 
157  const libMesh::Real dt0_dv = _pressure/sqrt_a*(u_gradphi(0)*A_2(2) - A_1(2)*u_gradphi(1));
158  const libMesh::Real dt0_dw = _pressure/sqrt_a*(A_1(1)*u_gradphi(1) - u_gradphi(0)*A_2(1));
159 
160  const libMesh::Real dt1_du = _pressure/sqrt_a*(A_1(2)*u_gradphi(1) - u_gradphi(0)*A_2(2));
161  const libMesh::Real dt1_dw = _pressure/sqrt_a*(u_gradphi(0)*A_2(0) - A_1(0)*u_gradphi(1));
162 
163  const libMesh::Real dt2_du = _pressure/sqrt_a*(u_gradphi(0)*A_2(1) - A_1(1)*u_gradphi(1));
164  const libMesh::Real dt2_dv = _pressure/sqrt_a*(A_1(0)*u_gradphi(1) - u_gradphi(0)*A_2(0));
165 
166  Kuv(i,j) -= dt0_dv*u_phi[i][qp]*jac;
167  Kuw(i,j) -= dt0_dw*u_phi[i][qp]*jac;
168 
169  Kvu(i,j) -= dt1_du*u_phi[i][qp]*jac;
170  Kvw(i,j) -= dt1_dw*u_phi[i][qp]*jac;
171 
172  Kwu(i,j) -= dt2_du*u_phi[i][qp]*jac;
173  Kwv(i,j) -= dt2_dv*u_phi[i][qp]*jac;
174  }
175  }
176  }
177  }
178 
179  return;
180  }
const libMesh::FEGenericBase< libMesh::Real > * get_fe(const AssemblyContext &context)
void GRINS::ElasticMembraneConstantPressure::reset_pressure ( libMesh::Real  pressure_in)

Definition at line 182 of file elastic_membrane_constant_pressure.C.

References _pressure.

183  {
184  _pressure = pressure_in;
185  return;
186  }

Member Data Documentation

libMesh::Real GRINS::ElasticMembraneConstantPressure::_pressure
private

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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1