Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Aland, Sebastian
amdis
Commits
ceecc7c5
Commit
ceecc7c5
authored
Nov 06, 2008
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Most changes due to correct deletion of meshes
parent
d43a4c28
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
974 additions
and
788 deletions
+974
-788
AMDiS/bin/Makefile.am
AMDiS/bin/Makefile.am
+3
-2
AMDiS/bin/Makefile.in
AMDiS/bin/Makefile.in
+5
-14
AMDiS/src/AMDiS.h
AMDiS/src/AMDiS.h
+2
-0
AMDiS/src/CoarseningManager2d.cc
AMDiS/src/CoarseningManager2d.cc
+22
-27
AMDiS/src/CreatorInterface.h
AMDiS/src/CreatorInterface.h
+5
-5
AMDiS/src/CreatorMap.cc
AMDiS/src/CreatorMap.cc
+0
-1
AMDiS/src/CreatorMap.h
AMDiS/src/CreatorMap.h
+54
-51
AMDiS/src/CreatorMap.hh
AMDiS/src/CreatorMap.hh
+18
-0
AMDiS/src/DOFMatrix.cc
AMDiS/src/DOFMatrix.cc
+5
-0
AMDiS/src/Element.cc
AMDiS/src/Element.cc
+43
-24
AMDiS/src/Element.h
AMDiS/src/Element.h
+9
-16
AMDiS/src/ElementData.cc
AMDiS/src/ElementData.cc
+46
-3
AMDiS/src/ElementData.h
AMDiS/src/ElementData.h
+13
-26
AMDiS/src/FiniteElemSpace.cc
AMDiS/src/FiniteElemSpace.cc
+12
-2
AMDiS/src/FiniteElemSpace.h
AMDiS/src/FiniteElemSpace.h
+3
-1
AMDiS/src/Global.cc
AMDiS/src/Global.cc
+8
-1
AMDiS/src/Global.h
AMDiS/src/Global.h
+2
-0
AMDiS/src/InterpolRestrictMatrix.h
AMDiS/src/InterpolRestrictMatrix.h
+1
-1
AMDiS/src/Lagrange.cc
AMDiS/src/Lagrange.cc
+25
-7
AMDiS/src/Lagrange.h
AMDiS/src/Lagrange.h
+2
-0
AMDiS/src/LagrangeInterpolRestrict.cc
AMDiS/src/LagrangeInterpolRestrict.cc
+0
-26
AMDiS/src/LagrangeInterpolRestrict.h
AMDiS/src/LagrangeInterpolRestrict.h
+44
-34
AMDiS/src/LeafData.cc
AMDiS/src/LeafData.cc
+50
-62
AMDiS/src/LeafData.h
AMDiS/src/LeafData.h
+61
-44
AMDiS/src/MacroElement.cc
AMDiS/src/MacroElement.cc
+2
-1
AMDiS/src/MacroElement.h
AMDiS/src/MacroElement.h
+1
-1
AMDiS/src/MacroReader.cc
AMDiS/src/MacroReader.cc
+26
-17
AMDiS/src/Mesh.cc
AMDiS/src/Mesh.cc
+29
-19
AMDiS/src/Mesh.h
AMDiS/src/Mesh.h
+1
-1
AMDiS/src/MultiGridSolverBase.h
AMDiS/src/MultiGridSolverBase.h
+16
-2
AMDiS/src/MultiGridSolverBase.hh
AMDiS/src/MultiGridSolverBase.hh
+30
-0
AMDiS/src/OEMSolver.h
AMDiS/src/OEMSolver.h
+1
-1
AMDiS/src/OEMSolver.hh
AMDiS/src/OEMSolver.hh
+3
-0
AMDiS/src/Parameters.cc
AMDiS/src/Parameters.cc
+8
-1
AMDiS/src/Parameters.h
AMDiS/src/Parameters.h
+28
-17
AMDiS/src/ProblemInterpolScal.cc
AMDiS/src/ProblemInterpolScal.cc
+6
-5
AMDiS/src/ProblemNonLin.cc
AMDiS/src/ProblemNonLin.cc
+7
-7
AMDiS/src/ProblemNonLin.h
AMDiS/src/ProblemNonLin.h
+10
-10
AMDiS/src/ProblemScal.cc
AMDiS/src/ProblemScal.cc
+165
-138
AMDiS/src/ProblemScal.h
AMDiS/src/ProblemScal.h
+75
-76
AMDiS/src/RCNeighbourList.cc
AMDiS/src/RCNeighbourList.cc
+100
-120
AMDiS/src/RCNeighbourList.h
AMDiS/src/RCNeighbourList.h
+14
-11
AMDiS/src/RefinementManager2d.cc
AMDiS/src/RefinementManager2d.cc
+9
-5
AMDiS/src/SolutionDataStorage.h
AMDiS/src/SolutionDataStorage.h
+4
-0
AMDiS/src/SolutionDataStorage.hh
AMDiS/src/SolutionDataStorage.hh
+3
-8
AMDiS/src/Triangle.h
AMDiS/src/Triangle.h
+3
-1
No files found.
AMDiS/bin/Makefile.am
View file @
ceecc7c5
...
...
@@ -58,7 +58,7 @@ endif
libamdis_la_SOURCES
=
\
$(PARALLEL_AMDIS_SOURCES)
\
$(SOURCE_DIR)
/MultiGridPreconWrapper.h
$(SOURCE_DIR)
/MultiGridPreconWrapper.cc
\
$(SOURCE_DIR)
/LagrangeInterpolRestrict.h
$(SOURCE_DIR)
/LagrangeInterpolRestrict.cc
\
$(SOURCE_DIR)
/LagrangeInterpolRestrict.h
\
$(SOURCE_DIR)
/BiCGStab.h
$(SOURCE_DIR)
/BiCGStab.hh
\
$(SOURCE_DIR)
/BiCGStab2.h
$(SOURCE_DIR)
/BiCGStab2.hh
\
$(SOURCE_DIR)
/InterpolRestrictMatrix.h
$(SOURCE_DIR)
/InterpolRestrictMatrix.cc
\
...
...
@@ -84,7 +84,8 @@ $(SOURCE_DIR)/ProblemVec.h $(SOURCE_DIR)/ProblemVec.cc \
$(SOURCE_DIR)
/DualTraverse.h
$(SOURCE_DIR)
/DualTraverse.cc
\
$(SOURCE_DIR)
/ElementPartition_ED.h
$(SOURCE_DIR)
/SurfacePartition_ED.h
\
$(SOURCE_DIR)
/ElementData.h
$(SOURCE_DIR)
/ElementData.cc
\
$(SOURCE_DIR)
/CreatorMap.h
$(SOURCE_DIR)
/CreatorMap.cc
$(SOURCE_DIR)
/CreatorInterface.h
\
$(SOURCE_DIR)
/CreatorMap.h
$(SOURCE_DIR)
/CreatorMap.hh
$(SOURCE_DIR)
/CreatorMap.cc
\
$(SOURCE_DIR)
/CreatorInterface.h
\
$(SOURCE_DIR)
/ElementFunction.h
\
$(SOURCE_DIR)
/ProblemInterpolScal.h
$(SOURCE_DIR)
/ProblemInterpolScal.cc
\
$(SOURCE_DIR)
/ProblemInterpolVec.h
$(SOURCE_DIR)
/ProblemInterpolVec.cc
\
...
...
AMDiS/bin/Makefile.in
View file @
ceecc7c5
...
...
@@ -81,7 +81,6 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ConditionalEstimator.h \
$(SOURCE_DIR)
/MultiGridPreconWrapper.h
\
$(SOURCE_DIR)
/MultiGridPreconWrapper.cc
\
$(SOURCE_DIR)
/LagrangeInterpolRestrict.h
\
$(SOURCE_DIR)/LagrangeInterpolRestrict.cc \
$(SOURCE_DIR)
/BiCGStab.h
$(SOURCE_DIR)
/BiCGStab.hh
\
$(SOURCE_DIR)
/BiCGStab2.h
$(SOURCE_DIR)
/BiCGStab2.hh
\
$(SOURCE_DIR)
/InterpolRestrictMatrix.h
\
...
...
@@ -113,8 +112,8 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ConditionalEstimator.h \
$(SOURCE_DIR)
/ElementPartition_ED.h
\
$(SOURCE_DIR)
/SurfacePartition_ED.h
\
$(SOURCE_DIR)
/ElementData.h
$(SOURCE_DIR)
/ElementData.cc
\
$(SOURCE_DIR)/CreatorMap.h $(SOURCE_DIR)/CreatorMap.
cc
\
$(SOURCE_DIR)/CreatorInterface.h \
$(SOURCE_DIR)
/CreatorMap.h
$(SOURCE_DIR)
/CreatorMap.
hh
\
$(SOURCE_DIR)
/CreatorMap.cc
$(SOURCE_DIR)
/CreatorInterface.h
\
$(SOURCE_DIR)
/ElementFunction.h
\
$(SOURCE_DIR)
/ProblemInterpolScal.h
\
$(SOURCE_DIR)
/ProblemInterpolScal.cc
\
...
...
@@ -260,7 +259,6 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ConditionalEstimator.h \
@USE_PARALLEL_AMDIS_TRUE@ libamdis_la-ParMetisPartitioner.lo
am_libamdis_la_OBJECTS
=
$(am__objects_1)
\
libamdis_la-MultiGridPreconWrapper.lo
\
libamdis_la-LagrangeInterpolRestrict.lo \
libamdis_la-InterpolRestrictMatrix.lo
\
libamdis_la-DOFIndexed.lo libamdis_la-GNUPlotWriter.lo
\
libamdis_la-StlVector.lo libamdis_la-V3Vector.lo
\
...
...
@@ -501,7 +499,7 @@ INCLUDES = $(AMDIS_INCLUDES) $(PARALLEL_INCLUDES)
libamdis_la_SOURCES
=
\
$(PARALLEL_AMDIS_SOURCES)
\
$(SOURCE_DIR)
/MultiGridPreconWrapper.h
$(SOURCE_DIR)
/MultiGridPreconWrapper.cc
\
$(SOURCE_DIR)/LagrangeInterpolRestrict.h
$(SOURCE_DIR)/LagrangeInterpolRestrict.cc
\
$(SOURCE_DIR)
/LagrangeInterpolRestrict.h
\
$(SOURCE_DIR)
/BiCGStab.h
$(SOURCE_DIR)
/BiCGStab.hh
\
$(SOURCE_DIR)
/BiCGStab2.h
$(SOURCE_DIR)
/BiCGStab2.hh
\
$(SOURCE_DIR)
/InterpolRestrictMatrix.h
$(SOURCE_DIR)
/InterpolRestrictMatrix.cc
\
...
...
@@ -527,7 +525,8 @@ $(SOURCE_DIR)/ProblemVec.h $(SOURCE_DIR)/ProblemVec.cc \
$(SOURCE_DIR)
/DualTraverse.h
$(SOURCE_DIR)
/DualTraverse.cc
\
$(SOURCE_DIR)
/ElementPartition_ED.h
$(SOURCE_DIR)
/SurfacePartition_ED.h
\
$(SOURCE_DIR)
/ElementData.h
$(SOURCE_DIR)
/ElementData.cc
\
$(SOURCE_DIR)/CreatorMap.h $(SOURCE_DIR)/CreatorMap.cc $(SOURCE_DIR)/CreatorInterface.h \
$(SOURCE_DIR)
/CreatorMap.h
$(SOURCE_DIR)
/CreatorMap.hh
$(SOURCE_DIR)
/CreatorMap.cc
\
$(SOURCE_DIR)
/CreatorInterface.h
\
$(SOURCE_DIR)
/ElementFunction.h
\
$(SOURCE_DIR)
/ProblemInterpolScal.h
$(SOURCE_DIR)
/ProblemInterpolScal.cc
\
$(SOURCE_DIR)
/ProblemInterpolVec.h
$(SOURCE_DIR)
/ProblemInterpolVec.cc
\
...
...
@@ -816,7 +815,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-InterpolRestrictMatrix.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-JacobiSmoother.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-Lagrange.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-LagrangeInterpolRestrict.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-LeafData.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-Line.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/libamdis_la-MacroElement.Plo@am__quote@
...
...
@@ -944,13 +942,6 @@ libamdis_la-MultiGridPreconWrapper.lo: $(SOURCE_DIR)/MultiGridPreconWrapper.cc
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(LIBTOOL)
--tag
=
CXX
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(AM_CPPFLAGS)
$(CPPFLAGS)
$(libamdis_la_CXXFLAGS)
$(CXXFLAGS)
-c
-o
libamdis_la-MultiGridPreconWrapper.lo
`
test
-f
'
$(SOURCE_DIR)
/MultiGridPreconWrapper.cc'
||
echo
'
$(srcdir)
/'
`
$(SOURCE_DIR)
/MultiGridPreconWrapper.cc
libamdis_la-LagrangeInterpolRestrict.lo: $(SOURCE_DIR)/LagrangeInterpolRestrict.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-LagrangeInterpolRestrict.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-LagrangeInterpolRestrict.Tpo" -c -o libamdis_la-LagrangeInterpolRestrict.lo `test -f '$(SOURCE_DIR)/LagrangeInterpolRestrict.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/LagrangeInterpolRestrict.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-LagrangeInterpolRestrict.Tpo" "$(DEPDIR)/libamdis_la-LagrangeInterpolRestrict.Plo"; else rm -f "$(DEPDIR)/libamdis_la-LagrangeInterpolRestrict.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/LagrangeInterpolRestrict.cc' object='libamdis_la-LagrangeInterpolRestrict.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-LagrangeInterpolRestrict.lo `test -f '$(SOURCE_DIR)/LagrangeInterpolRestrict.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/LagrangeInterpolRestrict.cc
libamdis_la-InterpolRestrictMatrix.lo
:
$(SOURCE_DIR)/InterpolRestrictMatrix.cc
@am__fastdepCXX_TRUE@
if
$(LIBTOOL)
--tag
=
CXX
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(AM_CPPFLAGS)
$(CPPFLAGS)
$(libamdis_la_CXXFLAGS)
$(CXXFLAGS)
-MT
libamdis_la-InterpolRestrictMatrix.lo
-MD
-MP
-MF
"
$(DEPDIR)
/libamdis_la-InterpolRestrictMatrix.Tpo"
-c
-o
libamdis_la-InterpolRestrictMatrix.lo
`
test
-f
'
$(SOURCE_DIR)
/InterpolRestrictMatrix.cc'
||
echo
'
$(srcdir)
/'
`
$(SOURCE_DIR)
/InterpolRestrictMatrix.cc
;
\
@am__fastdepCXX_TRUE@
then
mv
-f
"
$(DEPDIR)
/libamdis_la-InterpolRestrictMatrix.Tpo"
"
$(DEPDIR)
/libamdis_la-InterpolRestrictMatrix.Plo"
;
else
rm
-f
"
$(DEPDIR)
/libamdis_la-InterpolRestrictMatrix.Tpo"
;
exit
1
;
fi
...
...
AMDiS/src/AMDiS.h
View file @
ceecc7c5
...
...
@@ -85,7 +85,9 @@
#include "RefinementManager2d.h"
#include "RefinementManager3d.h"
#include "RobinBC.h"
#include "SmootherBase.h"
#include "SolutionDataStorage.h"
#include "SparseVector.h"
#include "SurfaceOperator.h"
#include "SurfaceQuadrature.h"
#include "SystemVector.h"
...
...
AMDiS/src/CoarseningManager2d.cc
View file @
ceecc7c5
...
...
@@ -19,41 +19,38 @@ namespace AMDiS {
void
CoarseningManager2d
::
coarsenTriangle
(
Triangle
*
el
)
{
FUNCNAME
(
"CoarseningManager2d::coarseTriangle"
);
Triangle
*
child
[
2
];
FUNCNAME
(
"CoarseningManager2d::coarseTriangle()"
);
child
[
0
]
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
el
->
getChild
(
0
)));
child
[
1
]
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
el
->
getChild
(
1
)));
Triangle
*
child
[
2
];
child
[
0
]
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
el
->
getChild
(
0
)));
child
[
1
]
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
el
->
getChild
(
1
)));
TEST_EXIT_DBG
(
child
[
0
]
->
getMark
()
<
0
&&
child
[
1
]
->
getMark
()
<
0
)
(
"element %d with children[%d,%d] must not be coarsend!
\n
"
,
el
->
getIndex
(),
child
[
0
]
->
getIndex
(),
child
[
1
]
->
getIndex
());
if
(
mesh
->
getNumberOfDOFs
(
EDGE
))
{
/****************************************************************************/
/* remove dof from common edge of child[0] and child[1] */
/****************************************************************************/
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
0
]
->
getDOF
(
4
)),
EDGE
);
}
if
(
mesh
->
getNumberOfDOFs
(
CENTER
))
{
/****************************************************************************/
/* remove dof from the barycenters of child[0] and child[1] */
/****************************************************************************/
int
node
=
mesh
->
getNode
(
CENTER
);
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
0
]
->
getDOF
(
node
)),
CENTER
);
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
1
]
->
getDOF
(
node
)),
CENTER
);
}
if
(
mesh
->
getNumberOfDOFs
(
EDGE
))
{
/****************************************************************************/
/* remove dof from common edge of child[0] and child[1] */
/****************************************************************************/
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
0
]
->
getDOF
(
4
)),
EDGE
);
}
if
(
mesh
->
getNumberOfDOFs
(
CENTER
))
{
/****************************************************************************/
/* remove dof from the barycenters of child[0] and child[1] */
/****************************************************************************/
int
node
=
mesh
->
getNode
(
CENTER
);
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
0
]
->
getDOF
(
node
)),
CENTER
);
mesh
->
freeDOF
(
const_cast
<
int
*>
(
child
[
1
]
->
getDOF
(
node
)),
CENTER
);
}
el
->
coarsenElementData
(
child
[
0
],
child
[
1
]);
el
->
setFirstChild
(
NULL
);
el
->
setSecondChild
(
NULL
);
mesh
->
freeElement
(
child
[
0
]);
mesh
->
freeElement
(
child
[
1
]);
...
...
@@ -72,8 +69,8 @@ namespace AMDiS {
/****************************************************************************/
void
CoarseningManager2d
::
coarsenPatch
(
RCNeighbourList
*
coarsenList
,
int
n_neigh
,
int
bound
)
int
n_neigh
,
int
bound
)
{
Triangle
*
el
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
coarsenList
->
getElement
(
0
)));
Triangle
*
neigh
=
dynamic_cast
<
Triangle
*>
(
const_cast
<
Element
*>
(
coarsenList
->
getElement
(
1
)));
...
...
@@ -195,9 +192,7 @@ namespace AMDiS {
if
(
coarse_list
.
doCoarsePatch
(
n_neigh
))
{
int
n_neigh_periodic
;
DegreeOfFreedom
*
next_edge
[
2
];
RCNeighbourList
*
periodicList
;
while
(
edge
[
0
]
!=
NULL
)
{
...
...
AMDiS/src/CreatorInterface.h
View file @
ceecc7c5
...
...
@@ -40,7 +40,7 @@ namespace AMDiS {
class
CreatorInterface
{
public:
virtual
~
CreatorInterface
()
{}
;
virtual
~
CreatorInterface
()
{}
/** \brief
* Must be implemented by sub classes of CreatorInterface.
...
...
@@ -51,14 +51,14 @@ namespace AMDiS {
/** \brief
* Can be implemented by sub classes.
*/
virtual
void
free
(
BaseClass
*
)
{}
;
virtual
void
free
(
BaseClass
*
)
{}
/** \brief
*
*/
virtual
bool
isNullCreator
()
{
return
false
;
}
;
}
};
/** \brief
...
...
@@ -73,14 +73,14 @@ namespace AMDiS {
*/
BaseClass
*
create
()
{
return
NULL
;
}
;
}
/** \brief
*
*/
virtual
bool
isNullCreator
()
{
return
true
;
}
;
}
};
}
...
...
AMDiS/src/CreatorMap.cc
View file @
ceecc7c5
...
...
@@ -261,5 +261,4 @@ namespace AMDiS {
creator
=
NEW
ElementRegion_ED
::
Creator
;
addCreator
(
"ElementRegion_ED"
,
creator
);
}
}
AMDiS/src/CreatorMap.h
View file @
ceecc7c5
...
...
@@ -39,63 +39,66 @@ namespace AMDiS {
* to the map.
*/
template
<
typename
BaseClass
>
class
CreatorMap
class
CreatorMap
{
public:
/** \brief
* Adds a new creator together with the given key to the map.
*/
static
void
addCreator
(
std
::
string
key
,
CreatorInterface
<
BaseClass
>*
creator
)
{
public:
/** \brief
* Adds a new creator together with the given key to the map.
*/
static
void
addCreator
(
std
::
string
key
,
CreatorInterface
<
BaseClass
>*
creator
)
{
FUNCNAME
(
"CreatorMap::addCreator()"
);
init
();
TEST_EXIT
(
creatorMap
[
key
]
==
NULL
)
(
"there is already a creator for key %s
\n
"
,
key
.
c_str
());
creatorMap
[
key
]
=
creator
;
};
/** \brief
* Creates a object of the type corresponding to key.
*/
static
CreatorInterface
<
BaseClass
>*
getCreator
(
std
::
string
key
)
{
FUNCNAME
(
"CreatorMap::getCreator()"
);
init
();
CreatorInterface
<
BaseClass
>
*
creator
=
creatorMap
[
key
];
TEST_EXIT
(
creator
)(
"no creator for key %s
\n
"
,
key
.
c_str
());
return
creator
;
};
static
void
addDefaultCreators
();
protected:
/** \brief
* Constructor is protected because derived maps should be singleton.
*/
static
void
init
()
{
if
(
!
initialized
)
{
initialized
=
true
;
NullCreator
<
BaseClass
>
*
nullCreator
=
new
NullCreator
<
BaseClass
>
;
addCreator
(
"no"
,
nullCreator
);
addCreator
(
"0"
,
nullCreator
);
addDefaultCreators
();
}
};
protected:
/** \brief
* STL map containing the pairs of keys and creators.
*/
static
std
::
map
<
std
::
string
,
CreatorInterface
<
BaseClass
>*
>
creatorMap
;
static
bool
initialized
;
};
FUNCNAME
(
"CreatorMap::addCreator()"
);
init
();
TEST_EXIT
(
creatorMap
[
key
]
==
NULL
)
(
"there is already a creator for key %s
\n
"
,
key
.
c_str
());
creatorMap
[
key
]
=
creator
;
}
/** \brief
* Creates a object of the type corresponding to key.
*/
static
CreatorInterface
<
BaseClass
>*
getCreator
(
std
::
string
key
)
{
FUNCNAME
(
"CreatorMap::getCreator()"
);
init
();
CreatorInterface
<
BaseClass
>
*
creator
=
creatorMap
[
key
];
TEST_EXIT
(
creator
)(
"no creator for key %s
\n
"
,
key
.
c_str
());
return
creator
;
}
static
void
clear
();
static
void
addDefaultCreators
();
protected:
/** \brief
* Constructor is protected because derived maps should be singleton.
*/
static
void
init
()
{
if
(
!
initialized
)
{
initialized
=
true
;
NullCreator
<
BaseClass
>
*
nullCreator
=
new
NullCreator
<
BaseClass
>
;
addCreator
(
"no"
,
nullCreator
);
addDefaultCreators
();
}
}
protected:
/** \brief
* STL map containing the pairs of keys and creators.
*/
static
std
::
map
<
std
::
string
,
CreatorInterface
<
BaseClass
>*
>
creatorMap
;
static
bool
initialized
;
};
template
<
typename
BaseClass
>
std
::
map
<
std
::
string
,
CreatorInterface
<
BaseClass
>*
>
CreatorMap
<
BaseClass
>::
creatorMap
;
std
::
map
<
std
::
string
,
CreatorInterface
<
BaseClass
>*
>
CreatorMap
<
BaseClass
>::
creatorMap
;
template
<
typename
BaseClass
>
bool
CreatorMap
<
BaseClass
>::
initialized
=
false
;
bool
CreatorMap
<
BaseClass
>::
initialized
=
false
;
}
#include "CreatorMap.hh"
#endif
AMDiS/src/CreatorMap.hh
0 → 100644
View file @
ceecc7c5
#include "MemoryManager.h"
#include <map>
namespace
AMDiS
{
template
<
typename
BaseClass
>
void
CreatorMap
<
BaseClass
>::
clear
()
{
typename
std
::
map
<
std
::
string
,
CreatorInterface
<
BaseClass
>*
>::
iterator
it
;
for
(
it
=
creatorMap
.
begin
();
it
!=
creatorMap
.
end
();
++
it
)
{
DELETE
it
->
second
;
}
}
}
AMDiS/src/DOFMatrix.cc
View file @
ceecc7c5
...
...
@@ -61,10 +61,15 @@ namespace AMDiS {
{
FUNCNAME
(
"DOFMatrix::~DOFMatrix()"
);
matrix
.
clear
();
if
(
rowFESpace
&&
rowFESpace
->
getAdmin
())
{
(
const_cast
<
DOFAdmin
*>
(
rowFESpace
->
getAdmin
()))
->
removeDOFIndexed
(
this
);
}
if
(
boundaryManager
)
DELETE
boundaryManager
;
if
(
elementMatrix
)
DELETE
elementMatrix
;
}
...
...
AMDiS/src/Element.cc
View file @
ceecc7c5
...
...
@@ -7,18 +7,18 @@
namespace
AMDiS
{
std
::
map
<
DegreeOfFreedom
*
,
bool
>
Element
::
deletedDOFs
;
int
Element
::
getRegion
()
const
{
ElementRegion_ED
*
red_
;
if
(
!
elementData
)
return
-
1
;
red
_
=
dynamic_cast
<
ElementRegion_ED
*>
(
elementData
->
getElementData
(
ELEMENT_REGION
));
ElementRegion_ED
*
red
=
dynamic_cast
<
ElementRegion_ED
*>
(
elementData
->
getElementData
(
ELEMENT_REGION
));
if
(
red_
)
return
red_
->
getRegion
();
if
(
red
)
{
return
red
->
getRegion
();
}
return
-
1
;
}
...
...
@@ -35,12 +35,9 @@ namespace AMDiS {
Element
::
Element
(
Mesh
*
aMesh
)
{
mesh
=
aMesh
;
index
=
mesh
?
mesh
->
getNextElementIndex
()
:
-
1
;
child
[
0
]
=
NULL
;
child
[
1
]
=
NULL
;
newCoord
=
NULL
;
elementData
=
NULL
;
...
...
@@ -53,7 +50,7 @@ namespace AMDiS {
// call destructor through Mesh::freeElement !!!
Element
::~
Element
()
{
{
if
(
child
[
0
])
{
DELETE
child
[
0
];
}
...
...
@@ -64,6 +61,29 @@ namespace AMDiS {
if
(
newCoord
)
{
DELETE
newCoord
;
}
if
(
elementData
)
{
elementData
->
deleteDecorated
();
DELETE
elementData
;
}
}
bool
Element
::
deleteElementData
(
int
typeID
)
{
FUNCNAME
(
"Element::deleteElementData()"
);
if
(
elementData
)
{
if
(
elementData
->
isOfType
(
typeID
))
{
ElementData
*
tmp
=
elementData
;
elementData
=
elementData
->
getDecorated
();
DELETE
tmp
;
tmp
=
NULL
;
return
true
;
}
else
{
return
elementData
->
deleteDecorated
(
typeID
);
}
}
return
false
;
}
void
Element
::
deleteElementDOFs
()
...
...
@@ -81,22 +101,19 @@ namespace AMDiS {
if
(
ndof
>
0
)
{
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
position
);
i
++
)
{
if
(
dof
[
j
]
!=
NULL
)
{
if
(
Mesh
::
serializ
edDOFs
.
count
(
dof
[
j
]
[
0
]
)
==
0
)
{
// std::cout << "FREE INNER: " << ndof << std::endl
;
if
(
dof
[
j
])
{
if
(
delet
edDOFs
.
count
(
dof
[
j
])
==
0
)
{
deletedDOFs
[
dof
[
j
]]
=
true
;
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
();
}
...
...
@@ -108,14 +125,16 @@ namespace AMDiS {
Element
*
Element
::
cloneWithDOFs
()
{
Element
*
el
;
if
(
isLine
())
{
el
=
NEW
Line
(
mesh
);
el
=
NEW
Line
(
NULL
);
}
else
if
(
isTriangle
())
{
el
=
NEW
Triangle
(
mesh
);
el
=
NEW
Triangle
(
NULL
);
}
else
{
el
=
NEW
Tetrahedron
(
mesh
);
el
=
NEW
Tetrahedron
(
NULL
);
}
el
->
mesh
=
mesh
;
el
->
index
=
index
;
el
->
mark
=
mark
;
if
(
newCoord
)
{
...
...
@@ -123,9 +142,9 @@ namespace AMDiS {
*
nc
=
*
newCoord
;
el
->
newCoord
=
nc
;
}
/* =========== And here we clone the DOFs =========== */
el
->
dof
=
GET_MEMORY
(
DegreeOfFreedom
*
,
mesh
->
getNumberOfNodes
());
int
dim
=
mesh
->
getDim
();
...
...
@@ -158,7 +177,7 @@ namespace AMDiS {
}
}
}
/* =========== And clone the children ============= */
if
(
child
[
0
])
{
...
...
AMDiS/src/Element.h
View file @
ceecc7c5
...
...
@@ -464,7 +464,7 @@ namespace AMDiS {
/** \brief
* Coarsens Element's leaf data
*/
inline
void
coarsenElementData
(
Element
*
child1
,
Element
*
child2
,
int
elType
=
0
)
{
inline
void
coarsenElementData
(
Element
*
child1
,
Element
*
child2
,
int
elType
=
0
)
{
ElementData
*
childData
;
childData
=
child1
->
getElementData
();
if
(
childData
)
{
...
...
@@ -498,22 +498,9 @@ namespace AMDiS {
}
/** \brief
*
kills
\ref elementData
*
Deletes the
\ref elementData
with a specific typeID.
*/
bool
deleteElementData
(
int
typeID
)
{
FUNCNAME
(
"Element::deleteElementData()"
);
if
(
elementData
)
{
if
(
elementData
->
isOfType
(
typeID
))
{
ElementData
*
tmp
=
elementData
;
elementData
=
elementData
->
getDecorated
();
DELETE
tmp
;
return
true
;
}
else
{
return
elementData
->
deleteDecorated
(
typeID
);
}
}
return
false
;
}
bool
deleteElementData
(
int
typeID
);
/** \brief
* Returns whether element is refined at side side
...
...
@@ -620,6 +607,12 @@ namespace AMDiS {
ElementData
*
elementData
;
/** \brief
* This map is used for deletion of all DOFs of all elements of a mesh. Once
* a DOF-vector (all DOFS at a node, edge, etc.) is deleted, its address is
* added to this map to note not to delete it a second time.
*/
static
std
::
map
<
DegreeOfFreedom
*
,
bool
>
deletedDOFs
;
friend
class
Mesh
;
};
...
...
AMDiS/src/ElementData.cc
View file @
ceecc7c5
#include "MemoryManager.h"
#include "ElementData.h"
namespace
AMDiS
{
void
ElementData
::
serialize
(
std
::
ostream
&
out
)
{
void
ElementData
::
coarsenElementData
(
Element
*
parent
,
Element
*
thisChild
,
Element
*
otherChild
,
int
elTypeParent
)
{
if
(
decorated_
)
{
decorated_
->
coarsenElementData
(
parent
,
thisChild
,
otherChild
,
elTypeParent
);
delete
decorated_
;
decorated_
=
NULL
;
}
}
bool
ElementData
::
deleteDecorated
(
int
typeID
)
{
if
(
decorated_
)
{
if
(
decorated_
->
isOfType
(
typeID
))
{
ElementData
*
tmp
=
decorated_
;
decorated_
=
decorated_
->
decorated_
;
delete
tmp
;
tmp
=
NULL
;
return
true
;
}
else
{
return
decorated_
->
deleteDecorated
(
typeID
);
}
}
return
false
;
}
void
ElementData
::
deleteDecorated
()
{
if
(
decorated_
)
{
decorated_
->
deleteDecorated
();
DELETE
decorated_
;
}