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
e43e8013
Commit
e43e8013
authored
Jan 10, 2012
by
Thomas Witkowski
Browse files
SimpleResidualEstimator ready and documented.
parent
97be72e8
Changes
25
Hide whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
e43e8013
...
...
@@ -92,7 +92,6 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/Element.cc
${
SOURCE_DIR
}
/ElementData.cc
${
SOURCE_DIR
}
/ElementDofIterator.cc
${
SOURCE_DIR
}
/Estimator.cc
${
SOURCE_DIR
}
/FiniteElemSpace.cc
${
SOURCE_DIR
}
/FirstOrderAssembler.cc
${
SOURCE_DIR
}
/FirstOrderTerm.cc
...
...
@@ -123,12 +122,10 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/Quadrature.cc
${
SOURCE_DIR
}
/RCNeighbourList.cc
${
SOURCE_DIR
}
/Recovery.cc
${
SOURCE_DIR
}
/RecoveryEstimator.cc
${
SOURCE_DIR
}
/RefinementManager.cc
${
SOURCE_DIR
}
/RefinementManager1d.cc
${
SOURCE_DIR
}
/RefinementManager2d.cc
${
SOURCE_DIR
}
/RefinementManager3d.cc
${
SOURCE_DIR
}
/ResidualEstimator.cc
${
SOURCE_DIR
}
/RobinBC.cc
${
SOURCE_DIR
}
/ScalableQuadrature.cc
${
SOURCE_DIR
}
/SecondOrderAssembler.cc
...
...
@@ -147,6 +144,10 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/VertexVector.cc
${
SOURCE_DIR
}
/ZeroOrderAssembler.cc
${
SOURCE_DIR
}
/ZeroOrderTerm.cc
${
SOURCE_DIR
}
/est/Estimator.cc
${
SOURCE_DIR
}
/est/RecoveryEstimator.cc
${
SOURCE_DIR
}
/est/ResidualEstimator.cc
${
SOURCE_DIR
}
/est/SimpleResidualEstimator.cc
${
SOURCE_DIR
}
/io/ArhReader.cc
${
SOURCE_DIR
}
/io/ArhWriter.cc
${
SOURCE_DIR
}
/io/DataCollector.cc
...
...
@@ -345,6 +346,11 @@ INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/nonlin/
)
list
(
APPEND deb_add_dirs
"include/amdis/nonlin"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/est/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/est/
)
list
(
APPEND deb_add_dirs
"include/amdis/est"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/time/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/time/
)
...
...
AMDiS/src/AMDiS.h
View file @
e43e8013
...
...
@@ -59,7 +59,6 @@
#include
"Element.h"
#include
"ElementDofIterator.h"
#include
"Error.h"
#include
"Estimator.h"
#include
"FiniteElemSpace.h"
#include
"FirstOrderTerm.h"
#include
"FixVec.h"
...
...
@@ -112,6 +111,8 @@
#include
"VertexVector.h"
#include
"ZeroOrderTerm.h"
#include
"est/Estimator.h"
#include
"io/ArhReader.h"
#include
"io/ArhWriter.h"
#include
"io/FileWriter.h"
...
...
AMDiS/src/AdaptInstationary.cc
View file @
e43e8013
...
...
@@ -12,7 +12,7 @@
#include
"AdaptInstationary.h"
#include
"Initfile.h"
#include
"Estimator.h"
#include
"
est/
Estimator.h"
#include
"ProblemIterationInterface.h"
#include
"ProblemTimeInterface.h"
#include
"Serializer.h"
...
...
AMDiS/src/AdaptStationary.cc
View file @
e43e8013
...
...
@@ -12,7 +12,7 @@
#include
"AdaptStationary.h"
#include
"Initfile.h"
#include
"Estimator.h"
#include
"
est/
Estimator.h"
#include
"ProblemIterationInterface.h"
#include
<math.h>
...
...
AMDiS/src/Assembler.cc
View file @
e43e8013
...
...
@@ -69,7 +69,7 @@ namespace AMDiS {
return
;
}
}
ElementMatrix
&
mat
=
rememberElMat
?
elementMatrix
:
userMat
;
if
(
secondOrderAssembler
)
...
...
@@ -315,8 +315,8 @@ namespace AMDiS {
FUNCNAME
(
"Assembler::matVecAssemble()"
);
Element
*
el
=
elInfo
->
getElement
();
ElementVector
uhOldLoc
(
operat
->
uhOld
->
getFeSpace
()
==
rowFeSpace
?
nRow
:
nCol
);
ElementVector
uhOldLoc
(
operat
->
uhOld
->
getFeSpace
()
==
rowFeSpace
?
nRow
:
nCol
);
operat
->
uhOld
->
getLocalVector
(
el
,
uhOldLoc
);
if
(
el
!=
lastMatEl
)
{
...
...
AMDiS/src/CreatorMap.cc
View file @
e43e8013
...
...
@@ -17,14 +17,15 @@
#include
"ITL_Preconditioner.h"
#include
"MatrixVector.h"
#include
"SystemVector.h"
#include
"Estimator.h"
#include
"RecoveryEstimator.h"
#include
"ResidualEstimator.h"
#include
"est/Estimator.h"
#include
"LeafData.h"
#include
"SurfaceRegion_ED.h"
#include
"ElementRegion_ED.h"
#include
"DOFMatrix.h"
#include
"UmfPackSolver.h"
#include
"est/RecoveryEstimator.h"
#include
"est/ResidualEstimator.h"
#include
"est/SimpleResidualEstimator.h"
#include
"time/RosenbrockMethod.h"
#include
"nonlin/NonLinSolver.h"
...
...
@@ -102,6 +103,9 @@ namespace AMDiS {
creator
=
new
ResidualEstimator
::
Creator
;
addCreator
(
"residual"
,
creator
);
creator
=
new
SimpleResidualEstimator
::
Creator
;
addCreator
(
"simple-residual"
,
creator
);
creator
=
new
RecoveryEstimator
::
Creator
;
addCreator
(
"recovery"
,
creator
);
}
...
...
AMDiS/src/ElInfo.cc
View file @
e43e8013
...
...
@@ -56,10 +56,12 @@ namespace AMDiS {
dimOfWorld
=
Global
::
getGeo
(
WORLD
);
}
ElInfo
::~
ElInfo
()
{}
void
ElInfo
::
coordToWorld
(
const
DimVec
<
double
>&
l
,
WorldVector
<
double
>&
w
)
const
...
...
@@ -80,12 +82,14 @@ namespace AMDiS {
}
}
double
ElInfo
::
calcDet
()
const
{
testFlag
(
Mesh
::
FILL_COORDS
);
return
calcDet
(
coord
);
}
double
ElInfo
::
calcDet
(
const
FixVec
<
WorldVector
<
double
>
,
VERTEX
>
&
coords
)
const
{
FUNCNAME
(
"ElInfo::calcDet()"
);
...
...
@@ -114,10 +118,8 @@ namespace AMDiS {
det
=
norm
(
&
e1
);
}
else
{
det
=
(
coords
[
1
][
0
]
-
coords
[
0
][
0
])
*
(
coords
[
2
][
1
]
-
coords
[
0
][
1
])
-
(
coords
[
1
][
1
]
-
coords
[
0
][
1
])
*
(
coords
[
2
][
0
]
-
coords
[
0
][
0
]);
}
break
;
case
3
:
...
...
AMDiS/src/ElInfo2d.cc
View file @
e43e8013
...
...
@@ -735,13 +735,13 @@ namespace AMDiS {
vectorProduct
(
elementNormal
,
e0
,
normal
);
}
double
det
=
norm
(
&
normal
);
double
det
n
=
norm
(
&
normal
);
TEST_EXIT_DBG
(
det
>
1.e-30
)(
"det = 0 on face %d
\n
"
,
side
);
TEST_EXIT_DBG
(
det
n
>
1.e-30
)(
"det = 0 on face %d
\n
"
,
side
);
normal
*=
1.0
/
det
;
normal
*=
1.0
/
det
n
;
return
det
;
return
det
n
;
}
...
...
@@ -762,13 +762,13 @@ namespace AMDiS {
vectorProduct
(
e0
,
e1
,
elementNormal
);
double
det
=
norm
(
&
elementNormal
);
double
det
n
=
norm
(
&
elementNormal
);
TEST_EXIT_DBG
(
det
>
1.e-30
)(
"det = 0"
);
TEST_EXIT_DBG
(
det
n
>
1.e-30
)(
"det = 0"
);
elementNormal
*=
1.0
/
det
;
elementNormal
*=
1.0
/
det
n
;
return
det
;
return
det
n
;
}
...
...
AMDiS/src/ProblemInstat.cc
View file @
e43e8013
...
...
@@ -16,8 +16,8 @@
#include
"ProblemInstat.h"
#include
"AdaptStationary.h"
#include
"AdaptInstationary.h"
#include
"Estimator.h"
#include
"StandardProblemIteration.h"
#include
"est/Estimator.h"
#include
"io/FileWriter.h"
namespace
AMDiS
{
...
...
AMDiS/src/ProblemStat.cc
View file @
e43e8013
...
...
@@ -14,14 +14,12 @@
#include
<boost/lexical_cast.hpp>
#include
"ProblemStat.h"
#include
"RecoveryEstimator.h"
#include
"Serializer.h"
#include
"AbstractFunction.h"
#include
"Operator.h"
#include
"SystemVector.h"
#include
"DOFMatrix.h"
#include
"FiniteElemSpace.h"
#include
"Estimator.h"
#include
"Marker.h"
#include
"AdaptInfo.h"
#include
"io/FileWriter.h"
...
...
@@ -35,6 +33,7 @@
#include
"PeriodicBC.h"
#include
"Lagrange.h"
#include
"Flag.h"
#include
"est/Estimator.h"
#include
"io/VtkWriter.h"
#include
"io/ValueReader.h"
#include
"ProblemStatDbg.h"
...
...
@@ -790,6 +789,8 @@ namespace AMDiS {
if
(
matrix
)
nnz
+=
matrix
->
getBaseMatrix
().
nnz
();
}
// And now assemble boundary conditions on the vectors
assembleBoundaryConditions
(
rhs
->
getDOFVector
(
i
),
...
...
AMDiS/src/RobinBC.cc
View file @
e43e8013
...
...
@@ -11,11 +11,12 @@
#include
"RobinBC.h"
#include
"Estimator.h"
#include
"Assembler.h"
#include
"DOFVector.h"
#include
"DOFMatrix.h"
#include
"SurfaceOperator.h"
#include
"est/Estimator.h"
#include
<math.h>
namespace
AMDiS
{
...
...
AMDiS/src/RobinBC.hh
View file @
e43e8013
...
...
@@ -10,8 +10,8 @@
// See also license.opensource.txt in the distribution.
#include
"Estimator.h"
#include
"Assembler.h"
#include
"est/Estimator.h"
template
<
typename
T
>
void
RobinBC
<
T
>::
fillLocalBC
(
DOFVector
<
T
>*
vector
,
...
...
AMDiS/src/SecondOrderAssembler.cc
View file @
e43e8013
...
...
@@ -77,9 +77,9 @@ namespace AMDiS {
newAssembler
=
new
Stand2
(
op
,
assembler
,
quad
);
}
else
{
if
(
pwConst
)
{
newAssembler
=
new
Pre2
(
op
,
assembler
,
quad
);
newAssembler
=
new
Pre2
(
op
,
assembler
,
quad
);
}
else
{
newAssembler
=
new
Quad2
(
op
,
assembler
,
quad
);
newAssembler
=
new
Quad2
(
op
,
assembler
,
quad
);
}
}
...
...
@@ -330,7 +330,7 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
nRow
;
i
++
)
{
(
*
(
psi
->
getGrdPhi
(
i
)))(
quadrature
->
getLambda
(
iq
),
grdPsi
);
for
(
int
j
=
0
;
j
<
nCol
;
j
++
)
{
tmpVec
=
(
LALt
[
iq
]
*
grdPhi
[
j
]);
tmpVec
=
(
LALt
[
iq
]
*
grdPhi
[
j
]);
mat
[
i
][
j
]
+=
quadrature
->
getWeight
(
iq
)
*
dot
(
grdPsi
,
tmpVec
);
}
}
...
...
AMDiS/src/SecondOrderTerm.h
View file @
e43e8013
...
...
@@ -132,7 +132,8 @@ namespace AMDiS {
}
/// Implements SecondOrderTerm::getLALt().
inline
void
getLALt
(
const
ElInfo
*
elInfo
,
vector
<
mtl
::
dense2D
<
double
>
>
&
LALt
)
const
inline
void
getLALt
(
const
ElInfo
*
elInfo
,
vector
<
mtl
::
dense2D
<
double
>
>
&
LALt
)
const
{
const
DimVec
<
WorldVector
<
double
>
>
&
grdLambda
=
elInfo
->
getGrdLambda
();
const
int
nPoints
=
static_cast
<
int
>
(
LALt
.
size
());
...
...
AMDiS/src/Triangle.cc
View file @
e43e8013
...
...
@@ -52,16 +52,16 @@ namespace AMDiS {
}
const
FixVec
<
int
,
WORLD
>&
Triangle
::
sortFaceIndices
(
int
face
,
FixVec
<
int
,
WORLD
>
*
vec
)
const
FixVec
<
int
,
WORLD
>
*
vec
)
const
{
static
MatrixOfFixVecs
<
FixVec
<
int
,
WORLD
>
>
*
sorted_2d
=
NULL
;
static
MatrixOfFixVecs
<
FixVec
<
int
,
WORLD
>
>
*
sorted_2d
=
NULL
;
int
no
=
0
;
FixVec
<
int
,
WORLD
>
*
val
=
NULL
;
FixVec
<
int
,
WORLD
>
*
val
=
NULL
;
const
int
*
vof
=
vertexOfEdge
[
face
];
if
(
NULL
==
sorted_2d
)
{
sorted_2d
=
new
MatrixOfFixVecs
<
FixVec
<
int
,
WORLD
>
>
(
2
,
3
,
2
,
NO_INIT
);
sorted_2d
=
new
MatrixOfFixVecs
<
FixVec
<
int
,
WORLD
>
>
(
2
,
3
,
2
,
NO_INIT
);
(
*
sorted_2d
)[
1
][
0
][
1
]
=
(
*
sorted_2d
)[
1
][
1
][
0
]
=
(
*
sorted_2d
)[
2
][
0
][
0
]
=
(
*
sorted_2d
)[
2
][
1
][
1
]
=
0
;
...
...
@@ -83,7 +83,7 @@ namespace AMDiS {
val
=
&
((
*
sorted_2d
)[
face
][
no
]);
}
return
*
(
const_cast
<
const
FixVec
<
int
,
WORLD
>*
>
(
val
));
return
*
(
const_cast
<
const
FixVec
<
int
,
WORLD
>*
>
(
val
));
}
...
...
AMDiS/src/Triangle.h
View file @
e43e8013
...
...
@@ -95,7 +95,7 @@ namespace AMDiS {
bool
hasSide
(
Element
*
sideElem
)
const
;
/// implements Element::sortFaceIndices
const
FixVec
<
int
,
WORLD
>&
sortFaceIndices
(
int
face
,
FixVec
<
int
,
WORLD
>
*
vec
)
const
;
const
FixVec
<
int
,
WORLD
>&
sortFaceIndices
(
int
face
,
FixVec
<
int
,
WORLD
>
*
vec
)
const
;
/// implements Element::isLine. Returns false because this element is a Triangle
inline
bool
isLine
()
const
...
...
AMDiS/src/Estimator.cc
→
AMDiS/src/
est/
Estimator.cc
View file @
e43e8013
File moved
AMDiS/src/Estimator.h
→
AMDiS/src/
est/
Estimator.h
View file @
e43e8013
File moved
AMDiS/src/RecoveryEstimator.cc
→
AMDiS/src/
est/
RecoveryEstimator.cc
View file @
e43e8013
File moved
AMDiS/src/RecoveryEstimator.h
→
AMDiS/src/
est/
RecoveryEstimator.h
View file @
e43e8013
File moved
Prev
1
2
Next
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