MeshKit  1.0
EBMesher Class Reference

A meshing geometry as Cartesian structured mesh It makes constructs tree structure with triangles and makes hexes bounding geometry With ray-tracing, find intersections and determine element inside/outside/boundary. Intersection fraction is stored to boundary elements. Element inside/outside/boundary status are stored as tag. More...

#include <meshkit/EBMesher.hpp>

Inheritance diagram for EBMesher:

List of all members.

Public Member Functions

 EBMesher (MKCore *mkcore, const MEntVector &me_vec, double size=-1., bool use_geom=true, int add_layer=3)
 Bare constructor.
virtual ~EBMesher ()
 Destructor.
virtual const moab::EntityType * mesh_types_arr () const
 Return the mesh entity types operated on by this scheme.
virtual bool add_modelent (ModelEnt *model_ent)
 Add a ModelEnt to this operation's MEntSelection The MEntSelection is a map, and can only have a given entity once.
int set_division (double *min, double *max)
 set # of divisions (x/y/z directions) of Cartesian box to use SCDMesh output
virtual void setup_this ()
 Setup is a no-op, but must be provided since it's pure virtual.
virtual void execute_this ()
void get_grid_and_edges_techX (double *boxMin, double *boxMax, int *nDiv, std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellSurfEdge, std::vector< int > &rvnInsideCell, bool isCornerExterior=true)
 query function for techX
bool get_grid_and_edges (double *boxMin, double *boxMax, int *nDiv, std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellEdge, std::vector< int > &rvnInsideCell, bool isCornerExterior=true)
 query function to get multiple cut-cell edges
bool get_volume_fraction (int vol_frac_div)
 get volume fraction for each material
void export_mesh (const char *file_name, bool separate=false)
 export mesh to file
void set_num_interval (int *n_interval)
 set number of intervals
void increase_box (double box_increase)
 set number of intervals
void use_whole_geom (int use)
 set if mesh for whole geometry at once or individually
void use_mesh_geometry (bool use)
 set if mesh based geometry is used
void set_obb_tree_box_dimension ()
 construct obb tree with faceted geometry and set the box max/min coordinates

Static Public Member Functions

static const char * name ()
 Get class name.
static bool can_mesh (iBase_EntityType dim)
 Function returning whether this scheme can mesh entities of t the specified dimension.
static bool can_mesh (ModelEnt *me)
 Function returning whether this scheme can mesh the specified entity.
static const moab::EntityType * output_types ()
 Get list of mesh entity types that can be generated.

Private Member Functions

 EBMesher (const EBMesher &)
 No copy constructor, since there's only meant to be one of these.
MeshOpget_scd_mesher ()
EBMesheroperator= (const EBMesher &)
 No operator=, since there's only meant to be one of these.
EdgeStatus get_edge_status (const double dZ, int &iSkip)
 get hex edge status (inside/outside/boundary)
bool set_neighbor_hex_status (int dir, int i, int j, int k)
 set hex status for neighboring elements
bool set_hex_status (int index, EdgeStatus value, int dir)
bool set_edge_status (int dir)
 set edge status
void set_tag_info ()
 set all produced mesh information as tag \ hex status, edge-cut information.....
void write_mesh (const char *file_name, int type, iBase_EntityHandle *handles, int &n_elem)
 wirte mesh
double get_edge_fraction (int idHex, int dir)
 get edge fraction information
double get_uncut_edge_fraction (int i, int j, int k, int dir)
 get if the edge is fully inside(returns 1) or outside(returns 0)
bool is_shared_overlapped_surf (int index)
 check if the intersected surface geometry is shared or overlapped
bool move_intersections (int n_dir, int n_inter, double start_pnt[3])
 move intersection pairs to check element status
bool get_inside_hex (std::vector< int > &rvnInsideCell)
 get inside status elements
bool is_ray_move_and_set_overlap_surf (bool &bMoveOnce)
 check if ray is passing shared vertices or edges \ And, check if the passing surface is overlapped one
void remove_intersection_duplicates ()
bool export_fraction_edges (std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellSurfEdge)
bool export_fraction_points (std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &mdCutCellEdge)
bool make_edge (double ePnt[6], std::vector< iBase_EntityHandle > &edge_handles)

Private Attributes

