QuOc

 

Public Member Functions | Protected Types | Protected Attributes

tpcfe::CFEInterfaceTriang< RealType > Class Template Reference

#include <tpCFEUtils.h>

List of all members.

Public Member Functions

 CFEInterfaceTriang ()
 Standard constructor that constructs a dummy.
 CFEInterfaceTriang (const CFEInterfaceTriang< RealType > &other)
 Copy constructor.
 CFEInterfaceTriang (const CFEElement< RealType > &el, const CFETopoTetra &tetra, const aol::Vec3< unsigned char > &tns)
 This constructor should be used.
CFEInterfaceTriang< RealType > & operator= (const CFEInterfaceTriang< RealType > &other)
 Assignment operator.
void set (const CFEElement< RealType > &el, const CFETopoTetra &tetra, const aol::Vec3< unsigned char > &tns)
const qc::ElementgetElement () const
std::vector< aol::Vec3
< RealType > > 
getLocalCoordinates () const
std::vector< aol::Vec3
< RealType > > 
getGlobalCoordinates () const
aol::Vec3< IndexTypegetVNIndices () const
 Return global virtual node indices of vertices.
std::vector< aol::Vec3
< RealType > > 
getWorldCoordinates (const RealType h) const
 Return world coordinates of vertices (scaled by h).
RealType getArea (const RealType h) const
 Compute Area of this triangle.
void dump (ostream &os=cerr) const

Protected Types

typedef CFEVirtualNode
< RealType, CFE_NONE, RealType > 
VNType
typedef VNType::IndexType IndexType

Protected Attributes

CFEElement< RealType > _element
 element in which the interface triang lies
CFETopoTetra _tetra
 tetrahedron which the interface triang is part of (should be inner tetra)
aol::Vec3< unsigned char_tNodes
 node indices of the tetra that form the triang (in 0..3)

Detailed Description

template<typename RealType>
class tpcfe::CFEInterfaceTriang< RealType >

Class for interface triangles

Author:
Schwen

Definition at line 414 of file tpCFEUtils.h.


Member Typedef Documentation

template<typename RealType>
typedef VNType::IndexType tpcfe::CFEInterfaceTriang< RealType >::IndexType [protected]

Definition at line 417 of file tpCFEUtils.h.

template<typename RealType>
typedef CFEVirtualNode<RealType, CFE_NONE, RealType> tpcfe::CFEInterfaceTriang< RealType >::VNType [protected]

Definition at line 416 of file tpCFEUtils.h.


Constructor & Destructor Documentation

template<typename RealType>
tpcfe::CFEInterfaceTriang< RealType >::CFEInterfaceTriang (  )  [inline]

Standard constructor that constructs a dummy.

Definition at line 424 of file tpCFEUtils.h.

                       : _element (), _tetra(), _tNodes() {
    // do nothing else
  }

template<typename RealType>
tpcfe::CFEInterfaceTriang< RealType >::CFEInterfaceTriang ( const CFEInterfaceTriang< RealType > &  other  )  [inline]

Copy constructor.

Definition at line 430 of file tpCFEUtils.h.

                                                                   : _element ( other._element ), _tetra ( other._tetra ), _tNodes ( other._tNodes ) {
    // do nothing else
  }

template<typename RealType>
tpcfe::CFEInterfaceTriang< RealType >::CFEInterfaceTriang ( const CFEElement< RealType > &  el,
const CFETopoTetra tetra,
const aol::Vec3< unsigned char > &  tns 
) [inline]

This constructor should be used.

Definition at line 436 of file tpCFEUtils.h.

                                                                                                                        : _element ( el ), _tetra ( tetra ), _tNodes ( tns ) {
    // do nothing else
  }


Member Function Documentation

template<typename RealType>
void tpcfe::CFEInterfaceTriang< RealType >::dump ( ostream &  os = cerr  )  const [inline]

Definition at line 509 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::getGlobalCoordinates().

                                         {
    std::vector< aol::Vec3<RealType> > globalCoord = this->getGlobalCoordinates();
    os << globalCoord[0] << " " << globalCoord[1] << " " << globalCoord[2] << endl;
  }

template<typename RealType>
RealType tpcfe::CFEInterfaceTriang< RealType >::getArea ( const RealType  h  )  const [inline]

Compute Area of this triangle.

Definition at line 503 of file tpCFEUtils.h.

References aol::Vec3< _DataType >::crossProduct(), and tpcfe::CFEInterfaceTriang< RealType >::getLocalCoordinates().

                                              {
    std::vector< aol::Vec3< RealType > > localCoords = getLocalCoordinates();
    aol::Vec3<RealType> temp ( localCoords[2] - localCoords[0] );
    return ( ( h * h / 2 ) * ( temp.crossProduct ( localCoords[2] - localCoords[1] ) ).norm() );
  }

template<typename RealType>
const qc::Element& tpcfe::CFEInterfaceTriang< RealType >::getElement (  )  const [inline]

Definition at line 453 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element.

                                      {
    return _element;
  }

