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

#include <elastic_cable.h>

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

Public Member Functions

 ElasticCable (const PhysicsName &physics_name, const GetPot &input, bool is_compressible)
 
virtual ~ElasticCable ()
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register postprocessing variables for ElasticCable. More...
 
virtual void element_time_derivative (bool compute_jacobian, AssemblyContext &context)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void mass_residual (bool compute_jacobian, AssemblyContext &context)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 Compute the registered postprocessed quantities. More...
 
- Public Member Functions inherited from GRINS::ElasticCableBase< StressStrainLaw >
 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 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 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 &)
 
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

 ElasticCable ()
 

Private Attributes

std::vector< unsigned int > _stress_indices
 Index from registering this quantity. Each component will have it's own index. More...
 
std::vector< unsigned int > _strain_indices
 Index from registering this quantity. Each component will have it's own index. More...
 
std::vector< unsigned int > _force_indices
 Index from registering this quantity. Each component will have it's own index. More...
 

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::ElasticCableBase< StressStrainLaw >
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 inherited from GRINS::ElasticCableBase< StressStrainLaw >
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...
 
- 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::ElasticCable< StressStrainLaw >

Definition at line 35 of file elastic_cable.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file elastic_cable.C.

References GRINS::Physics::_ic_handler.

46  : ElasticCableBase<StressStrainLaw>(physics_name,input,is_compressible)
47  {
48  this->_ic_handler = new GenericICHandler(physics_name, input);
49  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
template<typename StressStrainLaw >
virtual GRINS::ElasticCable< StressStrainLaw >::~ElasticCable ( )
inlinevirtual

Definition at line 42 of file elastic_cable.h.

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

Member Function Documentation

template<typename StressStrainLaw >
void GRINS::ElasticCable< StressStrainLaw >::compute_postprocessed_quantity ( unsigned int  quantity_index,
const AssemblyContext context,
const libMesh::Point &  point,
libMesh::Real &  value 
)
virtual

Compute the registered postprocessed quantities.

Reimplemented from GRINS::Physics.

Definition at line 107 of file elastic_cable.C.

111  {
112  bool is_strain = false;
113  if( !_strain_indices.empty() )
114  is_strain = ( _strain_indices[0] == quantity_index );
115 
116  bool is_stress = false;
117  if( !_stress_indices.empty() )
118  is_stress = ( _stress_indices[0] == quantity_index );
119 
120  bool is_force = false;
121  if( !_force_indices.empty() )
122  is_force = ( _force_indices[0] == quantity_index );
123 
124  if( is_strain || is_stress || is_force )
125  {
126  const unsigned int n_u_dofs = context.get_dof_indices(this->_disp_vars.u()).size();
127 
128  const libMesh::DenseSubVector<libMesh::Number>& u_coeffs = context.get_elem_solution( this->_disp_vars.u() );
129  const libMesh::DenseSubVector<libMesh::Number>* v_coeffs = NULL;
130 
131  const libMesh::DenseSubVector<libMesh::Number>* w_coeffs = NULL;
132 
133  if( this->_disp_vars.dim() >= 2 )
134  v_coeffs = &context.get_elem_solution( this->_disp_vars.v() );
135 
136  if( this->_disp_vars.dim() == 3 )
137  w_coeffs = &context.get_elem_solution( this->_disp_vars.w() );
138 
139  // Build new FE for the current point. We need this to build tensors at point.
140  libMesh::UniquePtr<libMesh::FEGenericBase<libMesh::Real> > fe_new = this->build_new_fe( &context.get_elem(), this->get_fe(context), point );
141 
142  const std::vector<std::vector<libMesh::Real> >& dphi_dxi = fe_new->get_dphidxi();
143 
144  // Need these to build up the covariant and contravariant metric tensors
145  const std::vector<libMesh::RealGradient>& dxdxi = fe_new->get_dxyzdxi();
146 
147  // Gradients are w.r.t. master element coordinates
148  libMesh::Gradient grad_u, grad_v, grad_w;
149  for( unsigned int d = 0; d < n_u_dofs; d++ )
150  {
151  libMesh::RealGradient u_gradphi( dphi_dxi[d][0] );
152  grad_u += u_coeffs(d)*u_gradphi;
153 
154  if( this->_disp_vars.dim() >= 2 )
155  grad_v += (*v_coeffs)(d)*u_gradphi;
156 
157  if( this->_disp_vars.dim() == 3 )
158  grad_w += (*w_coeffs)(d)*u_gradphi;
159  }
160 
161  libMesh::RealGradient grad_x( dxdxi[0](0) );
162  libMesh::RealGradient grad_y( dxdxi[0](1) );
163  libMesh::RealGradient grad_z( dxdxi[0](2) );
164 
165  libMesh::TensorValue<libMesh::Real> a_cov, a_contra, A_cov, A_contra;
166  libMesh::Real lambda_sq = 0;
167 
168  this->compute_metric_tensors(0, *fe_new, context,
169  grad_u, grad_v, grad_w,
170  a_cov, a_contra, A_cov, A_contra, lambda_sq );
171 
172  libMesh::Real det_a = a_cov(0,0)*a_cov(1,1) - a_cov(0,1)*a_cov(1,0);
173  libMesh::Real det_A = A_cov(0,0)*A_cov(1,1) - A_cov(0,1)*A_cov(1,0);
174 
175  libMesh::Real I3 = lambda_sq*det_A/det_a;
176 
178  this->_stress_strain_law.compute_stress(1,a_contra,a_cov,A_contra,A_cov,tau);
179 
180  // We have everything we need for strain now, so check if we are computing strain
181  if( is_strain )
182  {
183  if( _strain_indices[0] == quantity_index )
184  {
185  value = 0.5*(A_cov(0,0) - a_cov(0,0));
186  }
187  else
188  {
189  //Wat?!
190  libmesh_error();
191  }
192  return;
193  }
194 
195  if( is_stress )
196  {
197  if( _stress_indices[0] == quantity_index )
198  {
199  // Need to convert to Cauchy stress
200  value = tau(0,0)/std::sqrt(I3);
201  }
202  else
203  {
204  libmesh_error();
205  }
206  }
207  if( is_force )
208  {
209 
210  if( _force_indices[0] == quantity_index )
211  {
212  //This force is in deformed configuration and will be significantly influenced by large strains
213  value = tau(0,0)/std::sqrt(I3)*this->_A;
214  }
215  else
216  {
217  libmesh_error();
218  }
219  }
220  }
221  }
void compute_stress(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
std::vector< unsigned int > _force_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:76
libMesh::UniquePtr< libMesh::FEGenericBase< libMesh::Real > > build_new_fe(const libMesh::Elem *elem, const libMesh::FEGenericBase< libMesh::Real > *fe, const libMesh::Point p)
Definition: physics.C:143
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)
std::vector< unsigned int > _stress_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:70
std::vector< unsigned int > _strain_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:73
StressStrainLaw _stress_strain_law
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)
template<typename StressStrainLaw >
void GRINS::ElasticCable< StressStrainLaw >::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 225 of file elastic_cable.C.

