Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
65481c8d
Commit
65481c8d
authored
Nov 09, 2010
by
Thomas Witkowski
Browse files
Fixed first nice bug in arh files support.
parent
231692b5
Changes
6
Show whitespace changes
Inline
Side-by-side
AMDiS/src/ArhReader.cc
View file @
65481c8d
...
...
@@ -8,7 +8,7 @@ namespace AMDiS {
using
namespace
std
;
void
ArhReader
::
read
(
string
filename
,
Mesh
*
mesh
)
void
ArhReader
::
read
(
string
filename
,
Mesh
*
mesh
,
bool
ignoreFinerMesh
)
{
FUNCNAME
(
"ArhReader::read()"
);
...
...
@@ -28,36 +28,36 @@ namespace AMDiS {
file
.
open
(
filename
.
c_str
(),
ios
::
in
|
ios
::
binary
);
string
typeId
=
""
;
long
nMacroElements
=
0
;
long
nValueVectors
=
0
;
long
nAllValues
=
0
;
uint32_t
nMacroElements
=
0
;
uint32_t
nValueVectors
=
0
;
uint32_t
nAllValues
=
0
;
file
.
read
(
const_cast
<
char
*>
(
typeId
.
data
()),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nMacroElements
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nValueVectors
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nAllValues
),
4
);
for
(
long
i
=
0
;
i
<
nMacroElements
;
i
++
)
{
long
elIndex
=
0
;
long
nStructureCodes
=
0
;
long
codeSize
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
nMacroElements
;
i
++
)
{
uint32_t
elIndex
=
0
;
uint32_t
nStructureCodes
=
0
;
uint32_t
codeSize
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
elIndex
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nStructureCodes
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
codeSize
),
4
);
vector
<
unsigned
long
>
structureCode
(
nStructureCodes
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
(
structureCode
[
0
])),
4
*
nStructureCodes
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
(
structureCode
[
0
])),
8
*
nStructureCodes
);
MeshStructure
elementStructure
;
elementStructure
.
init
(
structureCode
,
codeSize
);
elementStructure
.
fitMeshToStructure
(
mesh
,
refManager
,
false
,
false
,
elIndex
,
true
);
elementStructure
.
fitMeshToStructure
(
mesh
,
refManager
,
false
,
false
,
elIndex
,
ignoreFinerMesh
);
long
nValuesPerVector
=
0
;
uint32_t
nValuesPerVector
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nValuesPerVector
),
4
);
for
(
long
j
=
0
;
j
<
nValuesPerVector
*
nValueVectors
;
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
nValuesPerVector
*
nValueVectors
;
j
++
)
{
double
value
=
0.0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
value
),
8
);
}
...
...
AMDiS/src/ArhReader.h
View file @
65481c8d
...
...
@@ -29,7 +29,8 @@ namespace AMDiS {
class
ArhReader
{
public:
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
);
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
,
bool
ignoreFinerMesh
=
true
);
};
}
...
...
AMDiS/src/ArhWriter.cc
View file @
65481c8d
...
...
@@ -19,7 +19,7 @@ namespace AMDiS {
string
typeId
=
"arhS"
;
file
.
write
(
typeId
.
c_str
(),
4
);
long
nMacroElements
=
0
;
uint32_t
nMacroElements
=
0
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
0
,
Mesh
::
CALL_EL_LEVEL
);
while
(
elInfo
)
{
...
...
@@ -29,14 +29,14 @@ namespace AMDiS {
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nMacroElements
),
4
);
long
nValueVectors
=
0
;
uint32_t
nValueVectors
=
0
;
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nValueVectors
),
4
);
long
nAllValues
=
0
;
uint32_t
nAllValues
=
0
;
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nAllValues
),
4
);
MeshStructure
elementStructure
;
long
macroElIndex
=
-
1
;
int32_t
macroElIndex
=
-
1
;
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_EVERY_EL_PREORDER
);
while
(
elInfo
)
{
...
...
@@ -67,20 +67,20 @@ namespace AMDiS {
void
ArhWriter
::
writeMacroElement
(
std
::
ofstream
&
file
,
MeshStructure
&
code
,
long
elIndex
)
int32_t
elIndex
)
{
file
.
write
(
reinterpret_cast
<
char
*>
(
&
elIndex
),
4
);
long
nStructureCodes
=
code
.
getCode
().
size
();
uint32_t
nStructureCodes
=
code
.
getCode
().
size
();
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nStructureCodes
),
4
);
long
codeSize
=
code
.
getNumElements
();
uint32_t
codeSize
=
code
.
getNumElements
();
file
.
write
(
reinterpret_cast
<
char
*>
(
&
codeSize
),
4
);
file
.
write
(
reinterpret_cast
<
char
*>
(
&
(
const_cast
<
vector
<
unsigned
long
int
>&>
(
code
.
getCode
())[
0
])),
4
*
nStructureCodes
);
8
*
nStructureCodes
);
long
nValuesPerVector
=
0
;
uint32_t
nValuesPerVector
=
0
;
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nValuesPerVector
),
4
);
}
...
...
AMDiS/src/ArhWriter.h
View file @
65481c8d
...
...
@@ -37,7 +37,7 @@ namespace AMDiS {
protected:
static
void
writeMacroElement
(
std
::
ofstream
&
file
,
MeshStructure
&
code
,
long
elIndex
);
int32_t
elIndex
);
};
}
...
...
AMDiS/src/MeshStructure.cc
View file @
65481c8d
...
...
@@ -257,8 +257,8 @@ namespace AMDiS {
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
else
{
TEST_EXIT
(
element
->
isLeaf
())
(
"Mesh is finer than strucutre code! (Element index: %d
\n
"
,
element
->
getIndex
());
(
"Mesh is finer than strucutre code! (Element index: %d
Macro element index: %d)
\n
"
,
element
->
getIndex
()
,
elInfo
->
getMacroElement
()
->
getIndex
()
);
}
}
...
...
AMDiS/src/RefinementManager3d.cc
View file @
65481c8d
...
...
@@ -598,7 +598,7 @@ namespace AMDiS {
DegreeOfFreedom
*
edge
[
2
];
if
(
el_info
->
getElement
()
->
getMark
()
<=
0
)
return
el_info
;
/
*
element may not be refined
*/
return
el_info
;
/
/
element may not be refined
// === Get memory for a list of all elements at the refinement edge. ===
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment