LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
lf::refinement Namespace Reference

tools for regular or local refinement of 2D hybrid meshes More...

Classes

struct  CellChildInfo
 Information about the refinement status of a cell. More...
 
struct  EdgeChildInfo
 Information about the refinement status of an edge. More...
 
class  EntityCenterPositionSelector
 Utility class: selection of entities according to the position of their midpoint. More...
 
class  Hybrid2DRefinementPattern
 Class containing information about the refinement of a cell. More...
 
class  MeshFunctionTransfer
 A MeshFunction representing interpolation on a lf::refinement::MeshHierarchy. More...
 
class  MeshHierarchy
 A hierarchy of nested 2D hybrid meshes created by refinement. More...
 
struct  ParentInfo
 Information about possible parent entities. More...
 
struct  PointChildInfo
 Information about the refinement status of a point. More...
 

Enumerations

enum  RefPat : int {
  rp_nil , rp_copy , rp_split , rp_bisect ,
  rp_trisect , rp_trisect_left , rp_quadsect , rp_threeedge ,
  rp_regular , rp_barycentric
}
 (possibly incomplete) list of refinement patterns for triangles/quadrilaterals More...
 

Functions

std::ostream & operator<< (std::ostream &o, const RefPat &refpat)
 
template<typename MF >
 MeshFunctionTransfer (const lf::refinement::MeshHierarchy &, const MF &, lf::base::size_type, lf::base::size_type) -> MeshFunctionTransfer< MF >
 
bool checkValidIndex (const std::vector< glb_idx_t > &idx_vec)
 
std::shared_ptr< MeshHierarchyGenerateMeshHierarchyByUniformRefinemnt (const std::shared_ptr< lf::mesh::Mesh > &mesh_p, lf::base::size_type ref_lev, RefPat ref_pat=RefPat::rp_regular)
 Generated a sequence of nested 2D hybrid mehes by regular or barycentric refinement.
 
int normalize_idx (glb_idx_t idx)
 
void WriteMatlabLevel (const MeshHierarchy &hier_mesh, size_type level, std::string filename)
 Generate MATLAB function providing parent/child information.
 
void WriteMatlab (const MeshHierarchy &hier_mesh, const std::string &basename)
 Generate MATLAB code describing a multilevel hierarchy of meshes.
 

Variables

const unsigned int idx_nil = lf::base::kIdxNil
 

Detailed Description

tools for regular or local refinement of 2D hybrid meshes

LehrFEM++ supports the local refinement of hybrid meshes ensuring mesh conformity in the process. Edge marking is used to single out cells that must be refined. Other cells may also undergo refinement in order to avoid hanging nodes.

Enumeration Type Documentation

◆ RefPat

(possibly incomplete) list of refinement patterns for triangles/quadrilaterals

Non-symmetric refinement patterns have to be complemented by a subentity index of an edge, here called the anchor of the refinement.

The only symmetric refinement patterns are regular refinement and barycentric refinement.

A refinement pattern has to be passed as first argument to the member function geometry::Geometry::ChildGeometry() of a lf::geometry::Geometry object.

Enumerator
rp_nil 

no refinement

rp_copy 

just copy the geometry of the current entity

rp_split 

for edges: split into two halves

rp_bisect 

single bisection, splitting refinement edge

rp_trisect 

double bisection

rp_trisect_left 

double bisection, other triangle in second step

rp_quadsect 

triple bisection, starting at edge 0

rp_threeedge 

split quad into one half and three triangles

rp_regular 

standard "full" (regular) refinement

rp_barycentric 

barycentric refinement

Definition at line 35 of file hybrid2d_refinement_pattern.h.

Function Documentation

◆ checkValidIndex()

bool lf::refinement::checkValidIndex ( const std::vector< glb_idx_t > & idx_vec)

Definition at line 17 of file mesh_hierarchy.cc.

References idx_nil.

◆ GenerateMeshHierarchyByUniformRefinemnt()

std::shared_ptr< MeshHierarchy > lf::refinement::GenerateMeshHierarchyByUniformRefinemnt ( const std::shared_ptr< lf::mesh::Mesh > & mesh_p,
lf::base::size_type ref_lev,
RefPat ref_pat = RefPat::rp_regular )

Generated a sequence of nested 2D hybrid mehes by regular or barycentric refinement.

Parameters
mesh_ppointer to the coarsest mesh, from which refinment will start
ref_levdesired number of refinement steps
ref_patat selector for type of uniform refinement: default is rp_regular, rp_barycentric choses barycentric refinement.
Returns
shared pointer to a MeshHierarchy object.

Relies on lf::mesh::hybrid2d::MeshFactory as builder class for mesh entities. Invokes the method MeshHierarhy::RefineRegular() for refinement.

Definition at line 1917 of file mesh_hierarchy.cc.

◆ MeshFunctionTransfer()

template<typename MF >
lf::refinement::MeshFunctionTransfer ( const lf::refinement::MeshHierarchy & ,
const MF & ,
lf::base::size_type ,
lf::base::size_type  ) -> MeshFunctionTransfer< MF >

◆ normalize_idx()

int lf::refinement::normalize_idx ( glb_idx_t idx)
inline

Definition at line 14 of file refutils.cc.

References idx_nil.

Referenced by WriteMatlabLevel().

◆ operator<<()

std::ostream & lf::refinement::operator<< ( std::ostream & o,
const RefPat & refpat )

◆ WriteMatlab()

void lf::refinement::WriteMatlab ( const MeshHierarchy & hier_mesh,
const std::string & basename )

Generate MATLAB code describing a multilevel hierarchy of meshes.

Parameters
hier_meshreference to a valid MeshHierarchy object
basenamebasename of the filename for output file, of which there will be several

Definition at line 82 of file refutils.cc.

References lf::refinement::MeshHierarchy::getMesh(), lf::refinement::MeshHierarchy::NumLevels(), lf::io::writeMatlab(), and WriteMatlabLevel().

◆ WriteMatlabLevel()

void lf::refinement::WriteMatlabLevel ( const MeshHierarchy & hier_mesh,
size_type level,
std::string filename )

Generate MATLAB function providing parent/child information.

Parameters
hier_meshreference to a valid MeshHierarchy object
levelrefinement level to be output
filenameoutput file in which to store the MATLAB code

Definition at line 20 of file refutils.cc.

References lf::refinement::MeshHierarchy::getMesh(), normalize_idx(), lf::refinement::MeshHierarchy::ParentInfos(), and lf::refinement::MeshHierarchy::RefinementEdges().

Referenced by WriteMatlab().

Variable Documentation

◆ idx_nil

const unsigned int lf::refinement::idx_nil = lf::base::kIdxNil