Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
d5e4c931
Commit
d5e4c931
authored
Jan 10, 2011
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some small features to ArhReader and ArhWriter.
parent
5f9656c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
44 deletions
+57
-44
AMDiS/libtool
AMDiS/libtool
+9
-9
AMDiS/src/io/ArhReader.cc
AMDiS/src/io/ArhReader.cc
+24
-14
AMDiS/src/io/ArhReader.h
AMDiS/src/io/ArhReader.h
+4
-3
AMDiS/src/io/ArhWriter.cc
AMDiS/src/io/ArhWriter.cc
+16
-15
AMDiS/src/io/ArhWriter.h
AMDiS/src/io/ArhWriter.h
+4
-3
No files found.
AMDiS/libtool
View file @
d5e4c931
...
...
@@ -82,13 +82,13 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
CC
=
"
g
cc"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
...
...
@@ -171,7 +171,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
""
link_static_flag
=
"
-static
"
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -6798,13 +6798,13 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicxx
"
CC
=
"
g++
"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
...
...
@@ -6887,7 +6887,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
""
link_static_flag
=
"
-static
"
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -6954,11 +6954,11 @@ predeps=""
# Dependencies to place after the objects being linked to create a
# shared library.
postdeps
=
"
-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl
-lstdc++ -lm -lgcc_s
-lpthread
-lc -lgcc_s"
postdeps
=
"-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path
=
"-L/usr/lib64
-L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64
/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
compiler_lib_search_path
=
"-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
# Method to check whether dependent libraries are shared objects.
deplibs_check_method
=
"pass_all"
...
...
@@ -7103,7 +7103,7 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
...
...
AMDiS/src/io/ArhReader.cc
View file @
d5e4c931
...
...
@@ -24,27 +24,35 @@ namespace AMDiS {
using
namespace
std
;
void
ArhReader
::
read
(
std
::
string
filename
,
Mesh
*
mesh
)
void
ArhReader
::
read
(
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec0
,
DOFVector
<
double
>*
vec1
,
DOFVector
<
double
>*
vec2
)
{
std
::
vector
<
DOFVector
<
double
>*>
vecs
(
0
);
ArhReader
::
read
(
filename
,
mesh
,
vecs
);
}
vector
<
DOFVector
<
double
>*>
vecs
(
0
);
if
(
vec0
!=
NULL
)
vecs
.
push_back
(
vec0
);
if
(
vec1
!=
NULL
)
vecs
.
push_back
(
vec1
);
if
(
vec2
!=
NULL
)
vecs
.
push_back
(
vec2
);
void
ArhReader
::
read
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec
)
{
std
::
vector
<
DOFVector
<
double
>*>
vecs
(
1
);
vecs
[
0
]
=
vec
;
ArhReader
::
read
(
filename
,
mesh
,
vecs
);
}
void
ArhReader
::
read
(
string
filename
,
Mesh
*
mesh
,
std
::
vector
<
DOFVector
<
double
>*>
vecs
)
vector
<
DOFVector
<
double
>*>
vecs
)
{
FUNCNAME
(
"ArhReader::read()"
);
// === Get set of all macro elements in mesh. ===
std
::
set
<
int
>
macroInMesh
;
for
(
std
::
deque
<
MacroElement
*>::
iterator
it
=
mesh
->
getMacroElements
().
begin
();
it
!=
mesh
->
getMacroElements
().
end
();
++
it
)
macroInMesh
.
insert
((
*
it
)
->
getIndex
());
RefinementManager
*
refManager
=
NULL
;
switch
(
mesh
->
getDim
())
{
case
2
:
...
...
@@ -88,7 +96,8 @@ namespace AMDiS {
MeshStructure
elementStructure
;
elementStructure
.
init
(
structureCode
,
codeSize
);
elementStructure
.
fitMeshToStructure
(
mesh
,
refManager
,
false
,
elIndex
);
if
(
macroInMesh
.
count
(
elIndex
)
==
1
)
elementStructure
.
fitMeshToStructure
(
mesh
,
refManager
,
false
,
elIndex
);
uint32_t
nValuesPerVector
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nValuesPerVector
),
4
);
...
...
@@ -96,7 +105,8 @@ namespace AMDiS {
for
(
unsigned
int
j
=
0
;
j
<
nValueVectors
;
j
++
)
{
vector
<
double
>
values
(
nValuesPerVector
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
(
values
[
0
])),
8
*
nValuesPerVector
);
setDofValues
(
elIndex
,
mesh
,
values
,
vecs
[
j
]);
if
(
macroInMesh
.
count
(
elIndex
)
==
1
)
setDofValues
(
elIndex
,
mesh
,
values
,
vecs
[
j
]);
}
}
...
...
@@ -107,7 +117,7 @@ namespace AMDiS {
void
ArhReader
::
setDofValues
(
int
macroElIndex
,
Mesh
*
mesh
,
std
::
vector
<
double
>&
values
,
DOFVector
<
double
>*
vec
)
vector
<
double
>&
values
,
DOFVector
<
double
>*
vec
)
{
FUNCNAME
(
"ArhReader::setDofValues()"
);
...
...
AMDiS/src/io/ArhReader.h
View file @
d5e4c931
...
...
@@ -30,9 +30,10 @@ namespace AMDiS {
class
ArhReader
{
public:
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
);
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec
);
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec0
=
NULL
,
DOFVector
<
double
>*
vec1
=
NULL
,
DOFVector
<
double
>*
vec2
=
NULL
);
static
void
read
(
std
::
string
filename
,
Mesh
*
mesh
,
std
::
vector
<
DOFVector
<
double
>*>
vecs
);
...
...
AMDiS/src/io/ArhWriter.cc
View file @
d5e4c931
...
...
@@ -24,24 +24,25 @@ namespace AMDiS {
using
namespace
std
;
void
ArhWriter
::
write
(
string
filename
,
Mesh
*
mesh
)
void
ArhWriter
::
write
(
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec0
,
DOFVector
<
double
>*
vec1
,
DOFVector
<
double
>*
vec2
)
{
std
::
vector
<
DOFVector
<
double
>*>
vecs
(
0
);
ArhWriter
::
write
(
filename
,
mesh
,
vecs
);
}
void
ArhWriter
::
write
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec
)
{
std
::
vector
<
DOFVector
<
double
>*>
vecs
(
1
);
vecs
[
0
]
=
vec
;
vector
<
DOFVector
<
double
>*>
vecs
(
0
);
if
(
vec0
!=
NULL
)
vecs
.
push_back
(
vec0
);
if
(
vec1
!=
NULL
)
vecs
.
push_back
(
vec1
);
if
(
vec2
!=
NULL
)
vecs
.
push_back
(
vec2
);
ArhWriter
::
write
(
filename
,
mesh
,
vecs
);
}
void
ArhWriter
::
write
(
std
::
string
filename
,
Mesh
*
mesh
,
std
::
vector
<
DOFVector
<
double
>*>
vecs
)
void
ArhWriter
::
write
(
string
filename
,
Mesh
*
mesh
,
vector
<
DOFVector
<
double
>*>
vecs
)
{
FUNCNAME
(
"ArhWriter::write()"
);
...
...
@@ -69,7 +70,7 @@ namespace AMDiS {
file
.
write
(
reinterpret_cast
<
char
*>
(
&
nAllValues
),
4
);
MeshStructure
elementStructure
;
std
::
vector
<
std
::
vector
<
double
>
>
values
(
vecs
.
size
());
vector
<
vector
<
double
>
>
values
(
vecs
.
size
());
int32_t
macroElIndex
=
-
1
;
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_EVERY_EL_PREORDER
);
...
...
@@ -111,9 +112,9 @@ namespace AMDiS {
}
void
ArhWriter
::
writeMacroElement
(
std
::
ofstream
&
file
,
void
ArhWriter
::
writeMacroElement
(
ofstream
&
file
,
MeshStructure
&
code
,
std
::
vector
<
std
::
vector
<
double
>
>&
values
,
vector
<
vector
<
double
>
>&
values
,
int32_t
elIndex
)
{
file
.
write
(
reinterpret_cast
<
char
*>
(
&
elIndex
),
4
);
...
...
AMDiS/src/io/ArhWriter.h
View file @
d5e4c931
...
...
@@ -33,9 +33,10 @@ namespace AMDiS {
class
ArhWriter
{
public:
static
void
write
(
std
::
string
filename
,
Mesh
*
mesh
);
static
void
write
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec
);
static
void
write
(
std
::
string
filename
,
Mesh
*
mesh
,
DOFVector
<
double
>*
vec0
=
NULL
,
DOFVector
<
double
>*
vec1
=
NULL
,
DOFVector
<
double
>*
vec2
=
NULL
);
static
void
write
(
std
::
string
filename
,
Mesh
*
mesh
,
std
::
vector
<
DOFVector
<
double
>*>
vecs
);
...
...
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