Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
PML3DHexa8 Class Reference

Class for creating a 3D linearized eight-node perfectly matched layer element in a mesh. More...

#include <PML3DHexa8.hpp>

Inheritance diagram for PML3DHexa8:
Collaboration diagram for PML3DHexa8:

Public Member Functions

 PML3DHexa8 (const std::vector< unsigned int > nodes, std::unique_ptr< Material > &material, const std::vector< double > parameters, const std::string quadrature="GAUSS", const unsigned int nGauss=8)
 Creates a PML3DHexa8 in a finite element Mesh. More...
 
 ~PML3DHexa8 ()
 Destroys this PML3DHexa8 object. More...
 
void CommitState ()
 Save the material states in the element. More...
 
void ReverseState ()
 Reverse the material/section states to previous converged state in this element. More...
 
void InitialState ()
 Brings the material/section state to its initial state in this element. More...
 
void UpdateState ()
 Update the material states in the element. More...
 
void SetDomain (std::map< unsigned int, std::shared_ptr< Node > > &nodes)
 Sets the finite element dependance among objects. More...
 
void SetDamping (const std::shared_ptr< Damping > &damping)
 Sets the damping model. More...
 
std::vector< unsigned int > GetTotalDegreeOfFreedom () const
 Gets the list of total-degree of freedom of this Element. More...
 
Eigen::MatrixXd GetStrain () const
 Gets the material/section (generalised) strain. More...
 
Eigen::MatrixXd GetStress () const
 Gets the material/section (generalised) stress. More...
 
Eigen::MatrixXd GetStrainRate () const
 Gets the material/section (generalised) strain-rate. More...
 
Eigen::MatrixXd GetStrainAt (double x3, double x2) const
 Gets the material strain in section at coordinate (x3,x2). More...
 
Eigen::MatrixXd GetStressAt (double x3, double x2) const
 Gets the material stress in section at coordinate (x3,x2). More...
 
Eigen::VectorXd GetVTKResponse (std::string response) const
 Gets the element internal response in VTK format for Paraview display. More...
 
double ComputeEnergy ()
 Computes the element energy for a given deformation. More...
 
Eigen::MatrixXd ComputeMassMatrix ()
 Compute the lumped/consistent mass matrix of the element. More...
 
Eigen::MatrixXd ComputeStiffnessMatrix ()
 Compute the stiffness matrix of the element using gauss-integration. More...
 
Eigen::MatrixXd ComputeDampingMatrix ()
 Compute the damping matrix of the element using gauss-integration. More...
 
Eigen::MatrixXd ComputePMLMatrix ()
 Compute the PML history matrix using gauss-integration. More...
 
Eigen::VectorXd ComputeInternalForces ()
 Compute the internal (elastic) forces acting on the element. More...
 
Eigen::VectorXd ComputeInternalDynamicForces ()
 Compute the elastic, inertial, and viscous forces acting on the element. More...
 
Eigen::VectorXd ComputeSurfaceForces (const std::shared_ptr< Load > &surface, unsigned int face)
 Compute the surface forces acting on the element. More...
 
Eigen::VectorXd ComputeBodyForces (const std::shared_ptr< Load > &body, unsigned int k=0)
 Compute the body forces acting on the element. More...
 
Eigen::VectorXd ComputeDomainReductionForces (const std::shared_ptr< Load > &drm, unsigned int k)
 Compute the domain reduction forces acting on the element. More...
 
- Public Member Functions inherited from Element
 Element (std::string name, const std::vector< unsigned int > nodes, unsigned int ndofs, unsigned int VTKcell, unsigned int SVLcell)
 Creates an Element in a finite element Mesh. More...
 
virtual ~Element ()=0
 Destroys this Element object. More...
 
std::string GetName () const
 Gets the Element Name. More...
 
unsigned int GetVTKCellType () const
 Gets the Element VTK cell type. More...
 
unsigned int GetVTKGroupType () const
 Gets the Element VTK group type. More...
 
