QuOc

 

Public Member Functions | Private Types | Private Attributes

qc::RigidDisplacementProjectionEnergy< ConfiguratorType > Class Template Reference

This class computes via "apply(...)": $ \int_\Omega w(x)(\phi-R(\alpha_i)(x-x_0)-b-x_0)^2 dx $ in "Dest", where the domain $ \Omega $, the weight $ w $, and the displacement $ \phi-id $ are passed to the constructor, and $ b $ and the angles $ \alpha_i $ for the rotation matrix $ R(\alpha_i) $ are passed to "apply(...)". If the offset $ x_0 $ was not passed to the constructor it is taken to be zero. More...

#include <deformations.h>

Inheritance diagram for qc::RigidDisplacementProjectionEnergy< ConfiguratorType >:
aol::Op< aol::Vector< ConfiguratorType::RealType >, aol::Scalar< ConfiguratorType::RealType > >

List of all members.

Public Member Functions

 RigidDisplacementProjectionEnergy (const typename ConfiguratorType::InitType &Grid, const aol::MultiVector< RealType > &D, const aol::Vector< RealType > &W)
 RigidDisplacementProjectionEnergy (const typename ConfiguratorType::InitType &Grid, const aol::MultiVector< RealType > &D, const aol::Vector< RealType > &W, const typename ConfiguratorType::VecType &Offset)
void applyAdd (const aol::Vector< RealType > &Arg, aol::Scalar< RealType > &Dest) const
 Returns $ \int_\Omega w(x)(\phi-R(\alpha_i)(x-x_0)-b-x_0)^2 dx $ in "Dest", where the domain $ \Omega $, the weight $ w $, and the displacement $ \phi-id $ were passed to the constructor, and $ b $ and the angles $ \alpha_i $ for the rotation matrix $ R(\alpha_i) $ are passed as "Arg". The first dim entries of "Arg" constitute the vector $ b $, and the rest are rotation angles for rotation around the z-, y- and x- axis (in 3D). If the offset $ x_0 $ was not passed to the constructor it is taken to be zero.

Private Types

typedef ConfiguratorType::RealType RealType

Private Attributes

const
AffineDisplacementProjectionEnergy
< ConfiguratorType > 
_affineProjector
const ConfiguratorType::VecType _offset

Detailed Description

template<typename ConfiguratorType>
class qc::RigidDisplacementProjectionEnergy< ConfiguratorType >

This class computes via "apply(...)": $ \int_\Omega w(x)(\phi-R(\alpha_i)(x-x_0)-b-x_0)^2 dx $ in "Dest", where the domain $ \Omega $, the weight $ w $, and the displacement $ \phi-id $ are passed to the constructor, and $ b $ and the angles $ \alpha_i $ for the rotation matrix $ R(\alpha_i) $ are passed to "apply(...)". If the offset $ x_0 $ was not passed to the constructor it is taken to be zero.

Author:
Wirth

Definition at line 945 of file deformations.h.


Member Typedef Documentation

template<typename ConfiguratorType >
typedef ConfiguratorType::RealType qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::RealType [private]

Definition at line 949 of file deformations.h.


Constructor & Destructor Documentation

template<typename ConfiguratorType >
qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::RigidDisplacementProjectionEnergy ( const typename ConfiguratorType::InitType &  Grid,
const aol::MultiVector< RealType > &  D,
const aol::Vector< RealType > &  W 
) [inline]

Definition at line 956 of file deformations.h.

                                                                    :
    _affineProjector( Grid, D, W ) {
  }

template<typename ConfiguratorType >
qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::RigidDisplacementProjectionEnergy ( const typename ConfiguratorType::InitType &  Grid,
const aol::MultiVector< RealType > &  D,
const aol::Vector< RealType > &  W,
const typename ConfiguratorType::VecType &  Offset 
) [inline]

Definition at line 963 of file deformations.h.

                                                                                      :
    _affineProjector( Grid, D, W ),
    _offset( Offset ) {
  }


Member Function Documentation

template<typename ConfiguratorType >
void qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::applyAdd ( const aol::Vector< RealType > &  Arg,
aol::Scalar< RealType > &  Dest 
) const [inline]

Returns $ \int_\Omega w(x)(\phi-R(\alpha_i)(x-x_0)-b-x_0)^2 dx $ in "Dest", where the domain $ \Omega $, the weight $ w $, and the displacement $ \phi-id $ were passed to the constructor, and $ b $ and the angles $ \alpha_i $ for the rotation matrix $ R(\alpha_i) $ are passed as "Arg". The first dim entries of "Arg" constitute the vector $ b $, and the rest are rotation angles for rotation around the z-, y- and x- axis (in 3D). If the offset $ x_0 $ was not passed to the constructor it is taken to be zero.

Definition at line 979 of file deformations.h.

References qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::_affineProjector, qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::_offset, aol::Mat< numRows, numCols, _DataType >::setSubMatrix(), and aol::Vector< _DataType >::size().

                                                                                   {
    // obtain translation b and put it into the last column of a rectangular matrix
    aol::Mat<ConfiguratorType::Dim,ConfiguratorType::Dim+1,RealType> totalMatrix;
    for ( int i = 0; i < ConfiguratorType::Dim; i++ )
      totalMatrix[i][ConfiguratorType::Dim] = Arg[i];
    // obtain rotation R
    int index1[3] = { 0, 0, 1 };
    int index2[3] = { 1, 2, 2 };
    int numberAngles = Arg.size() - ConfiguratorType::Dim;
    typename ConfiguratorType::MatType transformMatrix, rotationMatrix;
    transformMatrix.setIdentity();
    for ( int i = 0; i < numberAngles; i++ ) {
      RealType alpha = Arg[ConfiguratorType::Dim + i];
      rotationMatrix.setIdentity();
      rotationMatrix[index1[i]][index1[i]] = cos( alpha );
      rotationMatrix[index2[i]][index2[i]] = cos( alpha );
      rotationMatrix[index1[i]][index2[i]] = -sin( alpha );
      rotationMatrix[index2[i]][index1[i]] = sin( alpha );
      transformMatrix *= rotationMatrix;
    }
    // put A=R-I into the first columns of the rectangular matrix
    for ( int i = 0; i < ConfiguratorType::Dim; i++ )
      transformMatrix[i][i] -= 1;
    totalMatrix.setSubMatrix( 0, 0, transformMatrix );
    // add $x_0-Rx_0$ to the translation
    typename ConfiguratorType::VecType offset;
    transformMatrix.mult( _offset, offset );
    for ( int i = 0; i < ConfiguratorType::Dim; i++ )
      totalMatrix[i][ConfiguratorType::Dim] -= offset[i];
    // compute the energy
    _affineProjector.applyAdd( totalMatrix, Dest );
  }


Member Data Documentation

template<typename ConfiguratorType >
const AffineDisplacementProjectionEnergy<ConfiguratorType> qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::_affineProjector [private]
template<typename ConfiguratorType >
const ConfiguratorType::VecType qc::RigidDisplacementProjectionEnergy< ConfiguratorType >::_offset [private]

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

Generated on Fri Sep 9 2011 21:09:41 for QuocMesh by doxygen 1.7.1