iBase_TagHandle m_elemStatusTag
iBase_TagHandle m_edgeCutFracLengthTag
iBase_TagHandle m_edgeCutFracTag
iBase_TagHandle m_volFracLengthTag
iBase_TagHandle m_volFracHandleTag
iBase_TagHandle m_volFracTag
iBase_TagHandle m_bbTag
iMesh_Instance m_mesh
iBase_EntitySetHandle m_hRootSet
std::vector< IntersectDistm_vIntersection
int m_nTri
int m_nHex
int m_iInter
int m_nFraction
int m_iStartHex
int m_nMove
int m_nAddLayer
int m_nIteration
int m_iOverlap
int m_iElem
int m_nNode [3]
int m_nDiv [3]
int m_iFirstP
int m_iSecondP
double m_dFirstP
double m_dSecondP
double m_curPnt
double m_prevPnt
double m_boxIncrease
double m_dIntervalSize [3]
double m_origin_coords [3]
double m_dInputSize
double m_min [3]
double m_max [3]
EdgeStatus m_nStatus
bool m_bMovedOnce
bool m_bUseGeom
bool m_bUseWholeGeom
bool m_bUseMeshGeom
std::vector< iBase_EntityHandle > m_vhVertex
std::vector< int > m_vnHexStatus
std::map< int, CutFractionm_mdCutFraction
std::vector< EdgeStatusm_vnEdgeStatus [3]

Static Private Attributes

static int init
 Static variable, used in registration.

Detailed Description

A meshing geometry as Cartesian structured mesh It makes constructs tree structure with triangles and makes hexes bounding geometry With ray-tracing, find intersections and determine element inside/outside/boundary. Intersection fraction is stored to boundary elements. Element inside/outside/boundary status are stored as tag.

Examples:
example_ebmesh.cpp.

Definition at line 122 of file EBMesher.hpp.


Constructor & Destructor Documentation

EBMesher ( MKCore mkcore,
const MEntVector me_vec,
double  size = -1.,
bool  use_geom = true,
int  add_layer = 3 
)

Bare constructor.

Definition at line 46 of file EBMesher.cpp.

~EBMesher ( ) [virtual]

Destructor.

Definition at line 97 of file EBMesher.cpp.

EBMesher ( const EBMesher ) [private]

No copy constructor, since there's only meant to be one of these.


Member Function Documentation

bool add_modelent ( ModelEnt model_ent) [virtual]

Add a ModelEnt to this operation's MEntSelection The MEntSelection is a map, and can only have a given entity once.

Parameters:
model_entModelEnt being added
Returns:
Returns true if model_ent was actually added, false otherwise

Reimplemented from MeshOp.

Definition at line 108 of file EBMesher.cpp.

static bool can_mesh ( iBase_EntityType  dim) [inline, static]

Function returning whether this scheme can mesh entities of t the specified dimension.

Parameters:
dimentity dimension

Definition at line 142 of file EBMesher.hpp.

bool can_mesh ( ModelEnt me) [static]

Function returning whether this scheme can mesh the specified entity.

Used by MeshOpFactory to find scheme for an entity.

Parameters:
meModelEnt being queried
Returns:
If true, this scheme can mesh the specified ModelEnt

Definition at line 102 of file EBMesher.cpp.

void execute_this ( ) [virtual]

\ The only setup/execute function we need, since meshing vertices is trivial

Implements GraphNode.

Definition at line 189 of file EBMesher.cpp.

bool export_fraction_edges ( std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &  rmdCutCellSurfEdge) [private]
bool export_fraction_points ( std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &  mdCutCellEdge) [private]
void export_mesh ( const char *  file_name,
bool  separate = false 
)

export mesh to file

Parameters:
file_nameexport file name
separateexport file separately(inside/outside/boundary)
Examples:
example_ebmesh.cpp.
double get_edge_fraction ( int  idHex,
int  dir 
) [private]

get edge fraction information

Parameters:
idHexindex in m_mdCutFraction
dirray direction
Returns:
double edge fraction
EdgeStatus get_edge_status ( const double  dZ,
int &  iSkip 
) [private]

get hex edge status (inside/outside/boundary)

Parameters:
dZedge end coordinate
iSkiphow many index skipped for next intersection checking
Returns:
EdgeStatus edge status

Definition at line 464 of file EBMesher.cpp.

bool get_grid_and_edges ( double *  boxMin,
double *  boxMax,
int *  nDiv,
std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &  rmdCutCellEdge,
std::vector< int > &  rvnInsideCell,
bool  isCornerExterior = true 
)

query function to get multiple cut-cell edges

Parameters:
boxMinCartesian box min coordinates returned
boxMaxCartesian box max coordinates returned
nDivnDiv(x/yz directions) returned
rmdCutCellEdgemap of cut-cell surface index and edge cut information returned
rvnInsideCellInside elements returned
isCornerExteriorif box corner is exterior returned
Returns:
if this function is working correctly
Examples:
example_ebmesh.cpp.
void get_grid_and_edges_techX ( double *  boxMin,
double *  boxMax,
int *  nDiv,
std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &  rmdCutCellSurfEdge,
std::vector< int > &  rvnInsideCell,
bool  isCornerExterior = true 
)

query function for techX

Parameters:
boxMinCartesian box min coordinates returned
boxMaxCartesian box max coordinates returned
nDivnDiv(x/yz directions) returned
rmdCutCellSurfEdgemap of cut-cell surface index and edge cut information returned
rvnInsideCellInside elements returned
isCornerExteriorif box corner is exterior returned
Examples:
example_ebmesh.cpp.
bool get_inside_hex ( std::vector< int > &  rvnInsideCell) [private]

get inside status elements

Parameters:
rvnInsideCellcell indices (i,j,k triple)
Returns:
bool if is working correctly
MeshOp * get_scd_mesher ( ) [private]

Definition at line 117 of file EBMesher.cpp.

double get_uncut_edge_fraction ( int  i,
int  j,
int  k,
int  dir 
) [private]

get if the edge is fully inside(returns 1) or outside(returns 0)

Parameters:
iindex for i direction
jindex for j direction
kindex for k direction
dirray direction
Returns:
double edge fraction

Definition at line 1585 of file EBMesher.cpp.

bool get_volume_fraction ( int  vol_frac_div)

get volume fraction for each material

Parameters:
vol_frac_divresolution to get volume fraction
Returns:
if this function is working correctly
Examples:
example_ebmesh.cpp.

Definition at line 1760 of file EBMesher.cpp.

void increase_box ( double  box_increase) [inline]

set number of intervals

Parameters:
box_increasenumber of interval array for x/y/z directions
Examples:
example_ebmesh.cpp.

Definition at line 494 of file EBMesher.hpp.

bool is_ray_move_and_set_overlap_surf ( bool &  bMoveOnce) [private]

check if ray is passing shared vertices or edges \ And, check if the passing surface is overlapped one

Parameters:
bMoveOnceif ray is already moved before
Returns:
bool if is working correctly

Definition at line 1683 of file EBMesher.cpp.

bool is_shared_overlapped_surf ( int  index) [private]

check if the intersected surface geometry is shared or overlapped

Parameters:
indexintersection index in m_vIntersection vector
Returns:
bool if is working correctly
bool make_edge ( double  ePnt[6],
std::vector< iBase_EntityHandle > &  edge_handles 
) [private]
virtual const moab::EntityType* mesh_types_arr ( ) const [inline, virtual]

Return the mesh entity types operated on by this scheme.

Returns:
array terminated with moab::MBMAXTYPE

Implements MeshOp.

Definition at line 161 of file EBMesher.hpp.

bool move_intersections ( int  n_dir,
int  n_inter,
double  start_pnt[3] 
) [private]

move intersection pairs to check element status

Parameters:
n_dirray direction
n_interindex of intersection points
start_pntray starting point
Returns:
bool if is working correctly
static const char* name ( ) [inline, static]

Get class name.

Definition at line 135 of file EBMesher.hpp.

EBMesher& operator= ( const EBMesher ) [private]

No operator=, since there's only meant to be one of these.

const moab::EntityType * output_types ( ) [static]

Get list of mesh entity types that can be generated.

Returns:
array terminated with moab::MBMAXTYPE

Definition at line 43 of file EBMesher.cpp.

void remove_intersection_duplicates ( ) [private]

Definition at line 1730 of file EBMesher.cpp.

int set_division ( double *  min,
double *  max 
)

set # of divisions (x/y/z directions) of Cartesian box to use SCDMesh output

Parameters:
minCartesian box min coordinates
maxCartesian box max coordinates
Returns:
int if is working correctly
bool set_edge_status ( int  dir) [private]

set edge status

Parameters:
dirray direction
Returns:
bool if is working correctly

Definition at line 596 of file EBMesher.cpp.

bool set_hex_status ( int  index,
EdgeStatus  value,
int  dir 
) [private]

\ brief set hex status by edge status

Parameters:
indexhex index in m_vnHexStatus vector
valueedge status
dirray direction
Returns:
bool if is working correctly

Definition at line 575 of file EBMesher.cpp.

bool set_neighbor_hex_status ( int  dir,
int  i,
int  j,
int  k 
) [private]

set hex status for neighboring elements

Parameters:
dircurrent fired ray direction
iindex for i direction
jindex for j direction
kindex for k direction
Returns:
bool if is working correctly

Definition at line 537 of file EBMesher.cpp.

void set_num_interval ( int *  n_interval)

set number of intervals

Parameters:
n_intervalnumber of interval array for x/y/z directions
Examples:
example_ebmesh.cpp.

Definition at line 263 of file EBMesher.cpp.

construct obb tree with faceted geometry and set the box max/min coordinates

Examples:
example_ebmesh.cpp.
void set_tag_info ( ) [private]

set all produced mesh information as tag \ hex status, edge-cut information.....

void setup_this ( ) [virtual]

Setup is a no-op, but must be provided since it's pure virtual.

Implements GraphNode.

Definition at line 125 of file EBMesher.cpp.

void use_mesh_geometry ( bool  use) [inline]

set if mesh based geometry is used

Parameters:
useif mesh based geometry is used
Examples:
example_ebmesh.cpp.

Definition at line 504 of file EBMesher.hpp.

void use_whole_geom ( int  use) [inline]

set if mesh for whole geometry at once or individually

Parameters:
useif mesh for whole geometry at once
Examples:
example_ebmesh.cpp.

Definition at line 499 of file EBMesher.hpp.

void write_mesh ( const char *  file_name,
int  type,
iBase_EntityHandle *  handles,
int &  n_elem 
) [private]

wirte mesh

Parameters:
file_name
typeelement type (inside:0, outside:1, boundary:2)
handleselement handles
n_elem# of elements
Returns:
int if is working correctly

Member Data Documentation

int init [static, private]

Static variable, used in registration.

Definition at line 373 of file EBMesher.hpp.

iBase_TagHandle m_bbTag [private]

Definition at line 255 of file EBMesher.hpp.

bool m_bMovedOnce [private]

Definition at line 267 of file EBMesher.hpp.

double m_boxIncrease [private]

Definition at line 263 of file EBMesher.hpp.

bool m_bUseGeom [private]

Definition at line 267 of file EBMesher.hpp.

bool m_bUseMeshGeom [private]

Definition at line 267 of file EBMesher.hpp.

bool m_bUseWholeGeom [private]

Definition at line 267 of file EBMesher.hpp.

double m_curPnt [private]

Definition at line 263 of file EBMesher.hpp.

double m_dFirstP [private]

Definition at line 263 of file EBMesher.hpp.

double m_dInputSize [private]

Definition at line 263 of file EBMesher.hpp.

double m_dIntervalSize[3] [private]

Definition at line 263 of file EBMesher.hpp.

double m_dSecondP [private]

Definition at line 263 of file EBMesher.hpp.

iBase_TagHandle m_edgeCutFracLengthTag [private]

Definition at line 255 of file EBMesher.hpp.

iBase_TagHandle m_edgeCutFracTag [private]

Definition at line 255 of file EBMesher.hpp.

iBase_TagHandle m_elemStatusTag [private]

Definition at line 255 of file EBMesher.hpp.

iBase_EntitySetHandle m_hRootSet [private]

Definition at line 258 of file EBMesher.hpp.

int m_iElem [private]

Definition at line 260 of file EBMesher.hpp.

int m_iFirstP [private]

Definition at line 260 of file EBMesher.hpp.

int m_iInter [private]

Definition at line 260 of file EBMesher.hpp.

int m_iOverlap [private]

Definition at line 260 of file EBMesher.hpp.

int m_iSecondP [private]

Definition at line 260 of file EBMesher.hpp.

int m_iStartHex [private]

Definition at line 260 of file EBMesher.hpp.

double m_max[3] [private]

Definition at line 263 of file EBMesher.hpp.

std::map<int, CutFraction> m_mdCutFraction [private]

Definition at line 270 of file EBMesher.hpp.

iMesh_Instance m_mesh [private]

Definition at line 257 of file EBMesher.hpp.

double m_min[3] [private]

Definition at line 263 of file EBMesher.hpp.

int m_nAddLayer [private]

Definition at line 260 of file EBMesher.hpp.

int m_nDiv[3] [private]

Definition at line 260 of file EBMesher.hpp.

int m_nFraction [private]

Definition at line 260 of file EBMesher.hpp.

int m_nHex [private]

Definition at line 260 of file EBMesher.hpp.

int m_nIteration [private]

Definition at line 260 of file EBMesher.hpp.

int m_nMove [private]

Definition at line 260 of file EBMesher.hpp.

int m_nNode[3] [private]

Definition at line 260 of file EBMesher.hpp.

EdgeStatus m_nStatus [private]

Definition at line 266 of file EBMesher.hpp.

int m_nTri [private]

Definition at line 260 of file EBMesher.hpp.

double m_origin_coords[3] [private]

Definition at line 263 of file EBMesher.hpp.

double m_prevPnt [private]

Definition at line 263 of file EBMesher.hpp.

std::vector<iBase_EntityHandle> m_vhVertex [private]

Definition at line 268 of file EBMesher.hpp.

std::vector<IntersectDist> m_vIntersection [private]

Definition at line 259 of file EBMesher.hpp.

std::vector<EdgeStatus> m_vnEdgeStatus[3] [private]

Definition at line 271 of file EBMesher.hpp.

std::vector<int> m_vnHexStatus [private]

Definition at line 269 of file EBMesher.hpp.

iBase_TagHandle m_volFracHandleTag [private]

Definition at line 255 of file EBMesher.hpp.

iBase_TagHandle m_volFracLengthTag [private]

Definition at line 255 of file EBMesher.hpp.

iBase_TagHandle m_volFracTag [private]

Definition at line 255 of file EBMesher.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines