GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GRINS::ElasticCableBase< StressStrainLaw > Class Template Reference

#include <elastic_cable_base.h>

Inheritance diagram for GRINS::ElasticCableBase< StressStrainLaw >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::ElasticCableBase< StressStrainLaw >:
Collaboration graph
[legend]

Public Member Functions

 ElasticCableBase (const GRINS::PhysicsName &physics_name, const GetPot &input, bool is_compressible)
 
virtual ~ElasticCableBase ()
 
- Public Member Functions inherited from GRINS::ElasticCableAbstract
 ElasticCableAbstract (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~ElasticCableAbstract ()
 
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 element_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for element interiors. 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...
 

Protected Member Functions

void mass_residual_impl (bool compute_jacobian, AssemblyContext &context, InteriorFuncType interior_solution, VarDerivType get_solution_deriv, libMesh::Real mu=1.0)
 Implementation of mass_residual. More...
 
void compute_metric_tensors (unsigned int qp, const libMesh::FEBase &elem, const AssemblyContext &context, const libMesh::Gradient &grad_u, const libMesh::Gradient &grad_v, const libMesh::Gradient &grad_w, libMesh::TensorValue< libMesh::Real > &a_cov, libMesh::TensorValue< libMesh::Real > &a_contra, libMesh::TensorValue< libMesh::Real > &A_cov, libMesh::TensorValue< libMesh::Real > &A_contra, libMesh::Real &lambda_sq)
 
- Protected Member Functions inherited from GRINS::ElasticCableAbstract
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

StressStrainLaw _stress_strain_law
 
bool _is_compressible
 
- Protected Attributes inherited from GRINS::ElasticCableAbstract
libMesh::Real _A
 Cross-sectional area of the cable. More...
 
libMesh::Real _rho
 Cable density. 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...
 

Private Member Functions

 ElasticCableBase ()
 

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
 
- 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

template<typename StressStrainLaw>
class GRINS::ElasticCableBase< StressStrainLaw >

Definition at line 34 of file elastic_cable_base.h.

Constructor & Destructor Documentation

template<typename StressStrainLaw >
GRINS::ElasticCableBase< StressStrainLaw >::ElasticCableBase ( const GRINS::PhysicsName physics_name,
const GetPot &  input,
bool  is_compressible 
)

Definition at line 40 of file elastic_cable_base.C.

43  : ElasticCableAbstract(physics_name,input),
45  _is_compressible(is_compressible)
46  {}
static PhysicsName elastic_cable()
StressStrainLaw _stress_strain_law
static std::string material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
template<typename StressStrainLaw >
virtual GRINS::ElasticCableBase< StressStrainLaw >::~ElasticCableBase ( )
inlinevirtual

Definition at line 42 of file elastic_cable_base.h.

42 {};
template<typename StressStrainLaw >
GRINS::ElasticCableBase< StressStrainLaw >::ElasticCableBase ( )
private

Member Function Documentation

template<typename StressStrainLaw >
void GRINS::ElasticCableBase< StressStrainLaw >::compute_metric_tensors ( unsigned int  qp,
const libMesh::FEBase &  elem,
const AssemblyContext context,
const libMesh::Gradient &  grad_u,
const libMesh::Gradient &  grad_v,
const libMesh::Gradient &  grad_w,
libMesh::TensorValue< libMesh::Real > &  a_cov,
libMesh::TensorValue< libMesh::Real > &  a_contra,
libMesh::TensorValue< libMesh::Real > &  A_cov,
libMesh::TensorValue< libMesh::Real > &  A_contra,
libMesh::Real &  lambda_sq 
)
protected

Definition at line 131 of file elastic_cable_base.C.

142  {
143  const std::vector<libMesh::RealGradient>& dxdxi = elem.get_dxyzdxi();
144 
145  const std::vector<libMesh::Real>& dxidx = elem.get_dxidx();
146  const std::vector<libMesh::Real>& dxidy = elem.get_dxidy();
147  const std::vector<libMesh::Real>& dxidz = elem.get_dxidz();
148 
149  libMesh::RealGradient dxi( dxidx[qp], dxidy[qp], dxidz[qp] );
150 
151  libMesh::RealGradient dudxi( grad_u(0), grad_v(0), grad_w(0) );
152 
153  // Covariant metric tensor of reference configuration
154  a_cov.zero();
155  a_cov(0,0) = dxdxi[qp]*dxdxi[qp];
156  a_cov(1,1) = 1.0;
157  a_cov(2,2) = 1.0;
158 
159  // Covariant metric tensor of current configuration
160  A_cov.zero();
161  A_cov(0,0) = (dxdxi[qp] + dudxi)*(dxdxi[qp] + dudxi);
162 
163  // Contravariant metric tensor of reference configuration
164  a_contra.zero();
165  a_contra(0,0) = 1/a_cov(0,0);
166  a_contra(1,1) = 1.0;
167  a_contra(2,2) = 1.0;
168 
169  // Contravariant metric tensor in current configuration is A_cov^{-1}
170  A_contra.zero();
171  A_contra(0,0) = 1/A_cov(0,0);
172 
173  // If the material is compressible, then lambda_sq is an independent variable
174  if( _is_compressible )
175  {
176  libmesh_not_implemented();
177  //lambda_sq = context.interior_value(this->_lambda_sq_var, qp);
178  }
179  else
180  {
181  // If the material is incompressible, lambda^2 is known
182  lambda_sq = a_cov(0,0)/A_cov(0,0);//det_a/det_A;
183  }
184 
185  //Update the covariant and contravariant tensors of current configuration
186  A_cov(1,1) = lambda_sq;
187  A_cov(2,2) = lambda_sq;
188  A_contra(1,1) = 1.0/lambda_sq;
189  A_contra(2,2) = 1.0/lambda_sq;
190  }
template<typename StressStrainLaw >
void GRINS::ElasticCableBase< StressStrainLaw >::mass_residual_impl ( bool  compute_jacobian,
AssemblyContext context,
InteriorFuncType  interior_solution,
VarDerivType  get_solution_deriv,
libMesh::Real  mu = 1.0 
)
protected

Implementation of mass_residual.

The mu argument is needed to support Rayleigh Damping.

Definition at line 49 of file elastic_cable_base.C.

Referenced by GRINS::ElasticCable< StressStrainLaw >::mass_residual().

54  {
55  const unsigned int n_u_dofs = context.get_dof_indices(this->_disp_vars.u()).size();
56 
57  const std::vector<libMesh::Real> &JxW =
58  this->get_fe(context)->get_JxW();
59 
60  const std::vector<std::vector<libMesh::Real> >& u_phi =
61  this->get_fe(context)->get_phi();
62 
63  // Residuals that we're populating
64  libMesh::DenseSubVector<libMesh::Number> & Fu = context.get_elem_residual(this->_disp_vars.u());
65  libMesh::DenseSubVector<libMesh::Number> * Fv = NULL;
66  libMesh::DenseSubVector<libMesh::Number> * Fw = NULL;
67 
68  libMesh::DenseSubMatrix<libMesh::Number> & Kuu = context.get_elem_jacobian(this->_disp_vars.u(),this->_disp_vars.u());
69  libMesh::DenseSubMatrix<libMesh::Number> * Kvv = NULL;
70  libMesh::DenseSubMatrix<libMesh::Number> * Kww = NULL;
71 
72  if( this->_disp_vars.dim() >= 2 )
73  {
74  Fv = &context.get_elem_residual(this->_disp_vars.v());
75  Kvv = &context.get_elem_jacobian(this->_disp_vars.v(),this->_disp_vars.v());
76  }
77 
78  if( this->_disp_vars.dim() == 3 )
79  {
80  Fw = &context.get_elem_residual(this->_disp_vars.w());
81  Kww = &context.get_elem_jacobian(this->_disp_vars.w(),this->_disp_vars.w());
82  }
83 
84  unsigned int n_qpoints = context.get_element_qrule().n_points();
85 
86  for (unsigned int qp=0; qp != n_qpoints; qp++)
87  {
88  libMesh::Real jac = JxW[qp];
89 
90  libMesh::Real u_ddot, v_ddot, w_ddot;
91  (context.*interior_solution)( this->_disp_vars.u(), qp, u_ddot );
92 
93  if( this->_disp_vars.dim() >= 2 )
94  (context.*interior_solution)( this->_disp_vars.v(), qp, v_ddot );
95 
96  if( this->_disp_vars.dim() == 3 )
97  (context.*interior_solution)( this->_disp_vars.w(), qp, w_ddot );
98 
99  for (unsigned int i=0; i != n_u_dofs; i++)
100  {
101  libMesh::Real value = this->_rho*this->_A*u_phi[i][qp]*jac*mu;
102  Fu(i) += value*u_ddot;
103 
104  if( this->_disp_vars.dim() >= 2 )
105  (*Fv)(i) += value*v_ddot;
106 
107  if( this->_disp_vars.dim() == 3 )
108  (*Fw)(i) += value*w_ddot;
109 
110  if( compute_jacobian )
111  {
112  for (unsigned int j=0; j != n_u_dofs; j++)
113  {
114  libMesh::Real jac_term = mu*this->_rho*this->_A*u_phi[i][qp]*u_phi[j][qp]*jac;
115  jac_term *= (context.*get_solution_deriv)();
116 
117  Kuu(i,j) += jac_term;
118 
119  if( this->_disp_vars.dim() >= 2 )
120  (*Kvv)(i,j) += jac_term;
121 
122  if( this->_disp_vars.dim() == 3 )
123  (*Kww)(i,j) += jac_term;
124  }
125  }
126  }
127  }
128  }
libMesh::Real _rho
Cable density.
libMesh::Real _A
Cross-sectional area of the cable.
unsigned int dim() const
Number of components.
const libMesh::FEGenericBase< libMesh::Real > * get_fe(const AssemblyContext &context)

Member Data Documentation

template<typename StressStrainLaw >
bool GRINS::ElasticCableBase< StressStrainLaw >::_is_compressible
protected

Definition at line 68 of file elastic_cable_base.h.

template<typename StressStrainLaw >
StressStrainLaw GRINS::ElasticCableBase< StressStrainLaw >::_stress_strain_law
protected

Definition at line 66 of file elastic_cable_base.h.


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