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
988bfc8d
Commit
988bfc8d
authored
Nov 20, 2008
by
Thomas Witkowski
Browse files
* Ein paar kleine Aenderungen, was denn sonst
parent
561814e2
Changes
10
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFAdmin.cc
View file @
988bfc8d
...
...
@@ -340,6 +340,11 @@ namespace AMDiS {
{
}
int
DOFAdmin
::
calcMemoryUsage
()
{
return
sizeof
(
DOFAdmin
);
}
void
DOFAdmin
::
serialize
(
std
::
ostream
&
out
)
{
// write name
...
...
AMDiS/src/DOFAdmin.h
View file @
988bfc8d
...
...
@@ -284,6 +284,8 @@ namespace AMDiS {
mesh
=
m
;
}
int
calcMemoryUsage
();
/** \} */
protected:
...
...
AMDiS/src/Element.cc
View file @
988bfc8d
...
...
@@ -545,6 +545,8 @@ namespace AMDiS {
int
result
=
0
;
result
+=
sizeof
(
Element
);
result
+=
mesh
->
getNumberOfNodes
()
*
sizeof
(
DegreeOfFreedom
*
);
if
(
child
[
0
])
{
result
+=
child
[
0
]
->
calcMemoryUsage
()
+
child
[
1
]
->
calcMemoryUsage
();
}
...
...
AMDiS/src/FiniteElemSpace.cc
View file @
988bfc8d
...
...
@@ -97,10 +97,20 @@ namespace AMDiS {
}
}
int
FiniteElemSpace
::
calcMemoryUsage
()
{
int
result
=
sizeof
(
FiniteElemSpace
);
result
+=
mesh
->
calcMemoryUsage
();
return
result
;
}
void
FiniteElemSpace
::
clear
()
{
for
(
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
DELETE
feSpaces
[
i
];
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
feSpaces
.
size
());
i
++
)
{
if
(
feSpaces
[
i
])
{
DELETE
feSpaces
[
i
];
feSpaces
[
i
]
=
NULL
;
}
}
}
}
AMDiS/src/FiniteElemSpace.h
View file @
988bfc8d
...
...
@@ -106,6 +106,8 @@ namespace AMDiS {
return
mesh
;
}
int
calcMemoryUsage
();
static
void
clear
();
protected:
...
...
@@ -116,7 +118,7 @@ namespace AMDiS {
FiniteElemSpace
(
DOFAdmin
*
admin_
,
const
BasisFunction
*
basisFcts
,
Mesh
*
mesh
,
const
std
::
string
&
name
_
=
""
);
const
std
::
string
&
name
=
""
);
protected:
/** \brief
...
...
AMDiS/src/Lagrange.cc
View file @
988bfc8d
...
...
@@ -75,7 +75,10 @@ namespace AMDiS {
{
std
::
list
<
Lagrange
*>::
iterator
it
;
for
(
it
=
allBasFcts
.
begin
();
it
!=
allBasFcts
.
end
();
it
++
)
{
DELETE
*
it
;
if
(
*
it
)
{
DELETE
*
it
;
*
it
=
NULL
;
}
}
}
...
...
AMDiS/src/Mesh.cc
View file @
988bfc8d
...
...
@@ -1058,6 +1058,12 @@ namespace AMDiS {
{
int
result
=
sizeof
(
Mesh
);
result
+=
nDOFEl
;
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
admin
.
size
());
i
++
)
{
result
+=
admin
[
i
]
->
calcMemoryUsage
();
result
+=
admin
[
i
]
->
getUsedSize
()
*
sizeof
(
DegreeOfFreedom
);
}
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
macroElements
.
size
());
i
++
)
{
result
+=
macroElements
[
i
]
->
calcMemoryUsage
();
}
...
...
AMDiS/src/SolutionDataStorage.h
View file @
988bfc8d
...
...
@@ -53,26 +53,12 @@ namespace AMDiS {
void
push
(
T
*
solution
,
double
timestamp
);
/** \brief
*
*/
void
push
(
T
*
solution
,
typename
SolutionHelper
<
T
>::
type
feSpace
,
double
timestamp
);
/** \brief
*
*/
bool
pop
(
T
**
solution
,
double
*
timestep
);
/** \brief
*
*/
bool
pop
(
T
**
solution
,
typename
SolutionHelper
<
T
>::
type
feSpace
,
double
*
timestep
);
/** \brief
* Deletes all pointers and empties all internal vectors.
*/
...
...
@@ -88,18 +74,36 @@ namespace AMDiS {
return
feSpaces
[
i
];
}
/** \brief
*
*/
bool
isPoped
()
{
return
poped
;
}
/** \brief
*
*/
void
addContainer
(
std
::
string
name
);
/** \brief
*
*/
void
push
(
std
::
string
name
,
WorldVector
<
double
>
value
);
/** \brief
*
*/
void
pop
(
std
::
string
name
,
WorldVector
<
double
>
&
value
);
/** \brief
*
*/
void
reset
(
std
::
string
name
);
/** \brief
*
*/
void
clear
(
std
::
string
name
);
protected:
...
...
@@ -120,10 +124,16 @@ namespace AMDiS {
feSpaces
.
clear
();
}
/** \brief
*
*/
int
addMemoryUsage
(
FiniteElemSpace
*
feSpace
)
{
memoryUsage
+=
feSpace
->
getMesh
()
->
calcMemoryUsage
();
}
/** \brief
*
*/
int
addMemoryUsage
(
std
::
vector
<
FiniteElemSpace
*>
feSpaces
)
{
// Is used to determine equal meshes for different components.
std
::
vector
<
Mesh
*>
meshes
;
...
...
@@ -190,8 +200,14 @@ namespace AMDiS {
*/
int
memoryUsage
;
/** \brief
*
*/
std
::
map
<
std
::
string
,
std
::
vector
<
WorldVector
<
double
>
>
>
containers
;
/** \brief
*
*/
std
::
map
<
std
::
string
,
int
>
containersPos
;
};
...
...
AMDiS/src/SolutionDataStorage.hh
View file @
988bfc8d
...
...
@@ -7,7 +7,8 @@ namespace AMDiS {
writeDirectory
(
""
),
fixedFESpace
(
false
),
lastPos
(
-
1
),
poped
(
false
)
poped
(
false
),
memoryUsage
(
0
)
{
solutions
.
empty
();
feSpaces
.
empty
();
...
...
@@ -43,34 +44,37 @@ namespace AMDiS {
void
SolutionDataStorage
<
T
>::
push
(
T
*
solution
,
double
timestamp
)
{
FUNCNAME
(
"SolutionDataStorage<T>::push()"
);
if
(
fixedFESpace
)
{
ERROR_EXIT
(
"Not yet
\n
"
);
}
std
::
vector
<
FiniteElemSpace
*>
feSpace
(
solution
->
getFESpaces
().
size
());
for
(
int
i
=
0
;
i
<
feSpace
.
size
();
i
++
)
{
feSpace
[
i
]
=
NEW
FiniteElemSpace
();
*
(
feSpace
[
i
])
=
*
(
solution
->
getFESpace
(
i
));
memoryUsage
+=
feSpace
[
i
]
->
calcMemoryUsage
();
}
feSpaces
.
push_back
(
feSpace
);
SystemVector
*
vec
=
NEW
SystemVector
(
"tmp"
,
feSpace
,
solution
->
getFESpaces
().
size
());
vec
->
createNewDOFVectors
(
"tmp"
);
vec
->
setCoarsenOperation
(
COARSE_INTERPOL
);
vec
->
interpol
(
solution
,
1.0
);
memoryUsage
+=
vec
->
calcMemoryUsage
();
// If pop was the last operation, cleanup and reset the data storage.
if
(
poped
)
{
clear
();
poped
=
false
;
}
solutions
.
push_back
(
solution
);
solutions
.
push_back
(
vec
);
timestamps
.
push_back
(
timestamp
);
lastPos
++
;
// memoryUsage += solution->calcMemoryUsage();
}
template
<
typename
T
>
void
SolutionDataStorage
<
T
>::
push
(
T
*
solution
,
typename
SolutionHelper
<
T
>::
type
feSpace
,
double
timestamp
)
{
FUNCNAME
(
"SolutionDataStorage<T>::push()"
);
push
(
solution
,
timestamp
);
// Store fe space only, if we do not have a fixed fe space.
TEST_EXIT
(
!
fixedFESpace
)(
"push wit fe space not possible!
\n
"
);
if
(
!
fixedFESpace
)
{
feSpaces
.
push_back
(
feSpace
);
}
}
template
<
typename
T
>
...
...
@@ -90,25 +94,6 @@ namespace AMDiS {
return
true
;
}
template
<
typename
T
>
bool
SolutionDataStorage
<
T
>::
pop
(
T
**
solution
,
typename
SolutionHelper
<
T
>::
type
feSpace
,
double
*
timestep
)
{
if
(
!
pop
(
solution
,
timestep
))
return
false
;
if
(
!
fixedFESpace
)
{
feSpace
=
feSpaces
[
lastPos
+
1
];
// + 1, because lastPos was decremented in pop call above
}
else
{
feSpace
=
feSpaces
[
0
];
}
return
true
;
}
template
<
typename
T
>
void
SolutionDataStorage
<
T
>::
clear
()
{
...
...
@@ -127,6 +112,7 @@ namespace AMDiS {
timestamps
.
clear
();
lastPos
=
-
1
;
memoryUsage
=
0
;
}
template
<
typename
T
>
...
...
AMDiS/src/SystemVector.h
View file @
988bfc8d
...
...
@@ -341,6 +341,8 @@ namespace AMDiS {
result
+=
vectors
[
i
]
->
calcMemoryUsage
();
}
result
+=
sizeof
(
SystemVector
);
return
result
;
}
...
...
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