Programming tasks to Scientific Computing I
Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
shellFE::createNonConstantRHS< ConfiguratorType > Class Template Reference

Assembly operator for non-constant RHS. More...

#include <rhs.h>

Public Member Functions

 createNonConstantRHS (const ConfiguratorType &conf)
 
RealType getNonlinearity (const typename ConfiguratorType::ElementType &el, int q) const
 
RealType evalRHS (typename ConfiguratorType::TangentVecType &cartCoord) const
 
- Public Member Functions inherited from shellFE::UnitTriangleFENonlinOpIntegratorShellFE< ConfiguratorType, createNonConstantRHS< ConfiguratorType > >
 UnitTriangleFENonlinOpIntegratorShellFE (const ConfiguratorType &Conf)
 
virtual ~UnitTriangleFENonlinOpIntegratorShellFE ()
 
void assembleAdd (VectorType &Dest) const
 
RealType getNonlinearity (const typename ConfiguratorType::ElementType &El, int QuadPoint) const
 interface function, has to be provided in derived classes. More...
 

Protected Types

typedef ConfiguratorType::RealType RealType
 
typedef ConfiguratorType::TangentVecType TangentVecType
 
- Protected Types inherited from shellFE::UnitTriangleFENonlinOpIntegratorShellFE< ConfiguratorType, createNonConstantRHS< ConfiguratorType > >
typedef ConfiguratorType::RealType RealType
 
typedef ConfiguratorType::VectorType VectorType
 
typedef ConfiguratorType::ElementType ElementType
 

Protected Attributes

std::unique_ptr< typename ConfiguratorType::VectorType_dof
 
std::unique_ptr< DiscreteVectorFunctionDefaultShellFE< ConfiguratorType > > _x
 
- Protected Attributes inherited from shellFE::UnitTriangleFENonlinOpIntegratorShellFE< ConfiguratorType, createNonConstantRHS< ConfiguratorType > >
const ConfiguratorType_config
 

Static Protected Attributes

static const int dim = 3
 

Additional Inherited Members

- Protected Member Functions inherited from shellFE::UnitTriangleFENonlinOpIntegratorShellFE< ConfiguratorType, createNonConstantRHS< ConfiguratorType > >
createNonConstantRHS< ConfiguratorType > & asImp ()
 
const createNonConstantRHS< ConfiguratorType > & asImp () const
 

Detailed Description

template<typename ConfiguratorType>
class shellFE::createNonConstantRHS< ConfiguratorType >

Assembly operator for non-constant RHS.

Definition at line 41 of file rhs.h.

Member Typedef Documentation

template<typename ConfiguratorType >
typedef ConfiguratorType::RealType shellFE::createNonConstantRHS< ConfiguratorType >::RealType
protected

Definition at line 45 of file rhs.h.

template<typename ConfiguratorType >
typedef ConfiguratorType::TangentVecType shellFE::createNonConstantRHS< ConfiguratorType >::TangentVecType
protected

Definition at line 46 of file rhs.h.

Constructor & Destructor Documentation

template<typename ConfiguratorType >
shellFE::createNonConstantRHS< ConfiguratorType >::createNonConstantRHS ( const ConfiguratorType conf)
inline

Definition at line 54 of file rhs.h.

55  : UnitTriangleFENonlinOpIntegratorShellFE <ConfiguratorType, createNonConstantRHS <ConfiguratorType> > (conf)
56  {
57  int numGlobalDofs = this->_config.getNumGlobalDofs();
58  const typename ConfiguratorType::InitType &grid = this->_config.getInitializer();
59  _dof.reset(new typename ConfiguratorType::VectorType (dim * numGlobalDofs));
60 
61  for (int i = 0; i < numGlobalDofs; ++i) {
62  for (int c = 0; c < dim; ++c) {
63  (*_dof)[c*numGlobalDofs + i] = grid.getVertex(i)[c];
64  }
65  }
66 
67  _x.reset(new DiscreteVectorFunctionDefaultShellFE<ConfiguratorType>(this->_config, *_dof, dim));
68  }
std::unique_ptr< DiscreteVectorFunctionDefaultShellFE< ConfiguratorType > > _x
Definition: rhs.h:51
DataTypeContainer::VectorType VectorType
const Point3DType & getVertex(const int num) const
Definition: triangMesh.h:66
static const int dim
Definition: rhs.h:48
const InitType & getInitializer() const
Returns the mesh.
int getNumGlobalDofs() const
Returns the number of global degrees of freedom.
std::unique_ptr< typename ConfiguratorType::VectorType > _dof
Definition: rhs.h:50

Member Function Documentation

template<typename ConfiguratorType >
RealType shellFE::createNonConstantRHS< ConfiguratorType >::evalRHS ( typename ConfiguratorType::TangentVecType cartCoord) const
inline

Definition at line 83 of file rhs.h.

84  {
85  RealType nl = std::pow(aol::Sqr(-1. + 2. * cartCoord[0]) + aol::Sqr(-1. + 2. * cartCoord[1]), 1./3.) *
86  sin(2./3. * atan2(-1. + 2.*cartCoord[1], -1. + 2.*cartCoord[0]));
87 
88  return nl;
89  }
T Sqr(const T a)
Definition: aol.h:134
double RealType
Definition: ex1.cpp:22
template<typename ConfiguratorType >
RealType shellFE::createNonConstantRHS< ConfiguratorType >::getNonlinearity ( const typename ConfiguratorType::ElementType el,
int  q 
) const
inline

Definition at line 70 of file rhs.h.

71  {
72  const typename ConfiguratorType::BaseFuncSetType &bfs = this->_config.getBaseFunctionSet(el);
74 
75  typename ConfiguratorType::TangentVecType cartCoord;
76  _x->evaluateAtQuadPoint(el, q, cartCoord);
77 
78  RealType nl = 2.0 * el.getAreaOfFlattenedTriangle() * evalRHS(cartCoord);
79 
80  return nl;
81  }
std::unique_ptr< DiscreteVectorFunctionDefaultShellFE< ConfiguratorType > > _x
Definition: rhs.h:51
DataTypeContainer::DomVecType DomVecType
RealType evalRHS(typename ConfiguratorType::TangentVecType &cartCoord) const
Definition: rhs.h:83
const DomVecType & getRefCoord(int QuadPoint) const
Returns the coordinates of a quadrature point.
DataTypeContainer::TangentVecType TangentVecType
double RealType
Definition: ex1.cpp:22
const BaseFuncSetType & getBaseFunctionSet(const ElementType &) const
Returns the base funcitons set for an element.

Member Data Documentation

template<typename ConfiguratorType >
std::unique_ptr<typename ConfiguratorType::VectorType> shellFE::createNonConstantRHS< ConfiguratorType >::_dof
protected

Definition at line 50 of file rhs.h.

template<typename ConfiguratorType >
std::unique_ptr<DiscreteVectorFunctionDefaultShellFE<ConfiguratorType> > shellFE::createNonConstantRHS< ConfiguratorType >::_x
protected

Definition at line 51 of file rhs.h.

template<typename ConfiguratorType >
const int shellFE::createNonConstantRHS< ConfiguratorType >::dim = 3
staticprotected

Definition at line 48 of file rhs.h.


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