template<typename RealType>
std::vector< aol::Vec3< RealType > > tpcfe::CFEInterfaceTriang< RealType >::getGlobalCoordinates (  )  const [inline]

Return global coordinates of vertices (not scaled by h) note that this is inefficient

Definition at line 468 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element, tpcfe::CFEInterfaceTriang< RealType >::_tetra, tpcfe::CFEInterfaceTriang< RealType >::_tNodes, and tpcfe::CFETopoTetra::computeGlobalCoordinate().

Referenced by tpcfe::CFEInterfaceTriang< RealType >::dump().

                                                                  {
    std::vector< aol::Vec3< RealType > > ret ( 3 );
    for ( int i = 0; i < 3; ++i )
      _tetra.computeGlobalCoordinate ( ret[i], _element, _tNodes[i] );
    return ( ret );
  }

template<typename RealType>
std::vector< aol::Vec3< RealType > > tpcfe::CFEInterfaceTriang< RealType >::getLocalCoordinates (  )  const [inline]

Return local coordinates of vertices (not scaled by h) in the element note that this is inefficient

Definition at line 459 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element, tpcfe::CFEInterfaceTriang< RealType >::_tetra, tpcfe::CFEInterfaceTriang< RealType >::_tNodes, and tpcfe::CFETopoTetra::computeLocalCoordinate().

Referenced by tpcfe::CFEInterfaceTriang< RealType >::getArea().

                                                                 {
    std::vector< aol::Vec3< RealType > > ret ( 3 );
    for ( int i = 0; i < 3; ++i )
      _tetra.computeLocalCoordinate ( ret[i], _element, _tNodes[i] );
    return ( ret );
  }

template<typename RealType>
aol::Vec3< IndexType > tpcfe::CFEInterfaceTriang< RealType >::getVNIndices (  )  const [inline]

Return global virtual node indices of vertices.

Definition at line 476 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element, tpcfe::CFEInterfaceTriang< RealType >::_tetra, tpcfe::CFEInterfaceTriang< RealType >::_tNodes, tpcfe::CFEGeomVirtualNode< RealType >::mapIndex(), and tpcfe::NODE_NOT_VIRTUAL.

                                              {
    aol::Vec3< IndexType > ret;
    for ( int i = 0; i < 3; ++i ) {
      const int lIdx0 = _tetra ( _tNodes[i], 0 ), lIdx1 = _tetra ( _tNodes[i], 1 );
      const int gIdx0 = _element.globalIndex ( lIdx0 ), gIdx1 = _element.globalIndex ( lIdx1 );

#ifdef DEBUG
      if ( lIdx0 == NODE_NOT_VIRTUAL )
        throw aol::Exception ( "CFEInterfaceTriang: Something is wrong, first node index must not indicate regular node ...", __FILE__, __LINE__ );
#endif

      ret[i] = VNType::mapIndex ( gIdx0, gIdx1 );
    }
    return ( ret );
  }

template<typename RealType>
std::vector< aol::Vec3< RealType > > tpcfe::CFEInterfaceTriang< RealType >::getWorldCoordinates ( const RealType  h  )  const [inline]

Return world coordinates of vertices (scaled by h).

Definition at line 493 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element, tpcfe::CFEInterfaceTriang< RealType >::_tetra, tpcfe::CFEInterfaceTriang< RealType >::_tNodes, and tpcfe::CFETopoTetra::computeGlobalCoordinate().

                                                                                  {
    std::vector< aol::Vec3< RealType > > ret ( 3 );
    for ( int i = 0; i < 3; ++i ) {
      _tetra.computeGlobalCoordinate ( ret[i], _element, _tNodes[i] );
      ret[i] *= h;
    }
    return ( ret );
  }

template<typename RealType>
CFEInterfaceTriang<RealType>& tpcfe::CFEInterfaceTriang< RealType >::operator= ( const CFEInterfaceTriang< RealType > &  other  )  [inline]

Assignment operator.

Definition at line 442 of file tpCFEUtils.h.

References tpcfe::CFEInterfaceTriang< RealType >::_element, tpcfe::CFEInterfaceTriang< RealType >::_tetra, and tpcfe::CFEInterfaceTriang< RealType >::_tNodes.

                                                                                        {
    set ( other._element, other._tetra, other._tNodes );
  }

template<typename RealType>
void tpcfe::CFEInterfaceTriang< RealType >::set ( const CFEElement< RealType > &  el,
const CFETopoTetra tetra,
const aol::Vec3< unsigned char > &  tns 
) [inline]

Member Data Documentation

template<typename RealType>
CFEElement<RealType> tpcfe::CFEInterfaceTriang< RealType >::_element [protected]
template<typename RealType>
CFETopoTetra tpcfe::CFEInterfaceTriang< RealType >::_tetra [protected]
template<typename RealType>
aol::Vec3< unsigned char > tpcfe::CFEInterfaceTriang< RealType >::_tNodes [protected]

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

Generated on Fri Sep 9 2011 21:10:19 for QuocMesh by doxygen 1.7.1