A 3D cell: hexahedron. More...

#include <cell3D.hh>

Inheritance diagram for concepts::Hexahedron3d:
concepts::Cell3 concepts::Cell concepts::OutputOperator

Classes

struct  Index
 Subclass of Hexahedron3d representing its index. More...
 

Public Types

typedef uint index_type
 

Public Member Functions

Real3d center () const
 Returns the center of the cell. More...
 
Real3d chi (Real xi, Real eta, Real zeta) const
 The element map. More...
 
virtual Hexahedron3dchild (uint i)
 Returns a pointer to the ith child. More...
 
virtual const Hexahedron3dchild (uint i) const
 Returns a pointer to the ith child. More...
 
Hexahedronconnector () const
 Returns the connector. More...
 
virtual Real3d elemMap (const Real coord_local) const
 Element map from point local coordinates in 1D. More...
 
virtual Real3d elemMap (const Real2d &coord_local) const
 Element map from point local coordinates in 2D. More...
 
Real3d elemMap (const Real3d &coord_local) const
 Element map from point local coordinates in 3D. More...
 
MappingQuad3d * faceMap (uint face) const
 Returns the mapping of a face. More...
 
const Hex3dSubdivisiongetStrategy () const
 Returns the subdivision strategy of this hexahedron. More...
 
bool hasChildren () const
 Returns true if there is a least one child. More...
 
MapReal3d hessian (const uint i, const concepts::Real3d &p) const
 
MapReal3d hessian (const uint i, const Real xi, const Real eta, const Real zeta) const
 
 Hexahedron3d (Hexahedron &cntr, const MappingHexahedron3d &map)
 Constructor. More...
 
MapReal3d jacobian (const concepts::Real3d &p) const
 
MapReal3d jacobian (const Real xi, const Real eta, const Real zeta) const
 Computes the Jacobian for xi, eta, zeta $\in [0,1]$. More...
 
Real jacobianDeterminant (const Real xi, const Real eta, const Real zeta) const
 Returns the determinant of the Jacobian for xi, eta, zeta $\in [0,1]$. More...
 
MapReal3d jacobianInverse (const Real xi, const Real eta, const Real zeta) const
 Returns the inverse of the Jacobian for xi, eta, zeta $\in [0,1]$. More...
 
const Level< 3 > & level () const
 Returns the level of the cell. More...
 
const MappingHexahedron3dmap () const
 Returns the element map. More...
 
void setStrategy (const Hex3dSubdivision *strategy=0) throw (StrategyChange)
 Sets the subdivision strategy of this hexahedron. More...
 
Real3d vertex (uint i) const
 Returns the coordinates of the ith vertex. More...
 
virtual ~Hexahedron3d ()
 

Static Public Attributes

static uint MAX_LEVEL
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Private Member Functions

 Hexahedron3d (Hexahedron &cntr, MappingHexahedron3d *map, const Index &idx)
 Private constructor. More...
 

Private Attributes

Hexahedron3dchld_
 Pointer to the first child. More...
 
Hexahedroncntr_
 Reference to the hexahedron connector (topology) More...
 
Index idx_
 Index of this element. More...
 
Hexahedron3dlnk_
 Pointer to a sibling. More...
 
MappingHexahedron3dmap_
 Pointer to the element map. More...
 
const Hex3dSubdivisionsubdivStrategy_
 Subdivision strategy for the hexahedron. More...
 

Friends

class Hex3dSubdiv2x
 
class Hex3dSubdiv2y
 
class Hex3dSubdiv2z
 
class Hex3dSubdiv4x
 
class Hex3dSubdiv4y
 
class Hex3dSubdiv4z
 
class Hex3dSubdiv8
 
class Hex3dSubdivision
 
std::ostream & operator<< (std::ostream &os, const Hexahedron3d::Index &i)
 

Detailed Description

A 3D cell: hexahedron.

This cell contains a reference to the topological information of the hexahedron in cntr_. If a hexahedron is subdivided, two, four or eight new hexahedra are created. This happens automatically, if a child is requested, depending on the strategy that has been set.

The faces of the hexahedron have the following local coordinates in the element:

  • face 0 (bottom): z = 0
  • face 1 (front): y = 0
  • face 2 (right): x = 1
  • face 3 (back): y = 1
  • face 4 (left): x = 0
  • face 5 (top): z = 1
Examples
meshes.cc.

Definition at line 317 of file cell3D.hh.

Member Typedef Documentation

◆ index_type

Definition at line 333 of file cell3D.hh.

Constructor & Destructor Documentation

◆ Hexahedron3d() [1/2]

concepts::Hexahedron3d::Hexahedron3d ( Hexahedron cntr,
const MappingHexahedron3d map 
)

Constructor.

Takes the connector cntr and the element map map and creates a cell.

Parameters
cntrTopological information of the hexadron
mapElement map of the hexahedron

◆ ~Hexahedron3d()

virtual concepts::Hexahedron3d::~Hexahedron3d ( )
virtual

◆ Hexahedron3d() [2/2]

concepts::Hexahedron3d::Hexahedron3d ( Hexahedron cntr,
MappingHexahedron3d map,
const Index idx 
)
private

Private constructor.

Member Function Documentation

◆ center()

Real3d concepts::Hexahedron3d::center ( ) const
inlinevirtual

Returns the center of the cell.

Implements concepts::Cell3.

Definition at line 456 of file cell3D.hh.

◆ chi()

Real3d concepts::Hexahedron3d::chi ( Real  xi,
Real  eta,
Real  zeta 
) const

The element map.

Maps a point from the unit cube $[0,1]^3$ onto the element.

Returns
Point in 3D in physical coordinates.
Parameters
xi$\in [0,1]$
eta$\in [0,1]$
zeta$\in [0,1]$

◆ child() [1/2]

virtual Hexahedron3d* concepts::Hexahedron3d::child ( uint  i)
virtual

Returns a pointer to the ith child.

Children are created if they do not already exist.

Implements concepts::Cell3.

◆ child() [2/2]

virtual const Hexahedron3d* concepts::Hexahedron3d::child ( uint  i) const
virtual

Returns a pointer to the ith child.

Children are not created if they do not already exist, instead 0 is returned.

Implements concepts::Cell3.

◆ connector()

Hexahedron& concepts::Hexahedron3d::connector ( ) const
inlinevirtual

Returns the connector.

Implements concepts::Cell3.

Definition at line 382 of file cell3D.hh.

◆ elemMap() [1/3]

virtual Real3d concepts::Cell::elemMap ( const Real  coord_local) const
virtualinherited

Element map from point local coordinates in 1D.

Reimplemented in concepts::Edge2d, concepts::Edge1d, concepts::Sphere3d, and concepts::SphericalSurface3d.

◆ elemMap() [2/3]

virtual Real3d concepts::Cell::elemMap ( const Real2d coord_local) const
virtualinherited

◆ elemMap() [3/3]

Real3d concepts::Hexahedron3d::elemMap ( const Real3d coord_local) const
inlinevirtual

Element map from point local coordinates in 3D.

Reimplemented from concepts::Cell.

Definition at line 394 of file cell3D.hh.

◆ faceMap()

MappingQuad3d* concepts::Hexahedron3d::faceMap ( uint  face) const

Returns the mapping of a face.

Constructs a cell for a face of this Hexahedron.

◆ getStrategy()

const Hex3dSubdivision* concepts::Hexahedron3d::getStrategy ( ) const
inline

Returns the subdivision strategy of this hexahedron.

If you want to find check against another strategy use

hex.getStrategy() == Hex3dSubdiv4x::instance()

Definition at line 486 of file cell3D.hh.

◆ hasChildren()

bool concepts::Cell::hasChildren ( ) const
inlineinherited

Returns true if there is a least one child.

Definition at line 50 of file cell.hh.

◆ hessian() [1/2]

MapReal3d concepts::Hexahedron3d::hessian ( const uint  i,
const concepts::Real3d p 
) const

◆ hessian() [2/2]

MapReal3d concepts::Hexahedron3d::hessian ( const uint  i,
const Real  xi,
const Real  eta,
const Real  zeta 
) const

◆ info()

virtual std::ostream& concepts::Hexahedron3d::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Implements concepts::Cell.

◆ jacobian() [1/2]

MapReal3d concepts::Hexahedron3d::jacobian ( const concepts::Real3d p) const

◆ jacobian() [2/2]

MapReal3d concepts::Hexahedron3d::jacobian ( const Real  xi,
const Real  eta,
const Real  zeta 
) const

Computes the Jacobian for xi, eta, zeta $\in [0,1]$.

The Jacobian of a cell in the initial mesh is computed by the element map. The Jacobian of a subdivided cell is computed as follows. Let $H : \hat K \rightarrow \hat K'$ be the subdivision map in the reference coordinates (0,1)3 and $F_K : \hat K \rightarrow K$, $F_{K'} : \hat K \rightarrow K'$ the element maps of K and K' respectively. Then,

\[F_K : \hat K' \rightarrow K' \quad \text{and} \quad F_K \circ H = F_{K'}. \]

The subdivision map H in reference coordinates is

\[H : \vec\xi \mapsto \begin{pmatrix} a & 0 & 0 \\ 0 & b & 0 \\ 0 & 0 & c \end{pmatrix} \vec \xi \]

where $a = 2^{-l_0}$, $b = 2^{-l_1}$, $c = 2^{-l_2}$ $\vec l = (l_0, l_1, l_2)$ is the level of the cell with respect to the cell in the initial mesh. The derivative of H is $dH = \begin{pmatrix} a & 0 & 0 \\ 0 & b & 0 \\ 0 & 0 & c \end{pmatrix}$.

Then, the Jacobian of $F_{K'}$ is

\[dF_{K'} = dF_K \circ H \cdot dH. \]

The part $dF_K \circ H$ (without H) is computed by the element map and the part $\cdot dH$ is computed in jacobian().

◆ jacobianDeterminant()

Real concepts::Hexahedron3d::jacobianDeterminant ( const Real  xi,
const Real  eta,
const Real  zeta 
) const
inline

Returns the determinant of the Jacobian for xi, eta, zeta $\in [0,1]$.

Definition at line 447 of file cell3D.hh.

◆ jacobianInverse()

MapReal3d concepts::Hexahedron3d::jacobianInverse ( const Real  xi,
const Real  eta,
const Real  zeta 
) const
inline

Returns the inverse of the Jacobian for xi, eta, zeta $\in [0,1]$.

Definition at line 439 of file cell3D.hh.

◆ level()

const Level<3>& concepts::Hexahedron3d::level ( ) const
inline

Returns the level of the cell.

Definition at line 453 of file cell3D.hh.

◆ map()

const MappingHexahedron3d* concepts::Hexahedron3d::map ( ) const
inline

Returns the element map.

Definition at line 459 of file cell3D.hh.

◆ setStrategy()

void concepts::Hexahedron3d::setStrategy ( const Hex3dSubdivision strategy = 0)
throw (StrategyChange
)

Sets the subdivision strategy of this hexahedron.

If the parameter is set to 0 (or if the method is called without parameter) the strategy is set to the default (if not already set). The default subdivision strategy is subdivision into 8 children.

  @param strategy Pointer to an instance of a subdivision strategy.
Exceptions
StrategyChangeif the change is not allowed (the change is not allowed if there are children present or the topological strategy is set).

◆ vertex()

Real3d concepts::Hexahedron3d::vertex ( uint  i) const
virtual

Returns the coordinates of the ith vertex.

Implements concepts::Cell3.

Friends And Related Function Documentation

◆ Hex3dSubdiv2x

friend class Hex3dSubdiv2x
friend

Definition at line 320 of file cell3D.hh.

◆ Hex3dSubdiv2y

friend class Hex3dSubdiv2y
friend

Definition at line 321 of file cell3D.hh.

◆ Hex3dSubdiv2z

friend class Hex3dSubdiv2z
friend

Definition at line 322 of file cell3D.hh.

◆ Hex3dSubdiv4x

friend class Hex3dSubdiv4x
friend

Definition at line 323 of file cell3D.hh.

◆ Hex3dSubdiv4y

friend class Hex3dSubdiv4y
friend

Definition at line 324 of file cell3D.hh.

◆ Hex3dSubdiv4z

friend class Hex3dSubdiv4z
friend

Definition at line 325 of file cell3D.hh.

◆ Hex3dSubdiv8

friend class Hex3dSubdiv8
friend

Definition at line 319 of file cell3D.hh.

◆ Hex3dSubdivision

friend class Hex3dSubdivision
friend

Definition at line 318 of file cell3D.hh.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Hexahedron3d::Index i 
)
friend

Member Data Documentation

◆ chld_

Hexahedron3d* concepts::Hexahedron3d::chld_
private

Pointer to the first child.

The children are stored in a linked list.

Definition at line 502 of file cell3D.hh.

◆ cntr_

Hexahedron& concepts::Hexahedron3d::cntr_
private

Reference to the hexahedron connector (topology)

Definition at line 494 of file cell3D.hh.

◆ idx_

Index concepts::Hexahedron3d::idx_
private

Index of this element.

Definition at line 491 of file cell3D.hh.

◆ lnk_

Hexahedron3d* concepts::Hexahedron3d::lnk_
private

Pointer to a sibling.

Definition at line 497 of file cell3D.hh.

◆ map_

MappingHexahedron3d* concepts::Hexahedron3d::map_
private

Pointer to the element map.

Definition at line 505 of file cell3D.hh.

◆ MAX_LEVEL

uint concepts::Hexahedron3d::MAX_LEVEL
static

Definition at line 337 of file cell3D.hh.

◆ subdivStrategy_

const Hex3dSubdivision* concepts::Hexahedron3d::subdivStrategy_
private

Subdivision strategy for the hexahedron.

Definition at line 508 of file cell3D.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich