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
165475cc
There was an error fetching the commit references. Please try again later.
Commit
165475cc
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted interface of Mesh
parent
a5959f74
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Meshes/Mesh.h
+23
-4
23 additions, 4 deletions
src/TNL/Meshes/Mesh.h
src/TNL/Meshes/MeshDetails/Mesh_impl.h
+49
-8
49 additions, 8 deletions
src/TNL/Meshes/MeshDetails/Mesh_impl.h
with
72 additions
and
12 deletions
src/TNL/Meshes/Mesh.h
+
23
−
4
View file @
165475cc
...
...
@@ -18,6 +18,7 @@
#include
<ostream>
#include
<TNL/Object.h>
#include
<TNL/Logger.h>
#include
<TNL/Meshes/MeshEntity.h>
#include
<TNL/Meshes/MeshDetails/traits/MeshTraits.h>
#include
<TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h>
...
...
@@ -42,9 +43,8 @@ class Mesh
using
DeviceType
=
typename
MeshTraitsType
::
DeviceType
;
using
GlobalIndexType
=
typename
MeshTraitsType
::
GlobalIndexType
;
using
LocalIndexType
=
typename
MeshTraitsType
::
LocalIndexType
;
using
CellType
=
typename
MeshTraitsType
::
CellType
;
using
VertexType
=
typename
MeshTraitsType
::
VertexType
;
using
PointType
=
typename
MeshTraitsType
::
PointType
;
using
RealType
=
typename
PointType
::
RealType
;
template
<
int
Dimension
>
using
EntityTraits
=
typename
MeshTraitsType
::
template
EntityTraits
<
Dimension
>;
...
...
@@ -52,6 +52,13 @@ class Mesh
template
<
int
Dimension
>
using
EntityType
=
typename
EntityTraits
<
Dimension
>::
EntityType
;
static
constexpr
int
getMeshDimension
();
// types of common entities
using
Cell
=
EntityType
<
getMeshDimension
()
>
;
using
Face
=
EntityType
<
getMeshDimension
()
-
1
>
;
using
Vertex
=
EntityType
<
0
>
;
static
String
getType
();
virtual
String
getTypeVirtual
()
const
;
...
...
@@ -60,8 +67,6 @@ class Mesh
virtual
String
getSerializationTypeVirtual
()
const
;
static
constexpr
int
getMeshDimension
();
using
StorageBaseType
::
isBoundaryEntity
;
using
StorageBaseType
::
getBoundaryEntitiesCount
;
using
StorageBaseType
::
getBoundaryEntityIndex
;
...
...
@@ -80,6 +85,18 @@ class Mesh
template
<
int
Dimension
>
const
EntityType
<
Dimension
>&
getEntity
(
const
GlobalIndexType
&
entityIndex
)
const
;
// duplicated for compatibility with grids
template
<
typename
EntityType
>
GlobalIndexType
getEntitiesCount
()
const
;
template
<
typename
EntityType
>
EntityType
&
getEntity
(
const
GlobalIndexType
&
entityIndex
);
template
<
typename
EntityType
>
const
EntityType
&
getEntity
(
const
GlobalIndexType
&
entityIndex
)
const
;
bool
save
(
File
&
file
)
const
;
bool
load
(
File
&
file
);
...
...
@@ -95,6 +112,8 @@ class Mesh
bool
init
(
typename
MeshTraitsType
::
PointArrayType
&
points
,
typename
MeshTraitsType
::
CellSeedArrayType
&
cellSeeds
);
void
writeProlog
(
Logger
&
logger
);
protected:
// Methods for the mesh initializer
using
StorageBaseType
::
setNumberOfEntities
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Meshes/MeshDetails/Mesh_impl.h
+
49
−
8
View file @
165475cc
...
...
@@ -21,6 +21,14 @@
namespace
TNL
{
namespace
Meshes
{
template
<
typename
MeshConfig
>
constexpr
int
Mesh
<
MeshConfig
>::
getMeshDimension
()
{
return
MeshTraitsType
::
meshDimension
;
}
template
<
typename
MeshConfig
>
String
Mesh
<
MeshConfig
>::
...
...
@@ -53,14 +61,6 @@ getSerializationTypeVirtual() const
return
this
->
getSerializationType
();
}
template
<
typename
MeshConfig
>
constexpr
int
Mesh
<
MeshConfig
>::
getMeshDimension
()
{
return
MeshTraitsType
::
meshDimension
;
}
template
<
typename
MeshConfig
>
template
<
int
Dimension
>
constexpr
bool
...
...
@@ -100,6 +100,36 @@ getEntity( const GlobalIndexType& entityIndex ) const
return
StorageBaseType
::
getEntity
(
DimensionTag
<
Dimension
>
(),
entityIndex
);
}
// duplicated for compatibility with grids
template
<
typename
MeshConfig
>
template
<
typename
Entity
>
typename
Mesh
<
MeshConfig
>::
GlobalIndexType
Mesh
<
MeshConfig
>::
getEntitiesCount
()
const
{
return
getEntitiesCount
<
Entity
::
getEntityDimension
()
>
();
}
template
<
typename
MeshConfig
>
template
<
typename
Entity
>
Entity
&
Mesh
<
MeshConfig
>::
getEntity
(
const
GlobalIndexType
&
entityIndex
)
{
return
getEntity
<
Entity
::
getEntityDimension
()
>
(
entityIndex
);
}
template
<
typename
MeshConfig
>
template
<
typename
Entity
>
const
Entity
&
Mesh
<
MeshConfig
>::
getEntity
(
const
GlobalIndexType
&
entityIndex
)
const
{
return
getEntity
<
Entity
::
getEntityDimension
()
>
(
entityIndex
);
}
template
<
typename
MeshConfig
>
bool
Mesh
<
MeshConfig
>::
...
...
@@ -159,6 +189,17 @@ init( typename MeshTraitsType::PointArrayType& points,
return
true
;
}
template
<
typename
MeshConfig
>
void
Mesh
<
MeshConfig
>::
writeProlog
(
Logger
&
logger
)
{
logger
.
writeParameter
(
"Dimension:"
,
getMeshDimension
()
);
logger
.
writeParameter
(
"Number of cells:"
,
getEntitiesCount
<
getMeshDimension
()
>
()
);
logger
.
writeParameter
(
"Number of vertices:"
,
getEntitiesCount
<
0
>
()
);
// TODO: more parameters?
}
template
<
typename
MeshConfig
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
str
,
const
Mesh
<
MeshConfig
>&
mesh
)
...
...
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