Skip to content
Snippets Groups Projects
Commit 7e4b51f2 authored by Nina Džugasová's avatar Nina Džugasová Committed by Tomáš Oberhuber
Browse files

Improved Grid1D documentation and VectorExample.

parent 7b47bc2e
No related branches found
No related tags found
1 merge request!19Nina
...@@ -23,5 +23,11 @@ int main() ...@@ -23,5 +23,11 @@ int main()
vector2.reset(); vector2.reset();
cout << "Second vector after reset:" << vector2.getData() << endl; cout << "Second vector after reset:" << vector2.getData() << endl;
Containers::Vector<int> vect([1, 2, -3], 3);
cout << "The smallest element is:" << vect.min() << endl;
cout << "The absolute biggest element is:" << vect.absMax() << endl;
cout << "Sum of all vector elements:" << vect.sum() << endl;
vect.scalarMultiplication(2);
} }
...@@ -43,6 +43,9 @@ class Grid< 1, Real, Device, Index > : public Object ...@@ -43,6 +43,9 @@ class Grid< 1, Real, Device, Index > : public Object
// TODO: deprecated and to be removed (GlobalIndexType shall be used instead) // TODO: deprecated and to be removed (GlobalIndexType shall be used instead)
typedef Index IndexType; typedef Index IndexType;
/**
* \brief Returns number of this mesh grid dimensions.
*/
static constexpr int getMeshDimension() { return 1; }; static constexpr int getMeshDimension() { return 1; };
template< int EntityDimension, template< int EntityDimension,
...@@ -53,14 +56,29 @@ class Grid< 1, Real, Device, Index > : public Object ...@@ -53,14 +56,29 @@ class Grid< 1, Real, Device, Index > : public Object
typedef EntityType< 0 > Face; typedef EntityType< 0 > Face;
typedef EntityType< 0 > Vertex; typedef EntityType< 0 > Vertex;
/**
* \brief Basic constructor.
*/
Grid(); Grid();
/**
* \brief Returns type of grid Real (value), Device type and the type of Index.
*/
static String getType(); static String getType();
/**
* \brief Returns type of grid Real (value), Device type and the type of Index.
*/
String getTypeVirtual() const; String getTypeVirtual() const;
/**
* \brief Returns (host) type of grid Real (value), Device type and the type of Index.
*/
static String getSerializationType(); static String getSerializationType();
/**
* \brief Returns (host) type of grid Real (value), Device type and the type of Index.
*/
virtual String getSerializationTypeVirtual() const; virtual String getSerializationTypeVirtual() const;
/** /**
...@@ -96,7 +114,7 @@ class Grid< 1, Real, Device, Index > : public Object ...@@ -96,7 +114,7 @@ class Grid< 1, Real, Device, Index > : public Object
const PointType& proportions ); const PointType& proportions );
/** /**
* \brief Gets the origin. * \brief Returns the origin.
* \param origin Starting point of this grid. * \param origin Starting point of this grid.
*/ */
__cuda_callable__ __cuda_callable__
...@@ -143,7 +161,7 @@ class Grid< 1, Real, Device, Index > : public Object ...@@ -143,7 +161,7 @@ class Grid< 1, Real, Device, Index > : public Object
inline Index getEntityIndex( const Entity& entity ) const; inline Index getEntityIndex( const Entity& entity ) const;
/** /**
* \brief Gets length of one step. * \brief Returns the length of one step.
*/ */
__cuda_callable__ __cuda_callable__
inline const PointType& getSpaceSteps() const; inline const PointType& getSpaceSteps() const;
...@@ -154,15 +172,22 @@ class Grid< 1, Real, Device, Index > : public Object ...@@ -154,15 +172,22 @@ class Grid< 1, Real, Device, Index > : public Object
*/ */
inline void setSpaceSteps(const PointType& steps); inline void setSpaceSteps(const PointType& steps);
/**
* \brief Returns product of space steps to the xPow.
* \tparam xPow Exponent.
*/
template< int xPow > template< int xPow >
__cuda_callable__ __cuda_callable__
const RealType& getSpaceStepsProducts() const; const RealType& getSpaceStepsProducts() const;
/**
* \breif Returns the measure (length) of a cell in this grid.
*/
__cuda_callable__ __cuda_callable__
inline const RealType& getCellMeasure() const; inline const RealType& getCellMeasure() const;
/** /**
* \brief Gets the smallest length of step out of all coordinates. * \brief Returns the smallest length of step out of all coordinates (axes).
*/ */
__cuda_callable__ __cuda_callable__
inline RealType getSmallestSpaceStep() const; inline RealType getSmallestSpaceStep() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment