Template Class FullGrid

Class Documentation

template<typename FG_ELEMENT>
class FullGrid

The full grid class which is the main building block of the combi grid

Public Functions

FullGrid(DimType dim, LevelType level, BoundaryType hasBdrPoints = 2, BasisFunctionType basis = BasisFunctionType::HAT)

simplest Ctor with homogeneous levels

FullGrid(DimType dim, const LevelVector &levels, BoundaryType hasBdrPoints = 2, BasisFunctionType basis = BasisFunctionType::HAT)

dimension adaptive Ctor

FullGrid(DimType dim, const LevelVector &levels, const std::vector<BoundaryType> &hasBdrPoints, BasisFunctionType basis = BasisFunctionType::HAT)

dimension adaptive Ctor

FullGrid(const char *filename, BasisFunctionType basis = BasisFunctionType::HAT)
FullGrid(const LevelVector &levels, const SGrid<FG_ELEMENT> &sg)
virtual ~FullGrid()
void createFullGrid()

allocates the memory for the element vector of the full grid

Only after this needs the full grid considerable amount of memory

void deleteFullGrid()

Deallocates the element vector, so the memory requirement should not be significant afer this

FG_ELEMENT eval(std::vector<real> &coords)

evaluates the full grid on the specified coordinates

Parameters:

coords – ND coordinates on the unit square [0,1]^D

void getCoords(IndexType elemIndex, std::vector<real> &coords) const

return the coordinates on the unit square

Parameters:
  • elemIndex – [IN] index of the element in the vector

  • coords – [OUT] the vector must be resized already

void getLI(IndexType elementIndex, LevelVector &levels, IndexVector &indexes) const

returns the LI (level,index) notation for a given element in the full grid

Parameters:
  • elementIndex – [IN] the linear index of the element

  • levels – [OUT] the levels of the point in the LI notation

  • indexes – [OUT] the indexes of the point in the LI notation

inline void getVectorIndex(const IndexType linIndex, IndexVector &axisIndex) const

returns the vector index for one linear index

Parameters:
  • linIndex – [IN] the linear index

  • axisIndex – [OUT] the returned vector index

inline IndexType getLinearIndex(const IndexVector &axisIndex) const

returns the linear index for one linear index

Parameters:

axisIndex – [IN] the vector index

inline BasisFunctionType getBasisFct() const

returns the basis function type

inline DimType getDimension() const

returns the dimension of the full grid

inline std::vector<FG_ELEMENT> &getElementVector()

the getters for the full grid vector

inline const std::vector<FG_ELEMENT> &getElementVector() const
inline IndexType getOffset(DimType i) const

return the offset in the full grid vector of the dimension

inline const IndexVector &getOffsets() const
inline const LevelVector &getLevels() const

return the level vector

inline bool isGridCreated() const

flag shows if the full grid is created

inline bool isHierarchized() const

function to check whether a fullgrid is hierarchized

inline void setHierarchized()

set the isHierarchized flag

inline IndexType getNrElements() const

returns the number of elements in the full grid

inline IndexType length(DimType i) const

number of points per dimension i

inline IndexVector &getSGppIndex() const

return the vector for faster combination of the full grids

this will be used in the Converter

inline const std::vector<BoundaryType> &returnBoundaryFlags() const

vector of flags to show if the dimension has boundary points

void setElementVector(const std::vector<FG_ELEMENT> &in)

copies the input vector to the full grid vector in most cases the add function would be more save

Parameters:

in – [IN] input vector

inline FG_ELEMENT *getData()
inline const FG_ELEMENT *getData() const
void gridEval(FullGrid<FG_ELEMENT> &dst) const
void save(std::string &filename)
void add(FullGrid<FG_ELEMENT> &fg, real coeff)
void addGENE(const FullGrid<FG_ELEMENT> &fg, real coeff)
inline real getlpNorm(int p)
inline real normalizelp(int p)
inline const IndexVector &getSizes() const
inline void print(std::ostream &os) const
inline void writePlotFile(const char *filename) const

Friends

friend class boost::serialization::access