libMesh
|
This class encapsulate all functionality required for assembling and solving a linear elastic model with contact. More...
#include <linear_elasticity_with_contact.h>
Public Member Functions | |
LinearElasticityWithContact (NonlinearImplicitSystem &sys_in, Real contact_penalty_in) | |
Constructor. More... | |
void | set_contact_penalty (Real contact_penalty_in) |
Update the penalty parameter. More... | |
Real | get_contact_penalty () const |
Get the penalty parameter. More... | |
Real | kronecker_delta (unsigned int i, unsigned int j) |
Kronecker delta function. More... | |
Real | elasticity_tensor (Real young_modulus, Real poisson_ratio, unsigned int i, unsigned int j, unsigned int k, unsigned int l) |
Evaluate the fourth order tensor (C_ijkl) that relates stress to strain. More... | |
void | move_mesh (MeshBase &input_mesh, const NumericVector< Number > &input_solution) |
Move the mesh nodes of input_mesh based on the displacement field in input_solution. More... | |
void | initialize_contact_load_paths () |
Set up the load paths on the contact surfaces. More... | |
void | add_contact_edge_elements () |
Add edge elements into the mesh based on the contact load paths. More... | |
virtual void | residual_and_jacobian (const NumericVector< Number > &soln, NumericVector< Number > *residual, SparseMatrix< Number > *jacobian, NonlinearImplicitSystem &) |
Evaluate the Jacobian of the nonlinear system. More... | |
void | compute_stresses () |
Compute the Cauchy stress for the current solution. More... | |
std::pair< Real, Real > | update_lambdas () |
Update the lambda parameters in the augmented Lagrangian method. More... | |
std::pair< Real, Real > | get_least_and_max_gap_function () |
Private Attributes | |
NonlinearImplicitSystem & | _sys |
Keep a reference to the NonlinearImplicitSystem. More... | |
Real | _contact_penalty |
Penalize overlapping elements. More... | |
std::map< dof_id_type, Real > | _lambda_plus_penalty_values |
Store the intermediate values of lambda plus penalty. More... | |
std::map< dof_id_type, Real > | _lambdas |
Augmented Lagrangian values at each contact node. More... | |
std::map< dof_id_type, dof_id_type > | _contact_node_map |
This provides a map between contact nodes. More... | |
This class encapsulate all functionality required for assembling and solving a linear elastic model with contact.
Definition at line 31 of file linear_elasticity_with_contact.h.
LinearElasticityWithContact::LinearElasticityWithContact | ( | NonlinearImplicitSystem & | sys_in, |
Real | contact_penalty_in | ||
) |
Constructor.
Definition at line 35 of file linear_elasticity_with_contact.C.
void LinearElasticityWithContact::add_contact_edge_elements | ( | ) |
Add edge elements into the mesh based on the contact load paths.
This ensure proper parallel communication of data, e.g. if a node on one side of the contact surface has a constraint on it, then adding contact elements into the mesh ensures that the constraint will be enforced properly.
Definition at line 209 of file linear_elasticity_with_contact.C.
References _contact_node_map, _sys, libMesh::MeshBase::add_elem(), libMesh::EDGE2, libMesh::System::get_mesh(), mesh, libMesh::MeshBase::node_ref(), libMesh::MeshBase::prepare_for_use(), libMesh::Elem::set_node(), and libMesh::Elem::subdomain_id().
void LinearElasticityWithContact::compute_stresses | ( | ) |
Compute the Cauchy stress for the current solution.
Definition at line 472 of file linear_elasticity_with_contact.C.
References _sys, libMesh::TypeTensor< T >::add_scaled(), libMesh::System::current_solution(), libMesh::FEType::default_quadrature_order(), dim, libMesh::DofMap::dof_indices(), libMesh::EDGE2, elasticity_tensor(), libMesh::Parameters::get(), libMesh::System::get_dof_map(), libMesh::System::get_equation_systems(), libMesh::System::get_mesh(), libMesh::EquationSystems::get_system(), mesh, libMesh::MeshBase::mesh_dimension(), libMesh::System::n_vars(), libMesh::EquationSystems::parameters, libMesh::Utility::pow(), libMesh::Real, libMesh::System::solution, std::sqrt(), libMesh::System::update(), libMesh::System::variable_number(), libMesh::DofMap::variable_type(), and libMesh::TypeTensor< T >::zero().
Real LinearElasticityWithContact::elasticity_tensor | ( | Real | young_modulus, |
Real | poisson_ratio, | ||
unsigned int | i, | ||
unsigned int | j, | ||
unsigned int | k, | ||
unsigned int | l | ||
) |
Evaluate the fourth order tensor (C_ijkl) that relates stress to strain.
Definition at line 58 of file linear_elasticity_with_contact.C.
References kronecker_delta(), and libMesh::Real.
Referenced by compute_stresses(), and residual_and_jacobian().
Real LinearElasticityWithContact::get_contact_penalty | ( | ) | const |
Get the penalty parameter.
Definition at line 47 of file linear_elasticity_with_contact.C.
References _contact_penalty.
std::pair< Real, Real > LinearElasticityWithContact::get_least_and_max_gap_function | ( | ) |
Definition at line 624 of file linear_elasticity_with_contact.C.
References _contact_node_map, _sys, libMesh::MeshBase::clone(), libMesh::System::get_mesh(), move_mesh(), libMesh::Real, and libMesh::System::solution.
void LinearElasticityWithContact::initialize_contact_load_paths | ( | ) |
Set up the load paths on the contact surfaces.
Definition at line 144 of file linear_elasticity_with_contact.C.
References _contact_node_map, _lambdas, _sys, distance(), libMesh::MeshBase::get_boundary_info(), libMesh::System::get_mesh(), libMesh::BoundaryInfo::has_boundary_id(), libMesh::libmesh_assert(), mesh, libMesh::TensorTools::norm(), libMesh::MeshBase::point(), and libMesh::Real.
Kronecker delta function.
Definition at line 52 of file linear_elasticity_with_contact.C.
Referenced by elasticity_tensor().
void LinearElasticityWithContact::move_mesh | ( | MeshBase & | input_mesh, |
const NumericVector< Number > & | input_solution | ||
) |
Move the mesh nodes of input_mesh based on the displacement field in input_solution.
Definition at line 73 of file linear_elasticity_with_contact.C.
References _sys, libMesh::ParallelObject::comm(), libMesh::DofMap::dof_indices(), libMesh::MeshBase::elem_ptr(), libMesh::System::get_dof_map(), libMesh::System::get_equation_systems(), libMesh::System::get_mesh(), libMesh::DofObject::id(), libMesh::NumericVector< T >::init(), libMesh::NumericVector< T >::localize(), libMesh::SERIAL, libMesh::NumericVector< T >::size(), value, libMesh::System::variable_number(), and libMesh::DofMap::variable_type().
Referenced by get_least_and_max_gap_function(), and residual_and_jacobian().
|
virtual |
Evaluate the Jacobian of the nonlinear system.
Definition at line 228 of file linear_elasticity_with_contact.C.
References _contact_node_map, _contact_penalty, _lambda_plus_penalty_values, _lambdas, _sys, libMesh::SparseMatrix< T >::add(), libMesh::SparseMatrix< T >::add_matrix(), libMesh::NumericVector< T >::add_vector(), libMesh::MeshBase::clone(), libMesh::ParallelObject::comm(), libMesh::DofMap::constrain_element_matrix_and_vector(), libMesh::FEType::default_quadrature_order(), dim, libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::EDGE2, elasticity_tensor(), libMesh::Parameters::get(), libMesh::System::get_dof_map(), libMesh::System::get_equation_systems(), libMesh::System::get_mesh(), mesh, libMesh::MeshBase::mesh_dimension(), move_mesh(), libMesh::MeshBase::node_ref(), libMesh::System::number(), libMesh::EquationSystems::parameters, TIMPI::Communicator::rank(), libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::System::variable_number(), libMesh::DofMap::variable_type(), libMesh::NumericVector< T >::zero(), and libMesh::SparseMatrix< T >::zero().
void LinearElasticityWithContact::set_contact_penalty | ( | Real | contact_penalty_in | ) |
Update the penalty parameter.
Definition at line 42 of file linear_elasticity_with_contact.C.
References _contact_penalty.
std::pair< Real, Real > LinearElasticityWithContact::update_lambdas | ( | ) |
Update the lambda parameters in the augmented Lagrangian method.
Definition at line 598 of file linear_elasticity_with_contact.C.
References _lambda_plus_penalty_values, _lambdas, std::abs(), and libMesh::Real.
|
private |
This provides a map between contact nodes.
Definition at line 61 of file linear_elasticity_with_contact.h.
Referenced by add_contact_edge_elements(), get_least_and_max_gap_function(), initialize_contact_load_paths(), and residual_and_jacobian().
|
private |
Penalize overlapping elements.
Definition at line 44 of file linear_elasticity_with_contact.h.
Referenced by get_contact_penalty(), residual_and_jacobian(), and set_contact_penalty().
|
private |
Store the intermediate values of lambda plus penalty.
The dof IDs refer to the nodes on the upper contact surface.
Definition at line 50 of file linear_elasticity_with_contact.h.
Referenced by residual_and_jacobian(), and update_lambdas().
|
private |
Augmented Lagrangian values at each contact node.
The dof IDs refer to the nodes on the upper contact surface.
Definition at line 56 of file linear_elasticity_with_contact.h.
Referenced by initialize_contact_load_paths(), residual_and_jacobian(), and update_lambdas().
|
private |
Keep a reference to the NonlinearImplicitSystem.
Definition at line 39 of file linear_elasticity_with_contact.h.
Referenced by add_contact_edge_elements(), compute_stresses(), get_least_and_max_gap_function(), initialize_contact_load_paths(), move_mesh(), and residual_and_jacobian().