Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Backofen, Rainer
amdis
Commits
d2842e3c
Commit
d2842e3c
authored
16 years ago
by
Thomas Witkowski
Browse files
Options
Downloads
Patches
Plain Diff
* Add some documentation comments to DataCollector and Vtkwriter
parent
bb580238
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AMDiS/src/DataCollector.cc
+8
-2
8 additions, 2 deletions
AMDiS/src/DataCollector.cc
AMDiS/src/DataCollector.h
+2
-3
2 additions, 3 deletions
AMDiS/src/DataCollector.h
AMDiS/src/VtkWriter.cc
+6
-2
6 additions, 2 deletions
AMDiS/src/VtkWriter.cc
AMDiS/src/VtkWriter.h
+17
-28
17 additions, 28 deletions
AMDiS/src/VtkWriter.h
with
33 additions
and
35 deletions
AMDiS/src/DataCollector.cc
+
8
−
2
View file @
d2842e3c
...
@@ -127,7 +127,6 @@ namespace AMDiS {
...
@@ -127,7 +127,6 @@ namespace AMDiS {
}
}
// Traverse elements to create interpolation values.
// Traverse elements to create interpolation values.
counter
=
0
;
elInfo
=
stack
.
traverseFirst
(
mesh_
,
level_
,
traverseFlag_
|
Mesh
::
FILL_COORDS
);
elInfo
=
stack
.
traverseFirst
(
mesh_
,
level_
,
traverseFlag_
|
Mesh
::
FILL_COORDS
);
while
(
elInfo
)
{
while
(
elInfo
)
{
if
(
!
writeElem_
||
writeElem_
(
elInfo
))
if
(
!
writeElem_
||
writeElem_
(
elInfo
))
...
@@ -273,7 +272,9 @@ namespace AMDiS {
...
@@ -273,7 +272,9 @@ namespace AMDiS {
const
BasisFunction
*
basisFcts
=
feSpace_
->
getBasisFcts
();
const
BasisFunction
*
basisFcts
=
feSpace_
->
getBasisFcts
();
const
DegreeOfFreedom
*
localDOFs
=
basisFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
localAdmin_
,
NULL
);
const
DegreeOfFreedom
*
localDOFs
=
basisFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
localAdmin_
,
NULL
);
const
int
nBasisFcts
=
basisFcts
->
getNumber
();
const
int
nBasisFcts
=
basisFcts
->
getNumber
();
// First, traverse all DOFs at the vertices of the element, determine
// their coordinates and add them to the corresponding entry in dofCoords_.
for
(
int
i
=
0
;
i
<
mesh_
->
getGeo
(
VERTEX
);
i
++
)
{
for
(
int
i
=
0
;
i
<
mesh_
->
getGeo
(
VERTEX
);
i
++
)
{
(
*
interpPointInd_
)[
localDOFs
[
i
]]
=
-
2
;
// mark as vertex
(
*
interpPointInd_
)[
localDOFs
[
i
]]
=
-
2
;
// mark as vertex
...
@@ -295,6 +296,11 @@ namespace AMDiS {
...
@@ -295,6 +296,11 @@ namespace AMDiS {
}
}
// Then, traverse all interpolation DOFs of the element, determine
// their coordinates and add them to the corresponding entry in
// interpPointCoords_.
for
(
int
i
=
mesh_
->
getGeo
(
VERTEX
);
i
<
nBasisFcts
;
i
++
)
{
for
(
int
i
=
mesh_
->
getGeo
(
VERTEX
);
i
<
nBasisFcts
;
i
++
)
{
WorldVector
<
double
>
interpolCoords
;
WorldVector
<
double
>
interpolCoords
;
elInfo
->
coordToWorld
(
*
basisFcts
->
getCoords
(
i
),
&
interpolCoords
);
elInfo
->
coordToWorld
(
*
basisFcts
->
getCoords
(
i
),
&
interpolCoords
);
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/DataCollector.h
+
2
−
3
View file @
d2842e3c
...
@@ -245,7 +245,8 @@ namespace AMDiS {
...
@@ -245,7 +245,8 @@ namespace AMDiS {
::
std
::
vector
<
::
std
::
vector
<
int
>
>
interpPoints_
;
::
std
::
vector
<
::
std
::
vector
<
int
>
>
interpPoints_
;
/** \brief
/** \brief
*
* Stores for each DOF a list of its coordinates. If there are now periodic
* boundaries than there is also only one coordinate per DOF.
*/
*/
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords_
;
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords_
;
...
@@ -294,8 +295,6 @@ namespace AMDiS {
...
@@ -294,8 +295,6 @@ namespace AMDiS {
* Pointer to a function which decides whether an element is considered.
* Pointer to a function which decides whether an element is considered.
*/
*/
bool
(
*
writeElem_
)(
ElInfo
*
);
bool
(
*
writeElem_
)(
ElInfo
*
);
int
counter
;
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/VtkWriter.cc
+
6
−
2
View file @
d2842e3c
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
#include
<cmath>
#include
<cmath>
#include
"VtkWriter.h"
#include
"VtkWriter.h"
#include
"Traverse.h"
#include
"DataCollector.h"
#include
"DataCollector.h"
#include
"DOFVector.h"
#include
"DOFVector.h"
#include
"SurfaceRegion_ED.h"
#include
"SurfaceRegion_ED.h"
...
@@ -105,7 +104,7 @@ namespace AMDiS {
...
@@ -105,7 +104,7 @@ namespace AMDiS {
DOFVector
<
::
std
::
list
<
VertexInfo
>
>::
Iterator
it
(
vertexInfos
,
USED_DOFS
);
DOFVector
<
::
std
::
list
<
VertexInfo
>
>::
Iterator
it
(
vertexInfos
,
USED_DOFS
);
int
counter
=
0
;
int
counter
=
0
;
//
f
or all DOFs
//
F
or all DOFs
of vertices, write the coordinates.
for
(
it
.
reset
();
!
it
.
end
();
++
it
)
{
for
(
it
.
reset
();
!
it
.
end
();
++
it
)
{
// for all vertex infos of this DOF
// for all vertex infos of this DOF
::
std
::
list
<
VertexInfo
>::
iterator
it2
;
::
std
::
list
<
VertexInfo
>::
iterator
it2
;
...
@@ -115,6 +114,7 @@ namespace AMDiS {
...
@@ -115,6 +114,7 @@ namespace AMDiS {
}
}
}
}
// For the second dim case, write also the interpolation points.
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords
=
(
*
dc_
)[
0
]
->
getInterpPointCoords
();
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords
=
(
*
dc_
)[
0
]
->
getInterpPointCoords
();
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
pointIt
(
interpPointCoords
,
USED_DOFS
);
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
pointIt
(
interpPointCoords
,
USED_DOFS
);
...
@@ -139,6 +139,7 @@ namespace AMDiS {
...
@@ -139,6 +139,7 @@ namespace AMDiS {
DOFVector
<
double
>::
Iterator
valueIt
(
values
,
USED_DOFS
);
DOFVector
<
double
>::
Iterator
valueIt
(
values
,
USED_DOFS
);
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
coordIt
(
dofCoords
,
USED_DOFS
);
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
coordIt
(
dofCoords
,
USED_DOFS
);
// Write the values for all vertex DOFs.
for
(
intPointIt
.
reset
(),
valueIt
.
reset
(),
coordIt
.
reset
();
for
(
intPointIt
.
reset
(),
valueIt
.
reset
(),
coordIt
.
reset
();
!
intPointIt
.
end
();
!
intPointIt
.
end
();
++
intPointIt
,
++
valueIt
,
++
coordIt
)
{
++
intPointIt
,
++
valueIt
,
++
coordIt
)
{
...
@@ -150,6 +151,7 @@ namespace AMDiS {
...
@@ -150,6 +151,7 @@ namespace AMDiS {
}
}
}
}
// For the second dim case, write also the values of the interpolation points.
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
interpCoordIt
((
*
dc_
)[
componentNo
]
->
getInterpPointCoords
(),
USED_DOFS
);
interpCoordIt
((
*
dc_
)[
componentNo
]
->
getInterpPointCoords
(),
USED_DOFS
);
...
@@ -170,6 +172,8 @@ namespace AMDiS {
...
@@ -170,6 +172,8 @@ namespace AMDiS {
void
VtkWriter
::
writeConnectivity
(
::
std
::
ofstream
&
file
)
void
VtkWriter
::
writeConnectivity
(
::
std
::
ofstream
&
file
)
{
{
// For the second dim case, and if higher order Lagrange elements are used,
// write the connectivity by extra functions.
if
((
dim_
==
2
)
&&
(
degree_
==
2
))
{
if
((
dim_
==
2
)
&&
(
degree_
==
2
))
{
writeConnectivity_dim2_degree2
(
file
);
writeConnectivity_dim2_degree2
(
file
);
}
else
if
((
dim_
==
2
)
&&
(
degree_
==
3
))
{
}
else
if
((
dim_
==
2
)
&&
(
degree_
==
3
))
{
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/VtkWriter.h
+
17
−
28
View file @
d2842e3c
...
@@ -32,12 +32,8 @@ namespace AMDiS {
...
@@ -32,12 +32,8 @@ namespace AMDiS {
class
VtkWriter
class
VtkWriter
{
{
public:
public:
VtkWriter
(
::
std
::
vector
<
DataCollector
*>
*
dc
,
VtkWriter
(
::
std
::
vector
<
DataCollector
*>
*
dc
)
int
level
=
-
1
,
:
dc_
(
dc
)
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
)
:
dc_
(
dc
),
level_
(
level
),
traverseFlag_
(
traverseFlag
)
{
{
degree_
=
(
*
dc_
)[
0
]
->
getFeSpace
()
->
getBasisFcts
()
->
getDegree
();
degree_
=
(
*
dc_
)[
0
]
->
getFeSpace
()
->
getBasisFcts
()
->
getDegree
();
dim_
=
(
*
dc_
)[
0
]
->
getMesh
()
->
getDim
();
dim_
=
(
*
dc_
)[
0
]
->
getMesh
()
->
getDim
();
...
@@ -58,42 +54,47 @@ namespace AMDiS {
...
@@ -58,42 +54,47 @@ namespace AMDiS {
const
char
*
animationFilename
);
const
char
*
animationFilename
);
protected
:
protected
:
/** \brief
/** \brief
*
* Writes all coordinates of vertices and interpolation points to an
* output file.
*/
*/
void
writeVertexCoords
(
::
std
::
ofstream
&
file
);
void
writeVertexCoords
(
::
std
::
ofstream
&
file
);
/** \brief
/** \brief
*
* Writes all values of vertices and interpolation point to an output
* file.
*/
*/
void
writeVertexValues
(
::
std
::
ofstream
&
file
,
int
componentNo
);
void
writeVertexValues
(
::
std
::
ofstream
&
file
,
int
componentNo
);
/** \brief
/** \brief
*
*
Writes the connectivity of all simplices to an output file.
*/
*/
void
writeConnectivity
(
::
std
::
ofstream
&
file
);
void
writeConnectivity
(
::
std
::
ofstream
&
file
);
/** \brief
/** \brief
*
* Writes the connectivity for the case dim = 2 and degree = 2 to
* an output file.
*/
*/
void
writeConnectivity_dim2_degree2
(
::
std
::
ofstream
&
file
);
void
writeConnectivity_dim2_degree2
(
::
std
::
ofstream
&
file
);
/** \brief
/** \brief
*
* Writes the connectivity for the case dim = 2 and degree = 3 to
* an output file.
*/
*/
void
writeConnectivity_dim2_degree3
(
::
std
::
ofstream
&
file
);
void
writeConnectivity_dim2_degree3
(
::
std
::
ofstream
&
file
);
/** \brief
/** \brief
*
* Writes the connectivity for the case dim = 2 and degree = 4 to
* an output file.
*/
*/
void
writeConnectivity_dim2_degree4
(
::
std
::
ofstream
&
file
);
void
writeConnectivity_dim2_degree4
(
::
std
::
ofstream
&
file
);
/** \brief
/** \brief
*
*
Writes a world coordinate to a given file.
*/
*/
inline
void
writeCoord
(
::
std
::
ofstream
&
file
,
WorldVector
<
double
>
coord
)
{
inline
void
writeCoord
(
::
std
::
ofstream
&
file
,
WorldVector
<
double
>
coord
)
{
for
(
int
i
=
0
;
i
<
Global
::
getGeo
(
WORLD
);
i
++
)
{
for
(
int
i
=
0
;
i
<
Global
::
getGeo
(
WORLD
);
i
++
)
{
...
@@ -107,31 +108,19 @@ namespace AMDiS {
...
@@ -107,31 +108,19 @@ namespace AMDiS {
private
:
private
:
/**
/**
*
*
List of DataCollectors, for each component of the problem one.
*/
*/
::
std
::
vector
<
DataCollector
*>
*
dc_
;
::
std
::
vector
<
DataCollector
*>
*
dc_
;
/** \brief
/** \brief
* Level information for traversing the mesh.
* Degree of the basis function of the problem.
*/
int
level_
;
/** \brief
* Flags for traversing the mesh.
*/
Flag
traverseFlag_
;
/** \brief
*
*/
*/
int
degree_
;
int
degree_
;
/** \brief
/** \brief
*
*
Dimension of the geometry.
*/
*/
int
dim_
;
int
dim_
;
};
};
...
...
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