Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
7e4b51f2
There was an error fetching the commit references. Please try again later.
Commit
7e4b51f2
authored
6 years ago
by
Nina Džugasová
Committed by
Tomáš Oberhuber
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improved Grid1D documentation and VectorExample.
parent
7b47bc2e
No related branches found
No related tags found
1 merge request
!19
Nina
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Examples/VectorExample.cpp
+6
-0
6 additions, 0 deletions
src/Examples/VectorExample.cpp
src/TNL/Meshes/GridDetails/Grid1D.h
+28
-3
28 additions, 3 deletions
src/TNL/Meshes/GridDetails/Grid1D.h
with
34 additions
and
3 deletions
src/Examples/VectorExample.cpp
+
6
−
0
View file @
7e4b51f2
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
src/TNL/Meshes/GridDetails/Grid1D.h
+
28
−
3
View file @
7e4b51f2
...
@@ -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
G
ets the origin.
* \brief
R
et
urn
s 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
G
et
s
length of one step.
* \brief
R
et
urns 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
G
ets the smallest length of step out of all coordinates.
* \brief
R
et
urn
s the smallest length of step out of all coordinates
(axes)
.
*/
*/
__cuda_callable__
__cuda_callable__
inline
RealType
getSmallestSpaceStep
()
const
;
inline
RealType
getSmallestSpaceStep
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment