Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
793a6125
Commit
793a6125
authored
Jun 19, 2015
by
Praetorius, Simon
Browse files
some small errors and warnings corrected
parent
c7d79308
Changes
10
Show whitespace changes
Inline
Side-by-side
AMDiS/src/Expressions.hh
View file @
793a6125
...
@@ -245,6 +245,8 @@ transformDOF_mm(Term term, DOFVector<T>* result)
...
@@ -245,6 +245,8 @@ transformDOF_mm(Term term, DOFVector<T>* result)
*
resultIter
=
(
*
tempIter
);
*
resultIter
=
(
*
tempIter
);
*
resultIter
/=
(
*
assignedIter
);
*
resultIter
/=
(
*
assignedIter
);
}
}
delete
lambda_1
;
}
}
}
// end namespace AMDiS
}
// end namespace AMDiS
AMDiS/src/Mesh.cc
View file @
793a6125
...
@@ -1461,6 +1461,7 @@ namespace AMDiS {
...
@@ -1461,6 +1461,7 @@ namespace AMDiS {
else
else
{
{
ERROR_EXIT
(
"Parallel model only support dim = 2 or 3.
\n
"
);
ERROR_EXIT
(
"Parallel model only support dim = 2 or 3.
\n
"
);
return
;
}
}
refManager
->
globalRefine
(
&
testMesh
,
nParallelPreRefinements
);
refManager
->
globalRefine
(
&
testMesh
,
nParallelPreRefinements
);
...
...
AMDiS/src/ProblemStat.cc
View file @
793a6125
...
@@ -178,20 +178,23 @@ namespace AMDiS {
...
@@ -178,20 +178,23 @@ namespace AMDiS {
if
(
adoptProblem
&&
if
(
adoptProblem
&&
(
adoptFlag
.
isSet
(
INIT_MESH
)
||
(
adoptFlag
.
isSet
(
INIT_MESH
)
||
adoptFlag
.
isSet
(
INIT_SYSTEM
)
||
adoptFlag
.
isSet
(
INIT_SYSTEM
)
||
adoptFlag
.
isSet
(
INIT_FE_SPACE
)))
{
adoptFlag
.
isSet
(
INIT_FE_SPACE
)))
{
meshes
=
adoptProblem
->
getMeshes
();
meshes
=
adoptProblem
->
getMeshes
();
componentMeshes
=
adoptProblem
->
componentMeshes
;
if
(
meshes
.
size
()
==
1
)
componentMeshes
.
resize
(
nComponents
,
meshes
[
0
]);
TEST_EXIT
(
adoptProblem
->
getNumAddComponents
()
+
nAddComponents
>
0
)
else
if
(
adoptProblem
->
getNumComponents
()
>=
nComponents
)
{
(
"Not yet implemented.
\n
"
);
// If the adopt problem has fewer components than this problem, but only one
// mesh for all component, than scal up the componentMeshes array.
if
(
adoptProblem
->
getNumComponents
()
<
nComponents
)
{
TEST_EXIT
(
meshes
.
size
()
==
1
)(
"Daran muss ich noch arbeiten!
\n
"
);
componentMeshes
.
resize
(
nComponents
);
componentMeshes
.
resize
(
nComponents
);
for
(
int
i
=
adoptProblem
->
getNumComponents
();
i
<
nComponents
;
i
++
)
std
::
copy
(
adoptProblem
->
componentMeshes
.
begin
(),
componentMeshes
[
i
]
=
componentMeshes
[
0
];
adoptProblem
->
componentMeshes
.
begin
()
+
nComponents
,
componentMeshes
.
begin
());
}
else
{
componentMeshes
.
resize
(
nComponents
,
meshes
[
0
]);
WARNING
(
"componentMeshes may not be derived correctly from the adoptProblem. You have to do this manually!
\n
"
);
}
if
(
nAddComponents
>
0
)
{
WARNING
(
"Additional meshed can not be adopted from adoptProblem. You have to initialize these meshes manually!
\n
"
);
}
}
}
}
}
}
...
@@ -229,24 +232,26 @@ namespace AMDiS {
...
@@ -229,24 +232,26 @@ namespace AMDiS {
createFeSpace
(
NULL
);
createFeSpace
(
NULL
);
if
(
adoptProblem
&&
if
(
adoptProblem
&&
(
adoptFlag
.
isSet
(
INIT_FE_SPACE
)
||
adoptFlag
.
isSet
(
INIT_SYSTEM
)))
{
(
adoptFlag
.
isSet
(
INIT_FE_SPACE
)
||
adoptFlag
.
isSet
(
INIT_SYSTEM
)))
{
feSpaces
=
adoptProblem
->
getFeSpaces
();
feSpaces
=
adoptProblem
->
getFeSpaces
();
componentSpaces
=
adoptProblem
->
componentSpaces
;
traverseInfo
=
adoptProblem
->
traverseInfo
;
traverseInfo
=
adoptProblem
->
traverseInfo
;
TEST_EXIT
(
adoptProblem
->
getNumAddComponents
()
+
nAddComponents
>
0
)
if
(
feSpaces
.
size
()
==
1
)
(
"Not yet implemented.
\n
"
);
componentSpaces
.
resize
(
nComponents
,
feSpaces
[
0
]);
else
if
(
adoptProblem
->
getNumComponents
()
>=
nComponents
)
{
// If the adopt problem has fewer components than this problem, but only one
// fe space for all component, than scal up the componentSpaces array.
if
(
adoptProblem
->
getNumComponents
()
<
nComponents
)
{
TEST_EXIT
(
feSpaces
.
size
()
==
1
)(
"Daran muss ich noch arbeiten!
\n
"
);
componentSpaces
.
resize
(
nComponents
);
componentSpaces
.
resize
(
nComponents
);
for
(
int
i
=
adoptProblem
->
getNumComponents
();
i
<
nComponents
;
i
++
)
std
::
copy
(
adoptProblem
->
componentSpaces
.
begin
(),
componentSpaces
[
i
]
=
componentSpaces
[
0
];
adoptProblem
->
componentSpaces
.
begin
()
+
nComponents
,
componentSpaces
.
begin
());
}
else
{
componentSpaces
.
resize
(
nComponents
,
feSpaces
[
0
]);
WARNING
(
"componentSpaces may not be derived correctly from the adoptProblem. You have to do this manually!
\n
"
);
}
}
if
(
nAddComponents
>
0
)
{
WARNING
(
"Additional feSpaces can not be adopted from adoptProblem. You have to initialize these fespaces manually!
\n
"
);
}
}
}
}
}
...
@@ -276,10 +281,8 @@ namespace AMDiS {
...
@@ -276,10 +281,8 @@ namespace AMDiS {
}
}
}
}
// #ifndef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
!
solver
)
if
(
!
solver
)
WARNING
(
"no solver created
\n
"
);
WARNING
(
"no solver created
\n
"
);
// #endif
// === create estimator ===
// === create estimator ===
if
(
initFlag
.
isSet
(
INIT_ESTIMATOR
))
if
(
initFlag
.
isSet
(
INIT_ESTIMATOR
))
...
...
AMDiS/src/ProblemStat.h
View file @
793a6125
...
@@ -147,17 +147,6 @@ namespace AMDiS {
...
@@ -147,17 +147,6 @@ namespace AMDiS {
void
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
,
void
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
,
bool
asmMatrix
=
true
,
bool
asmVector
=
true
);
bool
asmMatrix
=
true
,
bool
asmVector
=
true
);
/// Determines the execution order of the single adaption steps. If adapt is
/// true, mesh adaption will be performed. This allows to avoid mesh adaption,
/// e.g. in timestep adaption loops of timestep adaptive strategies.
Flag
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
=
FULL_ITERATION
)
override
;
/// Returns number of managed problems
int
getNumProblems
()
override
{
return
1
;
}
/// Implementation of ProblemStatBase::getNumComponents(), TODO: Wrong!!
/// Implementation of ProblemStatBase::getNumComponents(), TODO: Wrong!!
virtual
int
getNumComponents
()
virtual
int
getNumComponents
()
{
{
...
@@ -169,13 +158,6 @@ namespace AMDiS {
...
@@ -169,13 +158,6 @@ namespace AMDiS {
return
nAddComponents
;
return
nAddComponents
;
}
}
/// Returns the problem with the given number. If only one problem
/// is managed by this master problem, the number hasn't to be given.
ProblemStatBase
*
getProblem
(
int
number
=
0
)
override
{
return
this
;
}
/// Writes output files. TODO: Make obsolete.
/// Writes output files. TODO: Make obsolete.
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
);
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
);
...
@@ -557,11 +539,13 @@ namespace AMDiS {
...
@@ -557,11 +539,13 @@ namespace AMDiS {
return
fileWriters
;
return
fileWriters
;
}
}
/// Returns \ref solutionTime.
double
getSolutionTime
()
double
getSolutionTime
()
{
{
return
solutionTime
;
return
solutionTime
;
}
}
/// Returns \ref buildTime.
double
getBuildTime
()
double
getBuildTime
()
{
{
return
buildTime
;
return
buildTime
;
...
@@ -687,28 +671,52 @@ namespace AMDiS {
...
@@ -687,28 +671,52 @@ namespace AMDiS {
std
::
map
<
Operator
*
,
std
::
vector
<
OperatorPos
>
>
operators
;
std
::
map
<
Operator
*
,
std
::
vector
<
OperatorPos
>
>
operators
;
/// time needed to solve the linear system
double
solutionTime
;
double
solutionTime
;
/// time needed to assemble the linear system
double
buildTime
;
double
buildTime
;
template
<
class
>
friend
class
detail
::
CouplingProblemStat
;
template
<
class
>
friend
class
detail
::
CouplingProblemStat
;
};
};
#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
namespace
detail
struct
ProblemStat
:
public
ProblemStatSeq
,
{
template
<
class
ProblemStatType
>
struct
ProblemStat
:
public
ProblemStatType
,
public
StandardProblemIteration
public
StandardProblemIteration
{
{
typedef
ProblemStatSeq
super
;
using
ProblemStatType
::
getName
;
using
super
::
getName
;
/// Constructor
ProblemStat
(
std
::
string
nameStr
,
ProblemStat
(
std
::
string
nameStr
,
ProblemIterationInterface
*
problemIteration
=
NULL
)
ProblemIterationInterface
*
problemIteration
=
NULL
)
:
su
pe
r
(
nameStr
,
problemIteration
),
:
ProblemStatTy
pe
(
nameStr
,
problemIteration
),
StandardProblemIteration
(
this
)
StandardProblemIteration
(
this
)
{
}
{
}
Flag
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
)
/// Returns number of managed problems
// implements StandardProblemIteration::getNumProblems()
virtual
int
getNumProblems
()
override
{
return
1
;
}
/// Returns the problem with the given number. If only one problem
/// is managed by this master problem, the number hasn't to be given.
// implements StandardProblemIteration::getProblem(int)
virtual
ProblemStatBase
*
getProblem
(
int
number
=
0
)
override
{
return
this
;
}
/// Determines the execution order of the single adaption steps. If adapt is
/// true, mesh adaption will be performed. This allows to avoid mesh adaption,
/// e.g. in timestep adaption loops of timestep adaptive strategies.
// implements StandardProblemIteration::oneIteration(AdaptInfo*, Flag)
virtual
Flag
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
=
FULL_ITERATION
)
override
{
{
for
(
int
i
=
0
;
i
<
getNumComponents
();
i
++
)
for
(
int
i
=
0
;
i
<
ProblemStatType
::
getNumComponents
();
i
++
)
if
(
adaptInfo
->
spaceToleranceReached
(
i
))
if
(
adaptInfo
->
spaceToleranceReached
(
i
))
adaptInfo
->
allowRefinement
(
false
,
i
);
adaptInfo
->
allowRefinement
(
false
,
i
);
else
else
...
@@ -717,6 +725,10 @@ namespace AMDiS {
...
@@ -717,6 +725,10 @@ namespace AMDiS {
return
StandardProblemIteration
::
oneIteration
(
adaptInfo
,
toDo
);
return
StandardProblemIteration
::
oneIteration
(
adaptInfo
,
toDo
);
}
}
};
};
}
#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
typedef
detail
::
ProblemStat
<
ProblemStatSeq
>
ProblemStat
;
#endif
#endif
}
}
...
...
AMDiS/src/io/detail/Arh3Reader.cc
View file @
793a6125
...
@@ -35,16 +35,16 @@ namespace AMDiS { namespace io {
...
@@ -35,16 +35,16 @@ namespace AMDiS { namespace io {
file
.
read
(
const_cast
<
char
*>
(
typeId
.
data
()),
4
);
file
.
read
(
const_cast
<
char
*>
(
typeId
.
data
()),
4
);
TEST_EXIT
(
typeId
==
id
)
TEST_EXIT
(
typeId
==
id
)
(
"Cannot read Arh
2
format: this file is not
\"
arh2
\"
format.
\n
"
);
(
"Cannot read Arh format: this file is not
\"
%s
\"
format.
\n
"
,
id
.
c_str
()
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
major_
),
1
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
major_
),
1
);
TEST_EXIT
(
major
==
major_
)
TEST_EXIT
(
major
==
major_
)
(
"Cannot read Arh
2
format: Arh2Reader major version is %i, the file major version is %i.
\n
"
,
(
"Cannot read Arh format: Arh2Reader major version is %i, the file major version is %i.
\n
"
,
major
,
major_
);
major
,
major_
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
minor_
),
1
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
minor_
),
1
);
TEST_EXIT
(
minor
<=
minor_
)
TEST_EXIT
(
minor
<=
minor_
)
(
"Cannot read Arh
2
format: Arh
2
Reader minor version is %i is smaller than the file minor version %i.
\n
"
,
(
"Cannot read Arh format: ArhReader minor version is %i is smaller than the file minor version %i.
\n
"
,
minor
,
minor_
);
minor
,
minor_
);
}
}
...
@@ -344,7 +344,7 @@ namespace AMDiS { namespace io {
...
@@ -344,7 +344,7 @@ namespace AMDiS { namespace io {
if
((
*
nDOF
)[
0
]
!=
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
3
])
if
((
*
nDOF
)[
0
]
!=
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
3
])
matchdof
=
false
;
matchdof
=
false
;
else
{
else
{
for
(
size_
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
{
for
(
in
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
{
if
((
*
nDOF
)[
j
]
!=
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
j
-
1
]){
if
((
*
nDOF
)[
j
]
!=
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
j
-
1
]){
matchdof
=
false
;
matchdof
=
false
;
break
;
break
;
...
@@ -373,7 +373,7 @@ namespace AMDiS { namespace io {
...
@@ -373,7 +373,7 @@ namespace AMDiS { namespace io {
TEST_EXIT
((
*
nDOF
)[
0
]
==
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
3
])
TEST_EXIT
((
*
nDOF
)[
0
]
==
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
3
])
(
"The fespace of vec number %i is not equal to the correspond fespace.
\n
"
,
i
+
1
);
(
"The fespace of vec number %i is not equal to the correspond fespace.
\n
"
,
i
+
1
);
for
(
size_
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
for
(
in
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
TEST_EXIT
((
*
nDOF
)[
j
]
==
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
j
-
1
])
TEST_EXIT
((
*
nDOF
)[
j
]
==
feSpaceDOFs
[
vecsFeSpaceNum
[
i
]][
j
-
1
])
(
"The fespace of vec number %i is not equal to the correspond fespace.
\n
"
,
i
+
1
);
(
"The fespace of vec number %i is not equal to the correspond fespace.
\n
"
,
i
+
1
);
}
}
...
@@ -498,12 +498,13 @@ namespace AMDiS { namespace io {
...
@@ -498,12 +498,13 @@ namespace AMDiS { namespace io {
template
<
typename
T
>
template
<
typename
T
>
void
readValues
(
stringstream
&
file
,
vector
<
double
>&
values
)
void
readValues
(
stringstream
&
file
,
vector
<
double
>&
values
)
{
{
in
t
size
=
values
.
size
();
size_
t
size
=
values
.
size
();
T
data
[
size
];
T
*
data
=
new
T
[
size
];
file
.
read
(
reinterpret_cast
<
char
*>
(
&
data
[
0
]),
sizeof
(
T
)
*
size
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
data
[
0
]),
sizeof
(
T
)
*
size
);
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
values
[
i
]
=
static_cast
<
double
>
(
data
[
i
]);
values
[
i
]
=
static_cast
<
double
>
(
data
[
i
]);
delete
data
;
}
}
void
readFile
(
string
filename
,
Mesh
*
mesh
,
void
readFile
(
string
filename
,
Mesh
*
mesh
,
...
@@ -587,9 +588,11 @@ namespace AMDiS { namespace io {
...
@@ -587,9 +588,11 @@ namespace AMDiS { namespace io {
Parallel
::
mpi
::
globalAdd
(
nMacros
);
Parallel
::
mpi
::
globalAdd
(
nMacros
);
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
#endif
#endif
{
TEST_EXIT
(
nMacros
==
nMacros_
)
TEST_EXIT
(
nMacros
==
nMacros_
)
(
"Number of macro elements in parallel ARH files doesn't match to the current runtime. %d vs %d
\n
"
,
(
"Number of macro elements in parallel ARH files doesn't match to the current runtime. %d vs %d
\n
"
,
nMacros
,
nMacros_
);
nMacros
,
nMacros_
);
}
if
(
!
parh
)
{
if
(
!
parh
)
{
for
(
int
i
=
0
;
i
<
nProcs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nProcs
;
i
++
)
{
...
@@ -818,7 +821,7 @@ namespace AMDiS { namespace io {
...
@@ -818,7 +821,7 @@ namespace AMDiS { namespace io {
file
.
read
(
const_cast
<
char
*>
(
macroFilename
.
data
()),
macroFile_nl
);
file
.
read
(
const_cast
<
char
*>
(
macroFilename
.
data
()),
macroFile_nl
);
uint32_t
rank
=
0
;
uint32_t
rank
=
0
;
for
(
size_
t
i
=
0
;
i
<
nMacros
;
i
++
)
{
for
(
in
t
i
=
0
;
i
<
nMacros
;
i
++
)
{
file
.
read
(
reinterpret_cast
<
char
*>
(
&
rank
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
rank
),
4
);
partition
.
push_back
(
rank
);
partition
.
push_back
(
rank
);
}
}
...
...
AMDiS/src/io/detail/Arh3Writer.cc
View file @
793a6125
...
@@ -120,9 +120,7 @@ namespace AMDiS { namespace io {
...
@@ -120,9 +120,7 @@ namespace AMDiS { namespace io {
Mesh
*
mesh_
=
mesh
?
mesh
:
vecs
[
0
]
->
getFeSpace
()
->
getMesh
();
Mesh
*
mesh_
=
mesh
?
mesh
:
vecs
[
0
]
->
getFeSpace
()
->
getMesh
();
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
{
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
{
writeParallelFile
(
name
+
".parh"
,
writeParallelFile
(
name
+
".parh"
,
mesh_
,
filenameType
);
mesh
?
mesh
:
vecs
[
0
]
->
getFeSpace
()
->
getMesh
(),
filenameType
);
}
}
TEST_EXIT
(
filenameType
==
"cont"
)(
"Only filename type
\"
cont
\"
.
\n
"
);
TEST_EXIT
(
filenameType
==
"cont"
)(
"Only filename type
\"
cont
\"
.
\n
"
);
...
@@ -195,7 +193,7 @@ namespace AMDiS { namespace io {
...
@@ -195,7 +193,7 @@ namespace AMDiS { namespace io {
string
dataformat
)
string
dataformat
)
{
{
FUNCNAME
(
"Arh3Writer::detail::writeHeader()"
);
FUNCNAME
(
"Arh3Writer::detail::writeHeader()"
);
int
nbits
=
boost
::
lexical_cast
<
int
>
(
dataformat
.
substr
(
2
,
2
));
//
int nbits = boost::lexical_cast<int>(dataformat.substr(2, 2));
TEST_EXIT
(
file
.
is_open
())(
"the file is not open. should not happen.
\n
"
);
TEST_EXIT
(
file
.
is_open
())(
"the file is not open. should not happen.
\n
"
);
map
<
const
FiniteElemSpace
*
,
string
>
AFEDfileName
;
map
<
const
FiniteElemSpace
*
,
string
>
AFEDfileName
;
...
@@ -277,11 +275,11 @@ namespace AMDiS { namespace io {
...
@@ -277,11 +275,11 @@ namespace AMDiS { namespace io {
file
.
write
(
nameStr
.
c_str
(),
nameStrLen
);
file
.
write
(
nameStr
.
c_str
(),
nameStrLen
);
DimVec
<
int
>*
nDOF
=
feSpaceIt
->
first
->
getBasisFcts
()
->
getNumberOfDofs
();
DimVec
<
int
>*
nDOF
=
feSpaceIt
->
first
->
getBasisFcts
()
->
getNumberOfDofs
();
//
//
for
(
size_
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
{
for
(
in
t
j
=
1
;
j
<
nDOF
->
getSize
();
j
++
)
{
posDOFs
=
(
*
nDOF
)[
j
];
posDOFs
=
(
*
nDOF
)[
j
];
file
.
write
(
reinterpret_cast
<
char
*>
(
&
posDOFs
),
4
);
file
.
write
(
reinterpret_cast
<
char
*>
(
&
posDOFs
),
4
);
}
}
for
(
size_
t
j
=
nDOF
->
getSize
();
j
<
4
;
j
++
)
{
for
(
in
t
j
=
nDOF
->
getSize
();
j
<
4
;
j
++
)
{
posDOFs
=
0
;
posDOFs
=
0
;
file
.
write
(
reinterpret_cast
<
char
*>
(
&
posDOFs
),
4
);
file
.
write
(
reinterpret_cast
<
char
*>
(
&
posDOFs
),
4
);
}
}
...
@@ -537,12 +535,13 @@ namespace AMDiS { namespace io {
...
@@ -537,12 +535,13 @@ namespace AMDiS { namespace io {
template
<
typename
T
>
template
<
typename
T
>
int
writeValues
(
stringstream
&
file
,
vector
<
double
>&
values
)
int
writeValues
(
stringstream
&
file
,
vector
<
double
>&
values
)
{
{
in
t
size
=
values
.
size
();
size_
t
size
=
values
.
size
();
T
data
[
size
];
T
*
data
=
new
T
[
size
];
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
data
[
i
]
=
static_cast
<
T
>
(
values
[
i
]);
data
[
i
]
=
static_cast
<
T
>
(
values
[
i
]);
file
.
write
(
reinterpret_cast
<
char
*>
(
&
data
[
0
]),
sizeof
(
T
)
*
size
);
file
.
write
(
reinterpret_cast
<
char
*>
(
&
data
[
0
]),
sizeof
(
T
)
*
size
);
delete
data
;
return
sizeof
(
T
)
*
size
;
return
sizeof
(
T
)
*
size
;
}
}
...
...
AMDiS/src/parallel/ParallelProblemStat.cc
View file @
793a6125
...
@@ -88,7 +88,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -88,7 +88,7 @@ namespace AMDiS { namespace Parallel {
std
::
vector
<
const
FiniteElemSpace
*>
tmpFeSpaces
,
tmpComponentSpaces
(
getComponentSpaces
().
begin
(),
std
::
vector
<
const
FiniteElemSpace
*>
tmpFeSpaces
,
tmpComponentSpaces
(
getComponentSpaces
().
begin
(),
getComponentSpaces
().
begin
()
+
getNumComponents
());
getComponentSpaces
().
begin
()
+
getNumComponents
());
for
(
in
t
i
=
0
;
i
<
tmpComponentSpaces
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
tmpComponentSpaces
.
size
();
i
++
)
if
(
std
::
find
(
tmpFeSpaces
.
begin
(),
tmpFeSpaces
.
end
(),
tmpComponentSpaces
[
i
])
==
tmpFeSpaces
.
end
())
if
(
std
::
find
(
tmpFeSpaces
.
begin
(),
tmpFeSpaces
.
end
(),
tmpComponentSpaces
[
i
])
==
tmpFeSpaces
.
end
())
tmpFeSpaces
.
push_back
(
tmpComponentSpaces
[
i
]);
tmpFeSpaces
.
push_back
(
tmpComponentSpaces
[
i
]);
...
...
AMDiS/src/parallel/ParallelProblemStat.h
View file @
793a6125
...
@@ -77,29 +77,7 @@ namespace AMDiS
...
@@ -77,29 +77,7 @@ namespace AMDiS
}
// end namespace Parallel
}
// end namespace Parallel
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
struct
ProblemStat
:
public
Parallel
::
ParallelProblemStat
,
typedef
detail
::
ProblemStat
<
Parallel
::
ParallelProblemStat
>
ProblemStat
;
public
StandardProblemIteration
{
typedef
Parallel
::
ParallelProblemStat
super
;
using
super
::
getName
;
ProblemStat
(
std
::
string
nameStr
,
ProblemIterationInterface
*
problemIteration
=
NULL
)
:
super
(
nameStr
,
problemIteration
),
StandardProblemIteration
(
this
)
{
}
Flag
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
)
{
for
(
int
i
=
0
;
i
<
getNumComponents
();
i
++
)
if
(
adaptInfo
->
spaceToleranceReached
(
i
))
adaptInfo
->
allowRefinement
(
false
,
i
);
else
adaptInfo
->
allowRefinement
(
true
,
i
);
return
StandardProblemIteration
::
oneIteration
(
adaptInfo
,
toDo
);
}
};
#endif
#endif
}
// end namespace AMDiS
}
// end namespace AMDiS
...
...
AMDiS/src/parallel/StdMpi.cc
View file @
793a6125
...
@@ -633,7 +633,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -633,7 +633,7 @@ namespace AMDiS { namespace Parallel {
void
StdMpiHelper
<
vector
<
Matrix
<
int
>
>
>::
createBuffer
(
vector
<
Matrix
<
int
>
>
&
data
,
int
*
buf
)
void
StdMpiHelper
<
vector
<
Matrix
<
int
>
>
>::
createBuffer
(
vector
<
Matrix
<
int
>
>
&
data
,
int
*
buf
)
{
{
int
dimOfWorld
=
Global
::
getGeo
(
WORLD
);
//
int dimOfWorld = Global::getGeo(WORLD);
int
pos
=
0
;
int
pos
=
0
;
buf
[
pos
++
]
=
data
.
size
()
>
0
?
data
[
0
].
getNumRows
()
:
0
;
buf
[
pos
++
]
=
data
.
size
()
>
0
?
data
[
0
].
getNumRows
()
:
0
;
buf
[
pos
++
]
=
data
.
size
()
>
0
?
data
[
0
].
getNumCols
()
:
0
;
buf
[
pos
++
]
=
data
.
size
()
>
0
?
data
[
0
].
getNumCols
()
:
0
;
...
...
extensions/BackgroundMesh.hh
View file @
793a6125
...
@@ -30,7 +30,7 @@ namespace AMDiS { namespace extensions {
...
@@ -30,7 +30,7 @@ namespace AMDiS { namespace extensions {
template
<
typename
T
>
template
<
typename
T
>
T
Box
::
evalAtPoint
(
const
DOFVector
<
T
>&
vec
,
const
PointType
&
x
,
int
strategy
,
int
nrOfPoints
)
T
Box
::
evalAtPoint
(
const
DOFVector
<
T
>&
vec
,
const
PointType
&
x
,
int
strategy
,
int
nrOfPoints
)
{
{
T
value
;
T
value
=
0
;
switch
(
strategy
)
{
switch
(
strategy
)
{
case
0
:
case
0
:
value
=
evalAtPoint_simple
(
vec
,
x
);
value
=
evalAtPoint_simple
(
vec
,
x
);
...
...
Write
Preview
Supports
Markdown
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