unsigned int GetNumberOfNodes () const
 Returns the number of nodes in element. More...
 
unsigned int GetNumberOfDegreeOfFreedom () const
 Returns total number of degree of freedom in the element. More...
 
const std::vector< unsigned int > & GetNodes () const
 Returns the Node Connectivity Indexes. More...
 
bool HasFixedNode (const std::vector< std::shared_ptr< Node > > &nodes) const
 Returns if the element has fixed nodes. More...
 

Private Member Functions

Eigen::VectorXd ComputeStrain (const Eigen::MatrixXd &Bij) const
 Update strain in the element. More...
 
Eigen::VectorXd ComputeStrainRate (const Eigen::MatrixXd &Bij) const
 Update strain rate in the element. More...
 
Eigen::MatrixXd ComputeJacobianMatrix (const double ri, const double si, const double ti) const
 Computes the jacobian of the transformation. More...
 
Eigen::MatrixXd ComputeShapeFunctionMatrix (const double ri, const double si, const double ti) const
 Evaluates the shape function matrix at a given Gauss point. More...
 
Eigen::MatrixXd ComputeStrainDisplacementMatrix (const double ri, const double si, const double ti, const Eigen::MatrixXd &Jij) const
 Evaluates the strain-displacement matrix at a given Gauss point. More...
 
Eigen::VectorXd ComputePMLStretchingFactors (const double ri, const double si, const double ti, const double rho, const double mu, const double lambda) const
 Evaluates the stretching parameters of PML. More...
 

Private Attributes

double m_pml
 Polynomial degree of thePerfectly Match Layer. More...
 
double L_pml
 Thickness of the PML region. More...
 
double R_pml
 Reflection coefficient for the PML. More...
 
double x0_pml
 Coordinates x0 of reference point. More...
 
double y0_pml
 Coordinates y0 of reference point. More...
 
double z0_pml
 Coordinates z0 of reference point. More...
 
double nx_pml
 Horizontal normal components for x1. More...
 
double ny_pml
 Horizontal normal components for x2. More...
 
double nz_pml
 Vertical normal components for x3. More...
 
std::shared_ptr< DampingtheDamping
 The Damping model. More...
 
std::vector< std::shared_ptr< Node > > theNodes
 The Element's Nodes. More...
 
std::vector< std::unique_ptr< Material > > theMaterial
 The Element's material. More...
 
std::unique_ptr< QuadratureRuleQuadraturePoints
 Coordinate of Gauss points. More...
 

Detailed Description

Class for creating a 3D linearized eight-node perfectly matched layer element in a mesh.

See also
Element.hpp Mesh.hpp

Constructor & Destructor Documentation

◆ PML3DHexa8()

PML3DHexa8::PML3DHexa8 ( const std::vector< unsigned int >  nodes,
std::unique_ptr< Material > &  material,
const std::vector< double >  parameters,
const std::string  quadrature = "GAUSS",
const unsigned int  nGauss = 8 
)

Creates a PML3DHexa8 in a finite element Mesh.

Parameters
nodesThe Node connectivity array of this Element.
materialPointer to the Material that this Element is made out of.
parametersThe list of PML parameters.
quadratureThe integration rule to be employed.
nGaussNumber of Gauss points for Element integration.
Note
More details can be found at PML3DHexa8.
See also
PML3DHexa8::theNodes, PML3DHexa8::theMaterial, PML3DHexa8::QuadraturePoints.

◆ ~PML3DHexa8()

PML3DHexa8::~PML3DHexa8 ( )

Destroys this PML3DHexa8 object.

Member Function Documentation

◆ CommitState()

void PML3DHexa8::CommitState ( )
virtual

Save the material states in the element.

Note
This function sets the trial states as converged ones in Material.

Implements Element.

◆ ComputeBodyForces()

Eigen::VectorXd PML3DHexa8::ComputeBodyForces ( const std::shared_ptr< Load > &  body,
unsigned int  k = 0 
)
virtual

Compute the body forces acting on the element.

Parameters
bodyPointer to the Load object that contains this information.
kThe time step at which the body load is evaluated.
Returns
Vector with the Element surface force.
Note
The body force vector can be revisited in ZeroLength1D.
See also
Assembler::ComputeExternalForceVector(), Integrator::ComputeEffectiveForce().

Implements Element.

◆ ComputeDampingMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeDampingMatrix ( )
virtual

Compute the damping matrix of the element using gauss-integration.

Returns
Matrix with the Element damping matrix.
Note
The damping matrix can be revisited in PML3DHexa8.
See also
Assembler::ComputeDampingMatrix(), Integrator::ComputeEffectiveStiffness().

Implements Element.

◆ ComputeDomainReductionForces()

Eigen::VectorXd PML3DHexa8::ComputeDomainReductionForces ( const std::shared_ptr< Load > &  drm,
unsigned int  k 
)
virtual

Compute the domain reduction forces acting on the element.

Parameters
drmPointer to the DRM Load object that contains this information.
kThe time step at which the body load is evaluated.
Returns
Vector with the Element domain reduction forces.
Note
The DRM force vector can be revisited in ZeroLength1D.
See also
Assembler::ComputeExternalForceVector(), Integrator::ComputeEffectiveForce().

Implements Element.

◆ ComputeEnergy()

double PML3DHexa8::ComputeEnergy ( )
virtual

Computes the element energy for a given deformation.

Returns
Scalar with the element deformation energy.

Implements Element.

◆ ComputeInternalDynamicForces()

Eigen::VectorXd PML3DHexa8::ComputeInternalDynamicForces ( )
virtual

Compute the elastic, inertial, and viscous forces acting on the element.

Returns
Vector with the Element dynamic internal force.
Note
The internal force vector can be revisited in Element.
See also
Assembler::ComputeDynamicInternalForceVector().

Implements Element.

◆ ComputeInternalForces()

Eigen::VectorXd PML3DHexa8::ComputeInternalForces ( )
virtual

Compute the internal (elastic) forces acting on the element.

Returns
Vector with the Element internal force.
Note
The internal force vector can be revisited in PML3DHexa8.
See also
Assembler::ComputeInternalForceVector(), Integrator::ComputeEffectiveForce().

Implements Element.

◆ ComputeJacobianMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeJacobianMatrix ( const double  ri,
const double  si,
const double  ti 
) const
private

Computes the jacobian of the transformation.

Parameters
riThe i-th Gauss coordinate in the r-axis.
siThe i-th Gauss coordinate in the s-axis.
tiThe i-th Gauss coordinate in the t-axis.
Returns
The Jacobian matrix evaluated at i-th Gauss point (ri,si,ti).

◆ ComputeMassMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeMassMatrix ( )
virtual

Compute the lumped/consistent mass matrix of the element.

Returns
Matrix with the Element mass matrix.
Note
The mass matrix can be revisited in PML3DHexa8.
See also
Assembler::ComputeMassMatrix(), Integrator::ComputeEffectiveStiffness().

Implements Element.

◆ ComputePMLMatrix()

Eigen::MatrixXd PML3DHexa8::ComputePMLMatrix ( )
virtual

Compute the PML history matrix using gauss-integration.

Returns
Matrix with the PML Element matrix.
Note
The PML matrix is none existent for this element.
See also
Assembler::ComputePMLHistoryMatrix(), Integrator::ComputeEffectiveStiffness().

Implements Element.

◆ ComputePMLStretchingFactors()

Eigen::VectorXd PML3DHexa8::ComputePMLStretchingFactors ( const double  ri,
const double  si,
const double  ti,
const double  rho,
const double  mu,
const double  lambda 
) const
private

Evaluates the stretching parameters of PML.

Parameters
riThe i-th Gauss coordinate in the r-axis.
siThe i-th Gauss coordinate in the s-axis.
tiThe i-th Gauss coordinate in the t-axis.
rhoThe material density.
muThe second Lame constant.
lambdaThe first Lame constant.
Returns
Vector with the stretching parameters.

◆ ComputeShapeFunctionMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeShapeFunctionMatrix ( const double  ri,
const double  si,
const double  ti 
) const
private

Evaluates the shape function matrix at a given Gauss point.

Parameters
riThe i-th Gauss coordinate in the r-axis.
siThe i-th Gauss coordinate in the s-axis.
tiThe i-th Gauss coordinate in the t-axis.
Returns
Matrix with the shape function at the Gauss coordinate.

◆ ComputeStiffnessMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeStiffnessMatrix ( )
virtual

Compute the stiffness matrix of the element using gauss-integration.

Returns
Matrix with the Element stiffness matrix.
Note
The stiffness matrix can be revisited in PML3DHexa8.
See also
Assembler::ComputeStiffnessMatrix(), Integrator::ComputeEffectiveStiffness().

Implements Element.

◆ ComputeStrain()

Eigen::VectorXd PML3DHexa8::ComputeStrain ( const Eigen::MatrixXd &  Bij) const
private

Update strain in the element.

Parameters
BijThe strain-displacement matrix.
Returns
Vector with the strain at integration point.

◆ ComputeStrainDisplacementMatrix()

Eigen::MatrixXd PML3DHexa8::ComputeStrainDisplacementMatrix ( const double  ri,
const double  si,
const double  ti,
const Eigen::MatrixXd &  Jij 
) const
private

Evaluates the strain-displacement matrix at a given Gauss point.

Parameters
riThe i-th Gauss coordinate in the r-axis.
siThe i-th Gauss coordinate in the s-axis.
tiThe i-th Gauss coordinate in the t-axis.
JijThe Jacobian matrix evaluated at (ri,si,ti).
Returns
Matrix with the strain-displacement operator.

◆ ComputeStrainRate()

Eigen::VectorXd PML3DHexa8::ComputeStrainRate ( const Eigen::MatrixXd &  Bij) const
private

Update strain rate in the element.

Parameters
BijThe strain-displacement matrix.
Returns
Vector with the strain-rate at integration point.

◆ ComputeSurfaceForces()

Eigen::VectorXd PML3DHexa8::ComputeSurfaceForces ( const std::shared_ptr< Load > &  surface,
unsigned int  face 
)
virtual

Compute the surface forces acting on the element.

Parameters
surfacePointer to the Load object that contains this information.
kThe time step at which the surface load is evaluated.
Returns
Vector with the Element surface force.
Note
The surface force vector can be revisited in ZeroLength1D.
See also
Assembler::ComputeExternalForceVector(), Integrator::ComputeEffectiveForce().

Implements Element.

◆ GetStrain()

Eigen::MatrixXd PML3DHexa8::GetStrain ( ) const
virtual

Gets the material/section (generalised) strain.

Returns
Matrix with the strain at each integration point.
Note
The index (i,j) are the strain and Gauss-point respectively.

Implements Element.

◆ GetStrainAt()

Eigen::MatrixXd PML3DHexa8::GetStrainAt ( double  x3,
double  x2 
) const
virtual

Gets the material strain in section at coordinate (x3,x2).

Parameters
x3Local coordinate along the x3-axis.
x2Local coordinate along the x2-axis.
Returns
Matrix with the strain at coordinate (x3,x2).
Note
The strains are interpolated at this coordinate.

Implements Element.

◆ GetStrainRate()

Eigen::MatrixXd PML3DHexa8::GetStrainRate ( ) const
virtual

Gets the material/section (generalised) strain-rate.

Returns
Matrix with the strain-rate at each integration point.
Note
The index (i,j) are the strain-rate and Gauss-point respectively.

Implements Element.

◆ GetStress()

Eigen::MatrixXd PML3DHexa8::GetStress ( ) const
virtual

Gets the material/section (generalised) stress.

Returns
Matrix with the stress at each integration point.
Note
The index (i,j) are the stress and Gauss-point respectively.

Implements Element.

◆ GetStressAt()

Eigen::MatrixXd PML3DHexa8::GetStressAt ( double  x3,
double  x2 
) const
virtual

Gets the material stress in section at coordinate (x3,x2).

Parameters
x3Local coordinate along the x3-axis.
x2Local coordinate along the x2-axis.
Returns
Matrix with the stresses at coordinate (x3,x2).
Note
The stresses are interpolated at this coordinate.

Implements Element.

◆ GetTotalDegreeOfFreedom()

std::vector<unsigned int> PML3DHexa8::GetTotalDegreeOfFreedom ( ) const
virtual

Gets the list of total-degree of freedom of this Element.

Returns
Vector with the list of degree-of-freedom of this Element.

Implements Element.

◆ GetVTKResponse()

Eigen::VectorXd PML3DHexa8::GetVTKResponse ( std::string  response) const
virtual

Gets the element internal response in VTK format for Paraview display.

Parameters
responseThe response to be display in Paraview.
Returns
Vector with the response at the Element center.
Note
The current responses are: "Strain", "Stress".

Implements Element.

◆ InitialState()

void PML3DHexa8::InitialState ( )
virtual

Brings the material/section state to its initial state in this element.

Note
This function returns the meterial states to the beginning.

Implements Element.

◆ ReverseState()

void PML3DHexa8::ReverseState ( )
virtual

Reverse the material/section states to previous converged state in this element.

Note
This function returns the trial states to previous converged states at the Material level.

Implements Element.

◆ SetDamping()

void PML3DHexa8::SetDamping ( const std::shared_ptr< Damping > &  damping)
virtual

Sets the damping model.

Parameters
dampingPointer to the damping model.
Note
Several Element objects can share the same damping model.

Implements Element.

◆ SetDomain()

void PML3DHexa8::SetDomain ( std::map< unsigned int, std::shared_ptr< Node > > &  nodes)
virtual

Sets the finite element dependance among objects.

Parameters
nodesThe Node list of the Mesh object.
Note
This function sets the relation between Node and Element objects.
See also
lin2DQuad4::theNodes.

Implements Element.

◆ UpdateState()

void PML3DHexa8::UpdateState ( )
virtual

Update the material states in the element.

Note
This function update the trial states at the Material level.

Implements Element.

Member Data Documentation

◆ L_pml

double PML3DHexa8::L_pml
private

Thickness of the PML region.

◆ m_pml

double PML3DHexa8::m_pml
private

Polynomial degree of thePerfectly Match Layer.

◆ nx_pml

double PML3DHexa8::nx_pml
private

Horizontal normal components for x1.

◆ ny_pml

double PML3DHexa8::ny_pml
private

Horizontal normal components for x2.

◆ nz_pml

double PML3DHexa8::nz_pml
private

Vertical normal components for x3.

◆ QuadraturePoints

std::unique_ptr<QuadratureRule> PML3DHexa8::QuadraturePoints
private

Coordinate of Gauss points.

◆ R_pml

double PML3DHexa8::R_pml
private

Reflection coefficient for the PML.

◆ theDamping

std::shared_ptr<Damping> PML3DHexa8::theDamping
private

The Damping model.

◆ theMaterial

std::vector<std::unique_ptr<Material> > PML3DHexa8::theMaterial
private

The Element's material.

◆ theNodes

std::vector<std::shared_ptr<Node> > PML3DHexa8::theNodes
private

The Element's Nodes.

◆ x0_pml

double PML3DHexa8::x0_pml
private

Coordinates x0 of reference point.

◆ y0_pml

double PML3DHexa8::y0_pml
private

Coordinates y0 of reference point.

◆ z0_pml

double PML3DHexa8::z0_pml
private

Coordinates z0 of reference point.