QuOc

 

Public Member Functions | Private Attributes

tpcfe::CFEStructureAffine< RealType > Class Template Reference

#include <tpCFEBasics.h>

Inheritance diagram for tpcfe::CFEStructureAffine< RealType >:
tpcfe::CFEStructure< RealType >

List of all members.

Public Member Functions

 CFEStructureAffine ()
void setImageFrom (const qc::ScalarArray< RealType, qc::QC_3D > &arr, const RealType adjust=aol::NumberTrait< RealType >::zero)
RealType getValue (const qc::CoordType &pos) const
 Return value of the levelset function at a regular node position. Note: in general, a CFEStructure does not have a vector, so getValue ( int ) does not make sense.
RealType getCutRelationBetween (const qc::CoordType &pos0, const qc::CoordType &pos1) const
 Compute the cut relation between the two nodes. This only makes sense for neighbors connected by regular tetra edges, but can always be called.
virtual aol::Vec3< RealType > getInterfaceNormal (const aol::Vec3< RealType > &) const

Private Attributes

qc::ScalarArray< RealType,
qc::QC_3D > 
_image

Detailed Description

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

Affine interpolation between regular nodes on 3D data

Definition at line 128 of file tpCFEBasics.h.


Constructor & Destructor Documentation

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

Definition at line 133 of file tpCFEBasics.h.

: _image () { }


Member Function Documentation

template<typename RealType>
RealType tpcfe::CFEStructureAffine< RealType >::getCutRelationBetween ( const qc::CoordType ,
const qc::CoordType  
) const [inline, virtual]

Compute the cut relation between the two nodes. This only makes sense for neighbors connected by regular tetra edges, but can always be called.

Implements tpcfe::CFEStructure< RealType >.

Definition at line 161 of file tpCFEBasics.h.

References tpcfe::CFEStructureAffine< RealType >::getValue().

                                                                                            {
    const RealType val0 = getValue ( pos0 ), val1 = getValue ( pos1 );
    return ( val0 / ( val0 - val1 ) );
  }

template<typename RealType>
virtual aol::Vec3<RealType> tpcfe::CFEStructureAffine< RealType >::getInterfaceNormal ( const aol::Vec3< RealType > &   )  const [inline, virtual]

Implements tpcfe::CFEStructure< RealType >.

Definition at line 166 of file tpCFEBasics.h.

                                                                                          {
    throw aol::UnimplementedCodeException ( "tpcfe::CFEStructureAffine::getInterfaceNormal not implemented yet.", __FILE__, __LINE__ );
    aol::Vec3<RealType> n;
    return ( n );
  }

template<typename RealType>
RealType tpcfe::CFEStructureAffine< RealType >::getValue ( const qc::CoordType  )  const [inline, virtual]

Return value of the levelset function at a regular node position. Note: in general, a CFEStructure does not have a vector, so getValue ( int ) does not make sense.

Implements tpcfe::CFEStructure< RealType >.

Definition at line 156 of file tpCFEBasics.h.

References tpcfe::CFEStructureAffine< RealType >::_image.

Referenced by tpcfe::CFEStructureAffine< RealType >::getCutRelationBetween().

                                                     {
    return ( _image.get ( pos ) );
  }

template<typename RealType>
void tpcfe::CFEStructureAffine< RealType >::setImageFrom ( const qc::ScalarArray< RealType, qc::QC_3D > &  arr,
const RealType  adjust = aol::NumberTrait<RealType>::zero 
) [inline]

Definition at line 135 of file tpCFEBasics.h.

References tpcfe::CFEStructureAffine< RealType >::_image, and qc::OTFILexMapper< qc::QC_3D >::splitGlobalIndex().

Referenced by tpcfe::CFEGridBase< _RealType, CFE_CDWI_TPOS, _RealType >::addStructureFrom(), tpcfe::CFEGrid< _RealType, CFE_DOMAIN, _RealType >::setDomainFrom(), tpcfe::CFEGrid< _RealType, CFE_CDWI_TPOS, _RealType >::setDomainFrom(), tpcfe::CFEGrid< _RealType, CFE_CDWI_LIEHR, _RealType >::setDomainFrom(), tpcfe::CFEGrid< _RealType, CFE_CD, _NodalCoeffType >::setDomainFrom(), and tpcfe::CFEGrid< _RealType, CFE_NONE, _RealType >::setDomainFrom().

                                                                                                                          {
    _image.reallocate ( arr );
    _image = arr;
    int adjustCounter = 0;
    for ( int i = 0; i < _image.size(); ++i ) {
      if ( fabs ( _image[i] ) < adjust ) {
#ifdef VERBOSE
        qc::OTFILexMapper<qc::QC_3D> imap ( arr );
        cerr << "Levelset value " << _image[i] << " at position " << imap.splitGlobalIndex ( i ) << ", shifted to " << ( _image[i] < aol::NumberTrait<RealType>::zero  ?  -adjust  :  adjust ) << endl;
#endif
        _image[i] = ( _image[i] < aol::NumberTrait<RealType>::zero  ?  -adjust  :  adjust );
        ++adjustCounter;
      }
    }
    if ( adjustCounter != 0 ) {
      cerr << "Levelset function adjusted (shifted away from zero) at " << adjustCounter << " nodes" << endl;
    }
  }


Member Data Documentation

template<typename RealType>
qc::ScalarArray<RealType, qc::QC_3D> tpcfe::CFEStructureAffine< RealType >::_image [private]

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

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