226  {
227  const unsigned int n_u_dofs = context.get_dof_indices(this->_disp_vars.u()).size();
228 
229  const std::vector<libMesh::Real> &JxW =
230  this->get_fe(context)->get_JxW();
231 
232  // Residuals that we're populating
233  libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(this->_disp_vars.u());
234  libMesh::DenseSubVector<libMesh::Number>* Fv = NULL;
235  libMesh::DenseSubVector<libMesh::Number>* Fw = NULL;
236 
237  libMesh::DenseSubMatrix<libMesh::Number>& Kuu = context.get_elem_jacobian(this->_disp_vars.u(),this->_disp_vars.u());
238  libMesh::DenseSubMatrix<libMesh::Number>* Kuv = NULL;
239  libMesh::DenseSubMatrix<libMesh::Number>* Kuw = NULL;
240 
241  libMesh::DenseSubMatrix<libMesh::Number>* Kvu = NULL;
242  libMesh::DenseSubMatrix<libMesh::Number>* Kvv = NULL;
243  libMesh::DenseSubMatrix<libMesh::Number>* Kvw = NULL;
244 
245  libMesh::DenseSubMatrix<libMesh::Number>* Kwu = NULL;
246  libMesh::DenseSubMatrix<libMesh::Number>* Kwv = NULL;
247  libMesh::DenseSubMatrix<libMesh::Number>* Kww = NULL;
248 
249  if( this->_disp_vars.dim() >= 2 )
250  {
251  Fv = &context.get_elem_residual(this->_disp_vars.v());
252 
253  Kuv = &context.get_elem_jacobian(this->_disp_vars.u(),this->_disp_vars.v());
254  Kvu = &context.get_elem_jacobian(this->_disp_vars.v(),this->_disp_vars.u());
255  Kvv = &context.get_elem_jacobian(this->_disp_vars.v(),this->_disp_vars.v());
256  }
257 
258  if( this->_disp_vars.dim() == 3 )
259  {
260  Fw = &context.get_elem_residual(this->_disp_vars.w());
261 
262  Kuw = &context.get_elem_jacobian(this->_disp_vars.u(),this->_disp_vars.w());
263  Kvw = &context.get_elem_jacobian(this->_disp_vars.v(),this->_disp_vars.w());
264  Kwu = &context.get_elem_jacobian(this->_disp_vars.w(),this->_disp_vars.u());
265  Kwv = &context.get_elem_jacobian(this->_disp_vars.w(),this->_disp_vars.v());
266  Kww = &context.get_elem_jacobian(this->_disp_vars.w(),this->_disp_vars.w());
267  }
268 
269 
270  unsigned int n_qpoints = context.get_element_qrule().n_points();
271 
272  // All shape function gradients are w.r.t. master element coordinates
273  const std::vector<std::vector<libMesh::Real> >& dphi_dxi = this->get_fe(context)->get_dphidxi();
274 
275  const libMesh::DenseSubVector<libMesh::Number>& u_coeffs = context.get_elem_solution( this->_disp_vars.u() );
276  const libMesh::DenseSubVector<libMesh::Number>* v_coeffs = NULL;
277  const libMesh::DenseSubVector<libMesh::Number>* w_coeffs = NULL;
278 
279  if( this->_disp_vars.dim() >= 2 )
280  v_coeffs = &context.get_elem_solution( this->_disp_vars.v() );
281 
282  if( this->_disp_vars.dim() == 3 )
283  w_coeffs = &context.get_elem_solution( this->_disp_vars.w() );
284 
285  // Need these to build up the covariant and contravariant metric tensors
286  const std::vector<libMesh::RealGradient>& dxdxi = this->get_fe(context)->get_dxyzdxi();
287 
288  const unsigned int dim = 1; // The cable dimension is always 1 for this physics
289 
290  for (unsigned int qp=0; qp != n_qpoints; qp++)
291  {
292  // Gradients are w.r.t. master element coordinates
293  libMesh::Gradient grad_u, grad_v, grad_w;
294 
295  for( unsigned int d = 0; d < n_u_dofs; d++ )
296  {
297  libMesh::RealGradient u_gradphi( dphi_dxi[d][qp] );
298  grad_u += u_coeffs(d)*u_gradphi;
299 
300  if( this->_disp_vars.dim() >= 2 )
301  grad_v += (*v_coeffs)(d)*u_gradphi;
302 
303  if( this->_disp_vars.dim() == 3 )
304  grad_w += (*w_coeffs)(d)*u_gradphi;
305  }
306 
307  libMesh::RealGradient grad_x( dxdxi[qp](0) );
308  libMesh::RealGradient grad_y( dxdxi[qp](1) );
309  libMesh::RealGradient grad_z( dxdxi[qp](2) );
310 
311  libMesh::TensorValue<libMesh::Real> a_cov, a_contra, A_cov, A_contra;
312  libMesh::Real lambda_sq = 0;
313 
314  this->compute_metric_tensors( qp, *(this->get_fe(context)), context,
315  grad_u, grad_v, grad_w,
316  a_cov, a_contra, A_cov, A_contra,
317  lambda_sq );
318 
319  // Compute stress tensor
321  ElasticityTensor C;
322  this->_stress_strain_law.compute_stress_and_elasticity(dim,a_contra,a_cov,A_contra,A_cov,tau,C);
323 
324 
325  libMesh::Real jac = JxW[qp];
326 
327  for (unsigned int i=0; i != n_u_dofs; i++)
328  {
329  libMesh::RealGradient u_gradphi( dphi_dxi[i][qp] );
330 
331  const libMesh::Real res_term = tau(0,0)*this->_A*jac*u_gradphi(0);
332 
333  Fu(i) += res_term*(grad_x(0) + grad_u(0));
334 
335  if( this->_disp_vars.dim() >= 2 )
336  (*Fv)(i) += res_term*(grad_y(0) + grad_v(0));
337 
338  if( this->_disp_vars.dim() == 3 )
339  (*Fw)(i) += res_term*(grad_z(0) + grad_w(0));
340  }
341 
342  if( compute_jacobian )
343  {
344  for(unsigned int i=0; i != n_u_dofs; i++)
345  {
346  libMesh::RealGradient u_gradphi_I( dphi_dxi[i][qp] );
347  for(unsigned int j=0; j != n_u_dofs; j++)
348  {
349  libMesh::RealGradient u_gradphi_J( dphi_dxi[j][qp] );
350 
351  const libMesh::Real diag_term = this->_A*jac*tau(0,0)*( u_gradphi_J(0)*u_gradphi_I(0))*context.get_elem_solution_derivative();
352 
353  Kuu(i,j) += diag_term;
354 
355  if( this->_disp_vars.dim() >= 2 )
356  (*Kvv)(i,j) += diag_term;
357 
358  if( this->_disp_vars.dim() == 3 )
359  (*Kww)(i,j) += diag_term;
360 
361  const libMesh::Real dgamma_du = ( u_gradphi_J(0)*(grad_x(0)+grad_u(0)) );
362 
363  const libMesh::Real C1 = this->_A*jac*C(0,0,0,0)*context.get_elem_solution_derivative();
364 
365  const libMesh::Real x_term = C1*( (grad_x(0)+grad_u(0))*u_gradphi_I(0) );
366 
367  Kuu(i,j) += x_term*dgamma_du;
368 
369  libMesh::Real y_term = 0.0;
370  libMesh::Real dgamma_dv = 0.0;
371 
372  if( this->_disp_vars.dim() >= 2 )
373  {
374  dgamma_dv = ( u_gradphi_J(0)*(grad_y(0)+grad_v(0)) );
375  y_term = C1*( (grad_y(0)+grad_v(0))*u_gradphi_I(0) );
376 
377  (*Kuv)(i,j) += x_term*dgamma_dv;
378  (*Kvu)(i,j) += y_term*dgamma_du;
379  (*Kvv)(i,j) += y_term*dgamma_dv;
380  }
381 
382  libMesh::Real z_term = 0.0;
383 
384  if( this->_disp_vars.dim() == 3 )
385  {
386  const libMesh::Real dgamma_dw = ( u_gradphi_J(0)*(grad_z(0)+grad_w(0)) );
387  z_term = C1*( (grad_z(0)+grad_w(0))*u_gradphi_I(0) );
388 
389  (*Kuw)(i,j) += x_term*dgamma_dw;
390  (*Kvw)(i,j) += y_term*dgamma_dw;
391  (*Kwu)(i,j) += z_term*dgamma_du;
392  (*Kwv)(i,j) += z_term*dgamma_dv;
393  (*Kww)(i,j) += z_term*dgamma_dw;
394  }
395 
396  } // end j-loop
397  } // end i-loop
398  } // end if(compute_jacobian)
399  } // end qp loop
400  }
void compute_stress_and_elasticity(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
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)
StressStrainLaw _stress_strain_law
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)
template<typename StressStrainLaw >
virtual void GRINS::ElasticCable< StressStrainLaw >::mass_residual ( bool  ,
AssemblyContext  
)
inlinevirtual

Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part.

Reimplemented from GRINS::Physics.

Definition at line 52 of file elastic_cable.h.

References GRINS::ElasticCableBase< StressStrainLaw >::mass_residual_impl().

54  { this->mass_residual_impl(compute_jacobian,
55  context,
56  &libMesh::FEMContext::interior_accel,
57  &libMesh::DiffContext::get_elem_solution_accel_derivative); }
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.
template<typename StressStrainLaw >
void GRINS::ElasticCable< StressStrainLaw >::register_postprocessing_vars ( const GetPot &  input,
PostProcessedQuantities< libMesh::Real > &  postprocessing 
)
virtual

Register postprocessing variables for ElasticCable.

Reimplemented from GRINS::Physics.

Definition at line 52 of file elastic_cable.C.

References GRINS::PhysicsNaming::elastic_cable(), and GRINS::PostProcessedQuantities< NumericType >::register_quantity().

54  {
55  std::string section = "Physics/"+PhysicsNaming::elastic_cable()+"/output_vars";
56 
57  if( input.have_variable(section) )
58  {
59  unsigned int n_vars = input.vector_variable_size(section);
60 
61  for( unsigned int v = 0; v < n_vars; v++ )
62  {
63  std::string name = input(section,"DIE!",v);
64 
65  if( name == std::string("stress") )
66  {
67  // sigma_xx only, i.e., locally normal to the cutting plane
68  // sigma_yy=sigma_zz = 0 by assumption of this Physics
69  _stress_indices.resize(1);
70 
71  this->_stress_indices[0] = postprocessing.register_quantity("cable_stress");
72 
73  }
74  else if( name == std::string("strain") )
75  {
76  // eps_xx only, i.e., locally normal to the cutting plane
77  // eps_yy=eps_zz = 0 by assumption of this Physics
78  _strain_indices.resize(1);
79 
80  this->_strain_indices[0] = postprocessing.register_quantity("cable_strain");
81 
82  }
83  else if( name == std::string("force") )
84  {
85  // force_x only, i.e., locally normal to the cutting plane
86  // force_y=force_z=0 by assumption of this Physics
87  _force_indices.resize(1);
88 
89  this->_force_indices[0] = postprocessing.register_quantity("cable_force");
90 
91  }
92  else
93  {
94  std::cerr << "Error: Invalue output_vars value for "+PhysicsNaming::elastic_cable() << std::endl
95  << " Found " << name << std::endl
96  << " Acceptable values are: stress" << std::endl
97  << " strain" << std::endl
98  << " force " << std::endl;
99  libmesh_error();
100  }
101  }
102  }
103  return;
104  }
std::vector< unsigned int > _force_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:76
static PhysicsName elastic_cable()
std::vector< unsigned int > _stress_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:70
std::vector< unsigned int > _strain_indices
Index from registering this quantity. Each component will have it's own index.
Definition: elastic_cable.h:73

Member Data Documentation

template<typename StressStrainLaw >
std::vector<unsigned int> GRINS::ElasticCable< StressStrainLaw >::_force_indices
private

Index from registering this quantity. Each component will have it's own index.

Definition at line 76 of file elastic_cable.h.

template<typename StressStrainLaw >
std::vector<unsigned int> GRINS::ElasticCable< StressStrainLaw >::_strain_indices
private

Index from registering this quantity. Each component will have it's own index.

Definition at line 73 of file elastic_cable.h.

template<typename StressStrainLaw >
std::vector<unsigned int> GRINS::ElasticCable< StressStrainLaw >::_stress_indices
private

Index from registering this quantity. Each component will have it's own index.

Definition at line 70 of file elastic_cable.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