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
a516513b
There was an error fetching the commit references. Please try again later.
Commit
a516513b
authored
11 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Implementing the mesh integrity checker.
parent
20b81c7a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mesh/tnlMeshInitializer.h
+10
-0
10 additions, 0 deletions
src/mesh/tnlMeshInitializer.h
src/mesh/tnlMeshIntegrityChecker.h
+22
-0
22 additions, 0 deletions
src/mesh/tnlMeshIntegrityChecker.h
tools/src/tnl-mesh-convert.h
+10
-3
10 additions, 3 deletions
tools/src/tnl-mesh-convert.h
with
42 additions
and
3 deletions
src/mesh/tnlMeshInitializer.h
+
10
−
0
View file @
a516513b
...
...
@@ -108,17 +108,27 @@ class tnlMeshInitializerLayer< ConfigTag,
bool
checkCells
()
{
typedef
typename
tnlMeshEntity
<
ConfigTag
,
EntityTag
>::
template
SubentitiesTraits
<
0
>
::
LocalIndexType
LocalIndexType
;
const
GlobalIndexType
numberOfVertices
(
this
->
getMesh
().
getNumberOfVertices
()
);
for
(
GlobalIndexType
cell
=
0
;
cell
<
this
->
getMesh
().
getNumberOfCells
();
cell
++
)
for
(
LocalIndexType
i
=
0
;
i
<
this
->
getMesh
().
getCell
(
cell
).
getNumberOfVertices
();
i
++
)
{
if
(
this
->
getMesh
().
getCell
(
cell
).
getVerticesIndices
()[
i
]
==
-
1
)
{
cerr
<<
"The cell number "
<<
cell
<<
" does not have properly set vertex index number "
<<
i
<<
"."
<<
endl
;
return
false
;
}
if
(
this
->
getMesh
().
getCell
(
cell
).
getVerticesIndices
()[
i
]
>=
numberOfVertices
)
{
cerr
<<
"The cell number "
<<
cell
<<
" does not have properly set vertex index number "
<<
i
<<
". The index is higher than the number of all vertices ( "
<<
numberOfVertices
<<
" )."
<<
endl
;
return
false
;
}
}
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/mesh/tnlMeshIntegrityChecker.h
+
22
−
0
View file @
a516513b
...
...
@@ -23,7 +23,29 @@
template
<
typename
MeshType
>
class
tnlMeshIntegrityChecker
{
public:
typedef
typename
MeshType
::
Config
ConfigTag
;
typedef
typename
ConfigTag
::
CellTag
CellTag
;
typedef
tnlDimensionsTraits
<
CellTag
::
dimensions
>
CellDimensionsTraits
;
typedef
tnlMeshEntitiesTraits
<
ConfigTag
,
CellDimensionsTraits
>
CellTraits
;
typedef
typename
CellTraits
::
SharedContainerType
CellsSharedContainerType
;
typedef
tnlDimensionsTraits
<
0
>
VertexDimensionsTraits
;
typedef
tnlMeshEntitiesTraits
<
ConfigTag
,
VertexDimensionsTraits
>
VertexTraits
;
typedef
typename
VertexTraits
::
SharedContainerType
VertexSharedConatinerType
;
static
bool
checkMesh
(
const
MeshType
&
mesh
)
{
for
(
CellsGlobalIndexType
cell
=
0
;
cell
<
mesh
.
getNumberOfCells
();
cell
++
)
{
cout
<<
"Checking cell number "
<<
cell
<<
endl
;
}
return
true
;
}
};
...
...
This diff is collapsed.
Click to expand it.
tools/src/tnl-mesh-convert.h
+
10
−
3
View file @
a516513b
...
...
@@ -25,6 +25,7 @@
#include
<mesh/topologies/tnlMeshTetrahedronTag.h>
#include
<mesh/tnlMesh.h>
#include
<mesh/tnlMeshInitializer.h>
#include
<mesh/tnlMeshIntegrityChecker.h>
#include
<core/mfilename.h>
template
<
int
Dimensions
>
...
...
@@ -38,8 +39,9 @@ bool readMeshWithDimensions( const tnlParameterContainer& parameters )
struct
MeshConfig
:
public
tnlMeshConfigBase
<
2
>
{
typedef
tnlMeshTriangleTag
CellTag
;
};
tnlMesh
<
MeshConfig
>
mesh
;
};
typedef
tnlMesh
<
MeshConfig
>
MeshType
;
MeshType
mesh
;
if
(
fileExt
==
"ng"
&&
!
tnlMeshReaderNetgen
::
readMesh
<>
(
inputFileName
,
mesh
,
true
)
)
return
false
;
...
...
@@ -47,6 +49,8 @@ bool readMeshWithDimensions( const tnlParameterContainer& parameters )
meshInitializer
.
setVerbose
(
true
);
if
(
!
meshInitializer
.
initMesh
(
mesh
)
)
return
false
;
if
(
!
tnlMeshIntegrityChecker
<
MeshType
>::
checkMesh
(
mesh
)
)
return
false
;
tnlString
outputFile
;
if
(
parameters
.
GetParameter
<
tnlString
>
(
"output-file"
,
outputFile
)
)
{
...
...
@@ -64,7 +68,8 @@ bool readMeshWithDimensions( const tnlParameterContainer& parameters )
{
typedef
tnlMeshTetrahedronTag
CellTag
;
};
tnlMesh
<
MeshConfig
>
mesh
;
typedef
tnlMesh
<
MeshConfig
>
MeshType
;
MeshType
mesh
;
if
(
fileExt
==
"ng"
&&
!
tnlMeshReaderNetgen
::
readMesh
<>
(
inputFileName
,
mesh
,
true
)
)
return
false
;
...
...
@@ -72,6 +77,8 @@ bool readMeshWithDimensions( const tnlParameterContainer& parameters )
meshInitializer
.
setVerbose
(
true
);
if
(
!
meshInitializer
.
initMesh
(
mesh
)
)
return
false
;
if
(
!
tnlMeshIntegrityChecker
<
MeshType
>::
checkMesh
(
mesh
)
)
return
false
;
tnlString
outputFile
;
if
(
parameters
.
GetParameter
<
tnlString
>
(
"output-file"
,
outputFile
)
)
{
...
...
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