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
iwr
amdis
Commits
9ce18f57
Commit
9ce18f57
authored
Oct 23, 2008
by
Thomas Witkowski
Browse files
* More bugfixes for SolutionDataStorage support
parent
9544d86b
Changes
9
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFAdmin.h
View file @
9ce18f57
...
...
@@ -82,7 +82,7 @@ namespace AMDiS {
/** \brief
* constructor
*/
DOFAdmin
(
Mesh
*
m
,
std
::
string
aName
);
DOFAdmin
(
Mesh
*
m
,
std
::
string
aName
);
/** \brief
* copy constructor
...
...
@@ -92,7 +92,7 @@ namespace AMDiS {
/** \brief
* destructor
*/
virtual
~
DOFAdmin
();
~
DOFAdmin
();
/** \brief
* Enlarges the number of DOFs that can be managed at least to minsize by
...
...
@@ -115,7 +115,7 @@ namespace AMDiS {
*/
inline
bool
operator
!=
(
const
DOFAdmin
&
ad
)
const
{
return
!
(
ad
==*
this
);
}
;
}
/** \brief
* Adds a DOFIndexedBase object to the DOFAdmin. This object will be
...
...
AMDiS/src/DOFVector.hh
View file @
9ce18f57
...
...
@@ -82,6 +82,8 @@ namespace AMDiS {
if
(
this
->
boundaryManager
)
{
DELETE
this
->
boundaryManager
;
}
vec
.
clear
();
}
template
<
typename
T
>
...
...
AMDiS/src/Element.cc
View file @
9ce18f57
...
...
@@ -53,17 +53,58 @@ namespace AMDiS {
// call destructor through Mesh::freeElement !!!
Element
::~
Element
()
{
if
(
child
[
0
])
{
if
(
child
[
0
])
{
DELETE
child
[
0
];
if
(
child
[
1
])
}
if
(
child
[
1
])
{
DELETE
child
[
1
];
}
if
(
newCoord
)
{
DELETE
newCoord
;
}
}
void
Element
::
deleteElementDOFs
()
{
int
dim
=
mesh
->
getDim
();
int
j
=
0
;
for
(
int
pos
=
0
;
pos
<=
dim
;
pos
++
)
{
GeoIndex
position
=
INDEX_OF_DIM
(
pos
,
dim
);
int
ndof
=
0
;
for
(
int
i
=
0
;
i
<
mesh
->
getNumberOfDOFAdmin
();
i
++
)
{
ndof
+=
mesh
->
getDOFAdmin
(
i
).
getNumberOfDOFs
(
position
);
}
if
(
ndof
>
0
)
{
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
position
);
i
++
)
{
if
(
dof
[
j
]
!=
NULL
)
{
if
(
Mesh
::
serializedDOFs
.
count
(
dof
[
j
][
0
])
==
0
)
{
// std::cout << "FREE INNER: " << ndof << std::endl;
FREE_MEMORY
(
dof
[
j
],
DegreeOfFreedom
,
ndof
);
Mesh
::
serializedDOFs
[
dof
[
j
][
0
]]
=
NULL
;
}
}
j
++
;
}
}
}
// std::cout << "FREE OUTER: " << mesh->getNumberOfNodes() << std::endl;
FREE_MEMORY
(
dof
,
DegreeOfFreedom
*
,
mesh
->
getNumberOfNodes
());
if
(
child
[
0
])
{
child
[
0
]
->
deleteElementDOFs
();
}
if
(
child
[
1
])
{
child
[
1
]
->
deleteElementDOFs
();
}
}
Element
*
Element
::
cloneWithDOFs
()
{
Element
*
el
;
...
...
AMDiS/src/Element.h
View file @
9ce18f57
...
...
@@ -84,7 +84,7 @@ namespace AMDiS {
/** \brief
* private standard constructor because an Element must know his Mesh
*/
Element
()
{}
;
Element
()
{}
public:
/** \brief
* constructs an Element which belongs to Mesh
...
...
@@ -101,6 +101,8 @@ namespace AMDiS {
*/
virtual
~
Element
();
void
deleteElementDOFs
();
/** \brief
* Clone this Element and return a reference to it. Because also the DOFs
* are cloned, \ref Mesh::serializedDOfs must be used.
...
...
AMDiS/src/Mesh.cc
View file @
9ce18f57
...
...
@@ -92,6 +92,7 @@ namespace AMDiS {
elementDataPrototype
(
NULL
),
elementIndex
(
-
1
),
initialized
(
false
),
macroFileInfo
(
NULL
),
final_lambda
(
dimension
,
DEFAULT_VALUE
,
0.0
)
{
...
...
@@ -118,7 +119,22 @@ namespace AMDiS {
}
Mesh
::~
Mesh
()
{}
{
serializedDOFs
.
empty
();
for
(
std
::
deque
<
MacroElement
*>::
const_iterator
it
=
macroElements
.
begin
();
it
!=
macroElements
.
end
();
++
it
)
{
(
*
it
)
->
getElement
()
->
deleteElementDOFs
();
DELETE
*
it
;
}
serializedDOFs
.
empty
();
if
(
macroFileInfo
)
{
DELETE
macroFileInfo
;
}
}
Mesh
&
Mesh
::
operator
=
(
const
Mesh
&
m
)
{
...
...
@@ -540,10 +556,10 @@ namespace AMDiS {
bool
Mesh
::
findElInfoAtPoint
(
const
WorldVector
<
double
>&
xy
,
ElInfo
*
el_info
,
DimVec
<
double
>&
bary
,
const
MacroElement
*
start_mel
,
DimVec
<
double
>&
bary
,
const
MacroElement
*
start_mel
,
const
WorldVector
<
double
>
*
xy0
,
double
*
sp
)
double
*
sp
)
{
static
const
MacroElement
*
mel
=
NULL
;
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
...
...
@@ -637,8 +653,9 @@ namespace AMDiS {
MSG
(
"outside finest level on el %d: s=%.3e
\n
"
,
el
->
getIndex
(),
s
);
return
(
false
);
/* ??? */
}
else
{
return
(
false
);
}
else
return
(
false
);
}
}
...
...
AMDiS/src/Serializable.h
View file @
9ce18f57
...
...
@@ -52,9 +52,11 @@ namespace AMDiS {
/** \brief
* Returns the type name for this serializable object.
*/
virtual
std
::
string
getTypeName
()
const
{
return
""
;
};
virtual
std
::
string
getTypeName
()
const
{
return
""
;
}
virtual
~
Serializable
()
{}
;
virtual
~
Serializable
()
{}
};
}
...
...
AMDiS/src/SolutionDataStorage.h
View file @
9ce18f57
...
...
@@ -66,10 +66,6 @@ namespace AMDiS {
typename
SolutionHelper
<
T
>::
type
feSpace
,
double
*
timestep
);
T
*
getSolution
()
{
return
solutions
[
0
];
}
/** \brief
* Deletes all pointers and empties all internal vectors.
*/
...
...
@@ -87,19 +83,20 @@ namespace AMDiS {
protected:
/** \brief
*
Auxiliary function for deleting either a single fe space, or a
*
vector of fe spaces
.
*
Deletes the fe space and all it content, i.e., also the dof admin,
*
mesh, etc
.
*/
void
deleteFeSpace
(
FiniteElemSpace
*
feSpace
)
{
DELETE
feSpace
;
}
void
deleteFeSpace
(
FiniteElemSpace
*
feSpace
);
/** \brief
* Deletes a list of fe spaces.
*/
void
deleteFeSpace
(
std
::
vector
<
FiniteElemSpace
*>
feSpaces
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
feSpaces
.
size
());
i
++
)
{
DELETE
feSpaces
[
i
];
deleteFeSpace
(
feSpaces
[
i
]
)
;
}
feSpaces
.
empty
();
feSpaces
.
clear
();
}
int
addMemoryUsage
(
FiniteElemSpace
*
feSpace
)
{
...
...
AMDiS/src/SolutionDataStorage.hh
View file @
9ce18f57
...
...
@@ -23,7 +23,6 @@ namespace AMDiS {
template
<
typename
T
>
SolutionDataStorage
<
T
>::~
SolutionDataStorage
()
{
clear
();
}
template
<
typename
T
>
...
...
@@ -53,7 +52,7 @@ namespace AMDiS {
timestamps
.
push_back
(
timestamp
);
lastPos
++
;
memoryUsage
+=
solution
->
calcMemoryUsage
();
//
memoryUsage += solution->calcMemoryUsage();
}
template
<
typename
T
>
...
...
@@ -112,25 +111,36 @@ namespace AMDiS {
template
<
typename
T
>
void
SolutionDataStorage
<
T
>::
clear
()
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
solutions
.
size
());
i
++
)
{
DELETE
solutions
[
i
];
for
(
int
i
=
1
;
i
<
static_cast
<
int
>
(
solutions
.
size
());
i
++
)
{
DELETE
solutions
[
i
];
}
std
::
cout
<<
"MARK 1"
<<
std
::
endl
;
if
(
!
fixedFESpace
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
feSpaces
.
size
());
i
++
)
{
deleteFeSpace
(
feSpaces
[
i
]);
}
}
std
::
cout
<<
"MARK 2"
<<
std
::
endl
;
solutions
.
clear
();
feSpaces
.
clear
();
timestamps
.
clear
();
lastPos
=
-
1
;
lastPos
=
-
1
;
}
template
<
typename
T
>
void
SolutionDataStorage
<
T
>::
deleteFeSpace
(
FiniteElemSpace
*
feSpace
)
{
if
(
feSpace
)
{
if
(
feSpace
->
getMesh
())
{
DELETE
feSpace
->
getMesh
();
}
if
(
feSpace
->
getAdmin
())
{
DELETE
feSpace
->
getAdmin
();
}
DELETE
feSpace
;
}
}
}
AMDiS/src/SystemVector.h
View file @
9ce18f57
...
...
@@ -140,8 +140,12 @@ namespace AMDiS {
}
}
virtual
~
SystemVector
()
{}
~
SystemVector
()
{
for
(
int
i
=
0
;
i
<
vectors
.
getSize
();
i
++
)
{
DELETE
vectors
[
i
];
}
}
void
createNewDOFVectors
(
std
::
string
name
)
{
...
...
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