Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
7475e1b0
Commit
7475e1b0
authored
Apr 16, 2008
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Small bug fix in ElInfo2d.cc
parent
6640e0b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
68 deletions
+42
-68
AMDiS/src/ElInfo2d.cc
AMDiS/src/ElInfo2d.cc
+0
-19
AMDiS/src/VtkWriter.cc
AMDiS/src/VtkWriter.cc
+28
-42
AMDiS/src/VtkWriter.h
AMDiS/src/VtkWriter.h
+14
-7
No files found.
AMDiS/src/ElInfo2d.cc
View file @
7475e1b0
...
...
@@ -329,27 +329,8 @@ namespace AMDiS {
if
(
nb
->
getNewCoord
(
-
1
))
{
oppCoord_
[
1
]
=
*
(
nb
->
getNewCoord
());
}
else
{
WorldVector
<
double
>
d1
;
for
(
int
j
=
0
;
j
<
dow
;
j
++
)
d1
[
j
]
=
0.5
*
(
elinfo_old
->
oppCoord_
[
2
][
j
]
+
elinfo_old
->
coord_
[
1
][
j
]);
oppCoord_
[
1
].
setMidpoint
(
elinfo_old
->
neighbourCoord_
[
2
][
0
],
elinfo_old
->
neighbourCoord_
[
2
][
2
]);
if
(
!
(
d1
==
oppCoord_
[
1
]))
{
if
((
elinfo_old
->
coord_
[
0
][
0
]
==
0.0
)
||
(
elinfo_old
->
coord_
[
1
][
0
]
==
0.0
)
||
(
elinfo_old
->
coord_
[
2
][
0
]
==
0.0
)
||
(
elinfo_old
->
coord_
[
0
][
0
]
==
80.0
)
||
(
elinfo_old
->
coord_
[
1
][
0
]
==
80.0
)
||
(
elinfo_old
->
coord_
[
2
][
0
]
==
80.0
))
{
}
else
{
ERROR_EXIT
(
"ja 4
\n
"
);
}
}
}
neighbourCoord_
[
1
][
0
]
=
elinfo_old
->
neighbourCoord_
[
2
][
0
];
...
...
AMDiS/src/VtkWriter.cc
View file @
7475e1b0
...
...
@@ -17,12 +17,13 @@ namespace AMDiS {
int
nVertices
=
(
*
dc_
)[
0
]
->
getNumberVertices
();
int
nElements
=
(
*
dc_
)[
0
]
->
getNumberElements
();
int
vertices
=
(
*
dc_
)[
0
]
->
getMesh
()
->
getGeo
(
VERTEX
);
int
degree
=
(
*
dc_
)[
0
]
->
getFeSpace
()
->
getBasisFcts
()
->
getDegree
();
int
dim
=
(
*
dc_
)[
0
]
->
getMesh
()
->
getDim
();
if
((
dim
==
2
)
&&
(
degree
==
2
))
{
if
((
dim
_
==
2
)
&&
(
degree
_
==
2
))
{
nVertices
+=
(
*
dc_
)[
0
]
->
getNumberInterpPoints
();
nElements
*=
4
;
}
else
if
((
dim_
==
2
)
&&
(
degree_
==
3
))
{
nVertices
+=
(
*
dc_
)[
0
]
->
getNumberInterpPoints
();
nElements
*=
9
;
}
::
std
::
ofstream
file
;
...
...
@@ -36,11 +37,7 @@ namespace AMDiS {
file
<<
" <Points>"
<<
::
std
::
endl
;
file
<<
" <DataArray type=
\"
Float32
\"
NumberOfComponents=
\"
3
\"
format=
\"
ascii
\"
>"
<<
::
std
::
endl
;
if
((
dim
==
2
)
&&
(
degree
==
2
))
{
writeVertexCoords_dim2_degree2
(
file
);
}
else
{
writeVertexCoords
(
file
);
}
writeVertexCoords
(
file
);
file
<<
" </DataArray>"
<<
::
std
::
endl
;
file
<<
" </Points>"
<<
::
std
::
endl
;
...
...
@@ -73,7 +70,7 @@ namespace AMDiS {
file
<<
" </DataArray>"
<<
::
std
::
endl
;
file
<<
" <DataArray type=
\"
Int32
\"
Name=
\"
connectivity
\"
>"
<<
::
std
::
endl
;
if
((
dim
==
2
)
&&
(
degree
==
2
))
{
if
((
dim
_
==
2
)
&&
(
degree
_
==
2
))
{
writeConnectivity_dim2_degree2
(
file
);
}
else
{
writeConnectivity
(
file
);
...
...
@@ -87,7 +84,7 @@ namespace AMDiS {
file
<<
" <DataArray type=
\"
Float32
\"
Name=
\"
value"
<<
i
<<
"
\"
format=
\"
ascii
\"
>"
<<
::
std
::
endl
;
if
((
dim
==
2
)
&&
(
degree
==
2
))
{
if
((
dim
_
==
2
)
&&
(
degree
_
==
2
))
{
writeVertexValues_dim2_degree2
(
file
,
i
);
}
else
{
writeVertexValues
(
file
,
i
);
...
...
@@ -110,7 +107,6 @@ namespace AMDiS {
void
VtkWriter
::
writeVertexCoords
(
::
std
::
ofstream
&
file
)
{
DOFVector
<
::
std
::
list
<
VertexInfo
>
>
*
vertexInfos
=
(
*
dc_
)[
0
]
->
getVertexInfos
();
DOFVector
<
::
std
::
list
<
VertexInfo
>
>::
Iterator
it
(
vertexInfos
,
USED_DOFS
);
int
counter
=
0
;
...
...
@@ -123,20 +119,16 @@ namespace AMDiS {
writeCoord
(
file
,
it2
->
coords
);
}
}
}
void
VtkWriter
::
writeVertexCoords_dim2_degree2
(
::
std
::
ofstream
&
file
)
{
writeVertexCoords
(
file
);
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords
=
(
*
dc_
)[
0
]
->
getInterpPointCoords
();
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
it
(
interpPointCoords
,
USED_DOFS
);
for
(
it
.
reset
();
!
it
.
end
();
++
it
)
{
::
std
::
list
<
WorldVector
<
double
>
>::
iterator
it2
;
for
(
it2
=
it
->
begin
();
it2
!=
it
->
end
();
++
it2
)
{
writeCoord
(
file
,
*
it2
);
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>
*
interpPointCoords
=
(
*
dc_
)[
0
]
->
getInterpPointCoords
();
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
pointIt
(
interpPointCoords
,
USED_DOFS
);
for
(
pointIt
.
reset
();
!
pointIt
.
end
();
++
pointIt
)
{
::
std
::
list
<
WorldVector
<
double
>
>::
iterator
it2
;
for
(
it2
=
pointIt
->
begin
();
it2
!=
pointIt
->
end
();
++
it2
)
{
writeCoord
(
file
,
*
it2
);
}
}
}
}
...
...
@@ -162,25 +154,19 @@ namespace AMDiS {
}
}
}
}
void
VtkWriter
::
writeVertexValues_dim2_degree2
(
::
std
::
ofstream
&
file
,
int
componentNo
)
{
writeVertexValues
(
file
,
componentNo
);
DOFVector
<
int
>::
Iterator
intPointIt
((
*
dc_
)[
componentNo
]
->
getInterpPointInd
(),
USED_DOFS
);
DOFVector
<
double
>::
Iterator
valueIt
((
*
dc_
)[
componentNo
]
->
getValues
(),
USED_DOFS
);
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
coordIt
((
*
dc_
)[
componentNo
]
->
getInterpPointCoords
(),
USED_DOFS
);
for
(
intPointIt
.
reset
(),
valueIt
.
reset
(),
coordIt
.
reset
();
!
intPointIt
.
end
();
++
intPointIt
,
++
valueIt
,
++
coordIt
)
{
if
(
*
intPointIt
>=
0
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
coordIt
->
size
());
i
++
)
{
file
<<
" "
<<
(
fabs
(
*
valueIt
)
<
1e-40
?
0.0
:
*
valueIt
)
<<
::
std
::
endl
;
if
((
dim_
==
2
)
&&
(
degree_
>
1
))
{
DOFVector
<
::
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
interpCoordIt
((
*
dc_
)[
componentNo
]
->
getInterpPointCoords
(),
USED_DOFS
);
for
(
intPointIt
.
reset
(),
valueIt
.
reset
(),
interpCoordIt
.
reset
();
!
intPointIt
.
end
();
++
intPointIt
,
++
valueIt
,
++
interpCoordIt
)
{
if
(
*
intPointIt
>=
0
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
interpCoordIt
->
size
());
i
++
)
{
file
<<
" "
<<
(
fabs
(
*
valueIt
)
<
1e-40
?
0.0
:
*
valueIt
)
<<
::
std
::
endl
;
}
}
}
}
...
...
AMDiS/src/VtkWriter.h
View file @
7475e1b0
...
...
@@ -24,6 +24,7 @@
#include <fstream>
#include "BasisFunction.h"
#include "DataCollector.h"
namespace
AMDiS
{
...
...
@@ -38,6 +39,8 @@ namespace AMDiS {
level_
(
level
),
traverseFlag_
(
traverseFlag
)
{
degree_
=
(
*
dc_
)[
0
]
->
getFeSpace
()
->
getBasisFcts
()
->
getDegree
();
dim_
=
(
*
dc_
)[
0
]
->
getMesh
()
->
getDim
();
};
...
...
@@ -60,12 +63,6 @@ namespace AMDiS {
void
writeVertexCoords
(
::
std
::
ofstream
&
file
);
/** \brief
*
*/
void
writeVertexCoords_dim2_degree2
(
::
std
::
ofstream
&
file
);
/** \brief
*
*/
...
...
@@ -120,7 +117,17 @@ namespace AMDiS {
*/
Flag
traverseFlag_
;
/** \brief
*
*/
int
degree_
;
/** \brief
*
*/
int
dim_
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment