Chi-Tech
chi_math::cell_mapping::LagrangeBaseMapping Class Referenceabstract

#include <LagrangeBaseMapping.h>

Inheritance diagram for chi_math::cell_mapping::LagrangeBaseMapping:
chi_math::CellMapping chi_math::cell_mapping::LagrangeHexMapping chi_math::cell_mapping::LagrangeQuadMapping chi_math::cell_mapping::LagrangeSlabMapping chi_math::cell_mapping::LagrangeTetMapping chi_math::cell_mapping::LagrangeTriangleMapping chi_math::cell_mapping::LagrangeWedgeMapping

Public Member Functions

double ShapeValue (int i, const chi_mesh::Vector3 &xyz) const override
 
void ShapeValues (const chi_mesh::Vector3 &xyz, std::vector< double > &shape_values) const override
 
chi_mesh::Vector3 GradShapeValue (int i, const chi_mesh::Vector3 &xyz) const override
 
void GradShapeValues (const chi_mesh::Vector3 &xyz, std::vector< chi_mesh::Vector3 > &gradshape_values) const override
 
finite_element::VolumetricQuadraturePointData MakeVolumetricQuadraturePointData () const override
 
finite_element::SurfaceQuadraturePointData MakeSurfaceQuadraturePointData (size_t face_index) const override
 
- Public Member Functions inherited from chi_math::CellMapping
const chi_mesh::CellReferenceCell () const
 
const chi_mesh::MeshContinuumReferenceGrid () const
 
size_t NumNodes () const
 
size_t NumFaceNodes (size_t face_index) const
 
const std::vector< std::vector< int > > & GetFaceNodeMappings () const
 
double CellVolume () const
 
double FaceArea (size_t face_index) const
 
int MapFaceNode (size_t face_index, size_t face_node_index) const
 
virtual double ShapeValue (int i, const chi_mesh::Vector3 &xyz) const =0
 
virtual void ShapeValues (const chi_mesh::Vector3 &xyz, std::vector< double > &shape_values) const =0
 
virtual chi_mesh::Vector3 GradShapeValue (int i, const chi_mesh::Vector3 &xyz) const =0
 
virtual void GradShapeValues (const chi_mesh::Vector3 &xyz, std::vector< chi_mesh::Vector3 > &gradshape_values) const =0
 
const std::vector< chi_mesh::Vector3 > & GetNodeLocations () const
 
virtual finite_element::VolumetricQuadraturePointData MakeVolumetricQuadraturePointData () const =0
 
virtual finite_element::SurfaceQuadraturePointData MakeSurfaceQuadraturePointData (size_t face_index) const =0
 
virtual ~CellMapping ()=default
 

Protected Types

typedef chi_mesh::Vector3 Vec3
 
typedef std::vector< double > VecDbl
 
typedef std::vector< VecDblMatDbl
 
- Protected Types inherited from chi_math::CellMapping
typedef std::function< void(const chi_mesh::MeshContinuum &, const chi_mesh::Cell &, double &, std::vector< double > &)> VandAFunction
 

Protected Member Functions

 LagrangeBaseMapping (const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, size_t num_nodes, std::vector< std::vector< int > > face_node_mappings, const Quadrature &volume_quadrature, const Quadrature &surface_quadrature)
 
Vec3 MapWorldXYZToNaturalXYZ (const Vec3 &world_xyz) const
 
virtual double RefShape (uint32_t i, const Vec3 &qpoint) const =0
 
virtual Vec3 RefGradShape (uint32_t i, const Vec3 &qpoint) const =0
 
virtual MatDbl RefJacobian (const Vec3 &qpoint) const =0
 
virtual std::pair< double, Vec3RefFaceJacobianDeterminantAndNormal (size_t face_index, const Vec3 &qpoint_face) const
 
virtual Vec3 FaceToElementQPointConversion (size_t face_index, const Vec3 &qpoint_face) const =0
 
virtual const QuadratureGetSurfaceQuadrature (size_t face_index) const
 
- Protected Member Functions inherited from chi_math::CellMapping
 CellMapping (const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, size_t num_nodes, std::vector< chi_mesh::Vector3 > node_locations, std::vector< std::vector< int > > face_node_mappings, const VandAFunction &volume_area_function)
 

Static Protected Member Functions

static std::vector< chi_mesh::Vector3GetVertexLocations (const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell)
 
static std::vector< std::vector< int > > MakeFaceNodeMapping (const chi_mesh::Cell &cell)
 
- Static Protected Member Functions inherited from chi_math::CellMapping
static void ComputeCellVolumeAndAreas (const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, double &volume, std::vector< double > &areas)
 

Protected Attributes

const Quadraturevolume_quadrature_
 
const Quadraturesurface_quadrature_
 
- Protected Attributes inherited from chi_math::CellMapping
const chi_mesh::MeshContinuumref_grid_
 
const chi_mesh::Cellcell_
 
const size_t num_nodes_
 
const std::vector< chi_mesh::Vector3node_locations_
 
double volume_ = 0.0
 
std::vector< double > areas_
 
const std::vector< std::vector< int > > face_node_mappings_
 

Friends

class WorldXYZToNaturalMappingHelper
 

Detailed Description

Base class for finite elements using Lagrange basis functions.

Definition at line 19 of file LagrangeBaseMapping.h.

Member Typedef Documentation

◆ MatDbl

Definition at line 41 of file LagrangeBaseMapping.h.

◆ Vec3

◆ VecDbl

typedef std::vector<double> chi_math::cell_mapping::LagrangeBaseMapping::VecDbl
protected

Definition at line 40 of file LagrangeBaseMapping.h.

Constructor & Destructor Documentation

◆ LagrangeBaseMapping()

chi_math::cell_mapping::LagrangeBaseMapping::LagrangeBaseMapping ( const chi_mesh::MeshContinuum grid,
const chi_mesh::Cell cell,
size_t  num_nodes,
std::vector< std::vector< int > >  face_node_mappings,
const Quadrature volume_quadrature,
const Quadrature surface_quadrature 
)
protected

Definition at line 13 of file LagrangeBaseMapping.cc.

Member Function Documentation

◆ FaceToElementQPointConversion()

virtual Vec3 chi_math::cell_mapping::LagrangeBaseMapping::FaceToElementQPointConversion ( size_t  face_index,
const Vec3 qpoint_face 
) const
protectedpure virtual

Converts a face quadrature point to a reference element position allowing the reuse of the reference element shape functions. Meant to be overridden by a specific element mapping.

Implemented in chi_math::cell_mapping::LagrangeHexMapping, chi_math::cell_mapping::LagrangeQuadMapping, chi_math::cell_mapping::LagrangeSlabMapping, chi_math::cell_mapping::LagrangeTetMapping, chi_math::cell_mapping::LagrangeTriangleMapping, and chi_math::cell_mapping::LagrangeWedgeMapping.

◆ GetSurfaceQuadrature()

const Quadrature & chi_math::cell_mapping::LagrangeBaseMapping::GetSurfaceQuadrature ( size_t  face_index) const
protectedvirtual

Overrideable method to return the appropriate face quadrature. Default returns surface_quadrature. Some mappings might change quadrature based on the face index.

Reimplemented in chi_math::cell_mapping::LagrangeWedgeMapping.

Definition at line 191 of file LagrangeBaseMapping.cc.

◆ GetVertexLocations()

std::vector< chi_mesh::Vector3 > chi_math::cell_mapping::LagrangeBaseMapping::GetVertexLocations ( const chi_mesh::MeshContinuum grid,
const chi_mesh::Cell cell 
)
staticprotected

Used in the constructor this method simply collects the cell vertices.

Definition at line 76 of file LagrangeBaseMapping.cc.

◆ GradShapeValue()

chi_mesh::Vector3 chi_math::cell_mapping::LagrangeBaseMapping::GradShapeValue ( int  i,
const chi_mesh::Vector3 xyz 
) const
overridevirtual

Returns the value of the required shape function gradient at the world xyz point.

Implements chi_math::CellMapping.

Definition at line 116 of file LagrangeBaseMapping.cc.

◆ GradShapeValues()

void chi_math::cell_mapping::LagrangeBaseMapping::GradShapeValues ( const chi_mesh::Vector3 xyz,
std::vector< chi_mesh::Vector3 > &  gradshape_values 
) const
overridevirtual

Populates all the shape function gradient values at the given world xyz point. This method is optimized to minimize reallocation of gradshape_values.

Implements chi_math::CellMapping.

Definition at line 122 of file LagrangeBaseMapping.cc.

◆ MakeFaceNodeMapping()

std::vector< std::vector< int > > chi_math::cell_mapping::LagrangeBaseMapping::MakeFaceNodeMapping ( const chi_mesh::Cell cell)
staticprotected

Used in the constructor this method maps face node ids to cell ids.

This section just determines a mapping of face dofs to cell dofs. This is pretty simple since we can just loop over each face dof then subsequently loop over cell dofs, if the face dof node index equals the cell dof node index then the mapping is assigned.

This mapping is not used by any of the methods in this class but is used by methods requiring the surface integrals of the shape functions.

Definition at line 41 of file LagrangeBaseMapping.cc.

◆ MakeSurfaceQuadraturePointData()

finite_element::SurfaceQuadraturePointData chi_math::cell_mapping::LagrangeBaseMapping::MakeSurfaceQuadraturePointData ( size_t  face_index) const
overridevirtual

Makes the surface quadrature point data for this element, at the specified face.

Implements chi_math::CellMapping.

Definition at line 197 of file LagrangeBaseMapping.cc.

◆ MakeVolumetricQuadraturePointData()

finite_element::VolumetricQuadraturePointData chi_math::cell_mapping::LagrangeBaseMapping::MakeVolumetricQuadraturePointData ( ) const
overridevirtual

Makes the volumetric/internal quadrature point data for this element.

Implements chi_math::CellMapping.

Definition at line 134 of file LagrangeBaseMapping.cc.

◆ MapWorldXYZToNaturalXYZ()

chi_mesh::Vector3 chi_math::cell_mapping::LagrangeBaseMapping::MapWorldXYZToNaturalXYZ ( const Vec3 world_xyz) const
protected

Function using newton iteration to convert a world_xyz coordinate to a quadrature point coordinate.

Definition at line 89 of file LagrangeBaseMapping.cc.

◆ RefFaceJacobianDeterminantAndNormal()

std::pair< double, LagrangeBaseMapping::Vec3 > chi_math::cell_mapping::LagrangeBaseMapping::RefFaceJacobianDeterminantAndNormal ( size_t  face_index,
const Vec3 qpoint_face 
) const
protectedvirtual

◆ RefGradShape()

virtual Vec3 chi_math::cell_mapping::LagrangeBaseMapping::RefGradShape ( uint32_t  i,
const Vec3 qpoint 
) const
protectedpure virtual

◆ RefJacobian()

virtual MatDbl chi_math::cell_mapping::LagrangeBaseMapping::RefJacobian ( const Vec3 qpoint) const
protectedpure virtual

◆ RefShape()

virtual double chi_math::cell_mapping::LagrangeBaseMapping::RefShape ( uint32_t  i,
const Vec3 qpoint 
) const
protectedpure virtual

◆ ShapeValue()

double chi_math::cell_mapping::LagrangeBaseMapping::ShapeValue ( int  i,
const chi_mesh::Vector3 xyz 
) const
overridevirtual

Returns the value of the required shape function at the world xyz point.

Implements chi_math::CellMapping.

Definition at line 98 of file LagrangeBaseMapping.cc.

◆ ShapeValues()

void chi_math::cell_mapping::LagrangeBaseMapping::ShapeValues ( const chi_mesh::Vector3 xyz,
std::vector< double > &  shape_values 
) const
overridevirtual

Populates all the shape function values at the given world xyz point. This method is optimized to minimize reallocation of shape_values.

Implements chi_math::CellMapping.

Definition at line 105 of file LagrangeBaseMapping.cc.

Friends And Related Function Documentation

◆ WorldXYZToNaturalMappingHelper

friend class WorldXYZToNaturalMappingHelper
friend

Definition at line 38 of file LagrangeBaseMapping.h.

Field Documentation

◆ surface_quadrature_

const Quadrature& chi_math::cell_mapping::LagrangeBaseMapping::surface_quadrature_
protected

Definition at line 93 of file LagrangeBaseMapping.h.

◆ volume_quadrature_

const Quadrature& chi_math::cell_mapping::LagrangeBaseMapping::volume_quadrature_
protected

Definition at line 92 of file LagrangeBaseMapping.h.


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