MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::Refinement Struct Reference

#include <ncmesh.hpp>

Public Types

enum  : char {
  X = 1 , Y = 2 , Z = 4 , XY = 3 ,
  XZ = 5 , YZ = 6 , XYZ = 7
}
 
using ScaledType = std::pair<char, real_t>
 

Public Member Functions

 Refinement ()=default
 Refinement scale in each dimension.
 
 Refinement (int index)
 Refinement type XYZ, with scale 0.5.
 
 Refinement (int index, const std::initializer_list< ScaledType > &refs)
 Default case of empty list refs is XYZ with scale 0.5.
 
 Refinement (int index, char type, real_t scale=0.5)
 Refine element with a single type and scale in all dimensions.
 
char GetType () const
 Return the type as char.
 
void Set (int element, char type, real_t scale=0.5)
 Set the element, type, and scale.
 
void SetType (char type, real_t scale=0.5)
 Set the type and scale, assuming the element is already set.
 
void SetScaleForType (const real_t *scale)
 Set the scale in the directions for the currently set type.
 

Public Attributes

int index
 Mesh element number.
 
real_t s [3]
 

Detailed Description

Represents the index of an element to refine, plus a refinement type. The refinement type is needed for anisotropic refinement of quads and hexes. Bits 0,1 and 2 of 'ref_type' specify whether the element should be split in the X, Y and Z directions, respectively (Z is ignored for quads). The refinement spacing or scale in each direction is a number in (0,1), with the default 0.5 meaning bisection. This linear scale parameter defines the position of the refinement between the beginning (0) and end (1) of the reference element in each direction.

Definition at line 40 of file ncmesh.hpp.

Member Typedef Documentation

◆ ScaledType

using mfem::Refinement::ScaledType = std::pair<char, real_t>

Definition at line 44 of file ncmesh.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : char
Enumerator
XY 
XZ 
YZ 
XYZ 

Definition at line 43 of file ncmesh.hpp.

Constructor & Destructor Documentation

◆ Refinement() [1/4]

mfem::Refinement::Refinement ( )
default

Refinement scale in each dimension.

◆ Refinement() [2/4]

mfem::Refinement::Refinement ( int index)

Refinement type XYZ, with scale 0.5.

Definition at line 547 of file ncmesh.cpp.

◆ Refinement() [3/4]

mfem::Refinement::Refinement ( int index,
const std::initializer_list< ScaledType > & refs )

Default case of empty list refs is XYZ with scale 0.5.

Definition at line 555 of file ncmesh.cpp.

◆ Refinement() [4/4]

mfem::Refinement::Refinement ( int index,
char type,
real_t scale = 0.5 )

Refine element with a single type and scale in all dimensions.

Definition at line 573 of file ncmesh.cpp.

Member Function Documentation

◆ GetType()

char mfem::Refinement::GetType ( ) const

Return the type as char.

Definition at line 580 of file ncmesh.cpp.

◆ Set()

void mfem::Refinement::Set ( int element,
char type,
real_t scale = 0.5 )

Set the element, type, and scale.

Definition at line 589 of file ncmesh.cpp.

◆ SetScaleForType()

void mfem::Refinement::SetScaleForType ( const real_t * scale)

Set the scale in the directions for the currently set type.

Uses scale in all dimensions

Definition at line 540 of file ncmesh.cpp.

◆ SetType()

void mfem::Refinement::SetType ( char type,
real_t scale = 0.5 )

Set the type and scale, assuming the element is already set.

Uses scale in all dimensions

Definition at line 596 of file ncmesh.cpp.

Member Data Documentation

◆ index

int mfem::Refinement::index

Mesh element number.

Definition at line 42 of file ncmesh.hpp.

◆ s

real_t mfem::Refinement::s[3]

Definition at line 45 of file ncmesh.hpp.


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