Class xlifepp::SpectralBasisFun#

class SpectralBasisFun : public xlifepp::SpectralBasis#

Inheritence diagram for xlifepp::SpectralBasisFun:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::SpectralBasis" tooltip="xlifepp::SpectralBasis"] "1" [label="xlifepp::SpectralBasisFun" tooltip="xlifepp::SpectralBasisFun" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::SpectralBasisFun:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "25" [label="xlifepp::Collection< string_t >" tooltip="xlifepp::Collection< string_t >"] "18" [label="xlifepp::Matrix< real_t >" tooltip="xlifepp::Matrix< real_t >"] "22" [label="xlifepp::Vector< real_t >" tooltip="xlifepp::Vector< real_t >"] "33" [label="xlifepp::Vector< xlifepp::Vector< real_t > >" tooltip="xlifepp::Vector< xlifepp::Vector< real_t > >"] "38" [label="std::list< std::pair< number_t, real_t > >" tooltip="std::list< std::pair< number_t, real_t > >"] "14" [label="std::map< number_t, std::vector< number_t > >" tooltip="std::map< number_t, std::vector< number_t > >"] "12" [label="std::map< number_t, xlifepp::Geometry * >" tooltip="std::map< number_t, xlifepp::Geometry * >"] "37" [label="std::map< string_t, number_t >" tooltip="std::map< string_t, number_t >"] "46" [label="std::map< string_t, std::pair< ValueType, StrucType > >" tooltip="std::map< string_t, std::pair< ValueType, StrucType > >"] "39" [label="std::list< T >" tooltip="std::list< T >"] "13" [label="std::map< K, T >" tooltip="std::map< K, T >"] "9" [label="std::vector< T >" tooltip="std::vector< T >"] "28" [label="std::vector< T >" tooltip="std::vector< T >"] "21" [label="std::vector< K >" tooltip="std::vector< K >"] "8" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "44" [label="std::vector< const xlifepp::GeomDomain * >" tooltip="std::vector< const xlifepp::GeomDomain * >"] "24" [label="std::vector< const xlifepp::Transformation * >" tooltip="std::vector< const xlifepp::Transformation * >"] "29" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "19" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "43" [label="std::vector< std::vector< GeoNumPair > >" tooltip="std::vector< std::vector< GeoNumPair > >"] "15" [label="std::vector< std::vector< int_t > >" tooltip="std::vector< std::vector< int_t > >"] "26" [label="std::vector< string_t >" tooltip="std::vector< string_t >"] "42" [label="std::vector< xlifepp::GeomDomain * >" tooltip="std::vector< xlifepp::GeomDomain * >"] "41" [label="std::vector< xlifepp::GeomElement * >" tooltip="std::vector< xlifepp::GeomElement * >"] "36" [label="std::vector< xlifepp::Parameter * >" tooltip="std::vector< xlifepp::Parameter * >"] "11" [label="std::vector< xlifepp::Point >" tooltip="std::vector< xlifepp::Point >"] "30" [label="std::vector< xlifepp::Transformation * >" tooltip="std::vector< xlifepp::Transformation * >"] "34" [label="std::vector< xlifepp::Vector< real_t > >" tooltip="std::vector< xlifepp::Vector< real_t > >"] "7" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox"] "27" [label="xlifepp::Collection< T >" tooltip="xlifepp::Collection< T >"] "4" [label="xlifepp::DomainInfo" tooltip="xlifepp::DomainInfo"] "16" [label="xlifepp::ExtrusionData" tooltip="xlifepp::ExtrusionData"] "45" [label="xlifepp::Function" tooltip="xlifepp::Function"] "40" [label="xlifepp::GeoNode" tooltip="xlifepp::GeoNode"] "3" [label="xlifepp::GeomDomain" tooltip="xlifepp::GeomDomain"] "6" [label="xlifepp::Geometry" tooltip="xlifepp::Geometry"] "20" [label="xlifepp::Matrix< K >" tooltip="xlifepp::Matrix< K >"] "5" [label="xlifepp::Mesh" tooltip="xlifepp::Mesh"] "10" [label="xlifepp::MinimalBox" tooltip="xlifepp::MinimalBox"] "35" [label="xlifepp::Parameters" tooltip="xlifepp::Parameters"] "32" [label="xlifepp::Parametrization" tooltip="xlifepp::Parametrization"] "31" [label="xlifepp::Point" tooltip="xlifepp::Point"] "2" [label="xlifepp::SpectralBasis" tooltip="xlifepp::SpectralBasis"] "1" [label="xlifepp::SpectralBasisFun" tooltip="xlifepp::SpectralBasisFun" fillcolor="#BFBFBF"] "17" [label="xlifepp::Transformation" tooltip="xlifepp::Transformation"] "23" [label="xlifepp::Vector< K >" tooltip="xlifepp::Vector< K >"] "25" -> "26" [dir=forward tooltip="public-inheritance"] "25" -> "27" [dir=forward tooltip="template-instance"] "18" -> "19" [dir=forward tooltip="public-inheritance"] "18" -> "20" [dir=forward tooltip="template-instance"] "22" -> "19" [dir=forward tooltip="public-inheritance"] "22" -> "23" [dir=forward tooltip="template-instance"] "33" -> "34" [dir=forward tooltip="public-inheritance"] "33" -> "23" [dir=forward tooltip="template-instance"] "38" -> "39" [dir=forward tooltip="template-instance"] "14" -> "13" [dir=forward tooltip="template-instance"] "12" -> "13" [dir=forward tooltip="template-instance"] "37" -> "13" [dir=forward tooltip="template-instance"] "46" -> "13" [dir=forward tooltip="template-instance"] "21" -> "9" [dir=forward tooltip="template-instance"] "8" -> "9" [dir=forward tooltip="template-instance"] "44" -> "9" [dir=forward tooltip="template-instance"] "24" -> "9" [dir=forward tooltip="template-instance"] "29" -> "9" [dir=forward tooltip="template-instance"] "19" -> "9" [dir=forward tooltip="template-instance"] "43" -> "9" [dir=forward tooltip="template-instance"] "15" -> "9" [dir=forward tooltip="template-instance"] "26" -> "9" [dir=forward tooltip="template-instance"] "42" -> "9" [dir=forward tooltip="template-instance"] "41" -> "9" [dir=forward tooltip="template-instance"] "36" -> "9" [dir=forward tooltip="template-instance"] "11" -> "9" [dir=forward tooltip="template-instance"] "30" -> "9" [dir=forward tooltip="template-instance"] "34" -> "9" [dir=forward tooltip="template-instance"] "7" -> "8" [dir=forward tooltip="usage"] "27" -> "28" [dir=forward tooltip="public-inheritance"] "4" -> "5" [dir=forward tooltip="usage"] "16" -> "17" [dir=forward tooltip="usage"] "16" -> "25" [dir=forward tooltip="usage"] "16" -> "29" [dir=forward tooltip="usage"] "16" -> "19" [dir=forward tooltip="usage"] "16" -> "22" [dir=forward tooltip="usage"] "16" -> "30" [dir=forward tooltip="usage"] "16" -> "31" [dir=forward tooltip="usage"] "45" -> "35" [dir=forward tooltip="usage"] "45" -> "45" [dir=forward tooltip="usage"] "45" -> "31" [dir=forward tooltip="usage"] "45" -> "46" [dir=forward tooltip="usage"] "40" -> "40" [dir=forward tooltip="usage"] "40" -> "6" [dir=forward tooltip="usage"] "3" -> "4" [dir=forward tooltip="usage"] "3" -> "3" [dir=forward tooltip="usage"] "3" -> "6" [dir=forward tooltip="usage"] "3" -> "44" [dir=forward tooltip="usage"] "6" -> "7" [dir=forward tooltip="usage"] "6" -> "10" [dir=forward tooltip="usage"] "6" -> "12" [dir=forward tooltip="usage"] "6" -> "14" [dir=forward tooltip="usage"] "6" -> "15" [dir=forward tooltip="usage"] "6" -> "16" [dir=forward tooltip="usage"] "6" -> "32" [dir=forward tooltip="usage"] "6" -> "6" [dir=forward tooltip="usage"] "6" -> "40" [dir=forward tooltip="usage"] "20" -> "21" [dir=forward tooltip="public-inheritance"] "5" -> "6" [dir=forward tooltip="usage"] "5" -> "11" [dir=forward tooltip="usage"] "5" -> "41" [dir=forward tooltip="usage"] "5" -> "42" [dir=forward tooltip="usage"] "5" -> "29" [dir=forward tooltip="usage"] "5" -> "43" [dir=forward tooltip="usage"] "5" -> "5" [dir=forward tooltip="usage"] "10" -> "11" [dir=forward tooltip="usage"] "35" -> "36" [dir=forward tooltip="usage"] "35" -> "37" [dir=forward tooltip="usage"] "32" -> "6" [dir=forward tooltip="usage"] "32" -> "22" [dir=forward tooltip="usage"] "32" -> "33" [dir=forward tooltip="usage"] "32" -> "5" [dir=forward tooltip="usage"] "32" -> "35" [dir=forward tooltip="usage"] "32" -> "38" [dir=forward tooltip="usage"] "31" -> "19" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "45" [dir=forward tooltip="usage"] "17" -> "18" [dir=forward tooltip="usage"] "17" -> "22" [dir=forward tooltip="usage"] "17" -> "24" [dir=forward tooltip="usage"] "23" -> "21" [dir=forward tooltip="public-inheritance"] }

defines class of global basis functions given by an analytic expression.

It uses the general Function class (defined in utils lib) with function of the form:

T function(const Point&, Parameters&)
T is either a real_t or a complex_t or a Vector<real_t> or a Vector<complex_t>
providing the computation of the n-th basis function at a given point.

For instance, to define the spectral basis a_n sin(n pi x), define the standard c++ function:

real_t sin_n(const Point &p,Parameters& pa = defaultParameters) {
  real_t x=p.x();
  real_t h=pa("h");                    //get the parameter h (user definition)
  number_t n=pa("basis size");         //get the size of the basis
  number_t id=pa("basis index");       //get the index of function to compute
  return sqrt(2/h)*sin(id*pi*x/h);}  //computation
}
and use it as follows:
Parameters p(1,"h");
SpectralBasisFun sinBasis(Omega,Function(sin_n,p),10); //define the set of basis function
real_t s1;
sinBasis.functions(1,Point(0.5),s1); //compute the basis function n=1 at point x=0.5 in S1
Vector<real_t> sn;
sinBasis.functions(Point(0.5),sn);   //compute all the basis functions at point x=0.5 in Sn

Public Functions

SpectralBasisFun(const Function&, number_t n)#

constructor with no GeomDomain

SpectralBasisFun(const GeomDomain&, const Function&, number_t)#

constructor

SpectralBasisFun(const SpectralBasisFun&)#

copy constructor

inline Function &basis()#

access to functions

inline const Function &basis() const#

access to functions

inline virtual SpectralBasisFun *clone() const#

clone of current returned as pointer (covariant)

inline virtual complex_t &evaluate(const std::vector<real_t> &p, const Vector<complex_t> &a, complex_t &v) const#

evaluate linear combination of complex basis functions

inline virtual real_t &evaluate(const std::vector<real_t> &p, const Vector<real_t> &a, real_t &v) const#

evaluate linear combination of real basis functions

template<typename T>
T &evaluateT(const std::vector<real_t>&, const Vector<T>&, T&) const#

evaluate linear combination of basis functions

template<typename T>
T &function(number_t, const Point&, T&, DiffOpType = _id) const#

compute n-th function

template<typename T>
Vector<T> &functions(const Point &P, Vector<T> &res, DiffOpType = _id) const#

compute all functions

SpectralBasisFun &operator=(const SpectralBasisFun&)#

assign operator

virtual void print(std::ostream&) const#

print utility

inline virtual void setGeomElementPointer(const void *pd) const#

link geomElement pointer to function