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
8f323098
Commit
8f323098
authored
Apr 14, 2008
by
Thomas Witkowski
Browse files
* Solved bug which causes infinte refinements at boundaries with periodic boundary conditions
parent
299ccf0d
Changes
38
Expand all
Hide whitespace changes
Inline
Side-by-side
AMDiS/bin/Makefile.am
View file @
8f323098
...
...
@@ -134,8 +134,16 @@ $(SOURCE_DIR)/TFQMR.h \ $(SOURCE_DIR)/TFQMR.hh \
$(SOURCE_DIR)
/VecSymSolver.h
\
$(SOURCE_DIR)
/VecSymSolver.hh
\
$(SOURCE_DIR)
/UmfPackSolver.h
\
$(SOURCE_DIR)
/UmfPackSolver.hh
\
$(SOURCE_DIR)
/Lagrange.h
$(SOURCE_DIR)
/Line.h
\
$(SOURCE_DIR)
/MacroElement.h
$(SOURCE_DIR)
/MacroWriter.h
$(SOURCE_DIR)
/Markings.h
$(SOURCE_DIR)
/Markings.hh
$(SOURCE_DIR)
/MemoryManager.h
$(SOURCE_DIR)
/Mesh.h
$(SOURCE_DIR)
/ODirSolver.h
$(SOURCE_DIR)
/ODirSolver.hh
$(SOURCE_DIR)
/OEMSolver.h
\
$(SOURCE_DIR)
/OEMSolver.hh
$(SOURCE_DIR)
/OResSolver.h
$(SOURCE_DIR)
/OResSolver.hh
$(SOURCE_DIR)
/Parameters.h
$(SOURCE_DIR)
/Parametric.h
$(SOURCE_DIR)
/Preconditioner.h
\
$(SOURCE_DIR)
/MacroElement.h
$(SOURCE_DIR)
/MacroWriter.h
\
$(SOURCE_DIR)
/Markings.h
$(SOURCE_DIR)
/Markings.hh
\
$(SOURCE_DIR)
/MemoryManager.h
\
$(SOURCE_DIR)
/Mesh.h
\
$(SOURCE_DIR)
/ODirSolver.h
$(SOURCE_DIR)
/ODirSolver.hh
\
$(SOURCE_DIR)
/OEMSolver.h
$(SOURCE_DIR)
/OEMSolver.hh
\
$(SOURCE_DIR)
/OResSolver.h
$(SOURCE_DIR)
/OResSolver.hh
\
$(SOURCE_DIR)
/Parameters.h
\
$(SOURCE_DIR)
/Parametric.h
\
$(SOURCE_DIR)
/Preconditioner.h
\
$(SOURCE_DIR)
/Quadrature.h
\
$(SOURCE_DIR)
/RCNeighbourList.h
$(SOURCE_DIRe)
/RefinementManager.h
$(SOURCE_DIR)
/RefinementManager1d.h
$(SOURCE_DIR)
/RefinementManager2d.h
$(SOURCE_DIR)
/RefinementManager3d.h
$(SOURCE_DIR)
/TecPlotWriter.h
$(SOURCE_DIR)
/TecPlotWriter.hh
$(SOURCE_DIR)
/Tetrahedron.h
\
$(SOURCE_DIR)
/Traverse.h
$(SOURCE_DIR)
/Triangle.h
$(SOURCE_DIR)
/NonLinSolver.h
$(SOURCE_DIR)
/NonLinSolver.hh
$(SOURCE_DIR)
/ProblemInstat.h
$(SOURCE_DIR)
/ProblemInstat.cc
$(SOURCE_DIR)
/ProblemTimeInterface.h
$(SOURCE_DIR)
/ProblemNonLin.h
$(SOURCE_DIR)
/ProblemNonLin.cc
\
...
...
AMDiS/bin/Makefile.in
View file @
8f323098
...
...
@@ -548,8 +548,16 @@ $(SOURCE_DIR)/TFQMR.h \ $(SOURCE_DIR)/TFQMR.hh \
$(SOURCE_DIR)
/VecSymSolver.h
\
$(SOURCE_DIR)
/VecSymSolver.hh
\
$(SOURCE_DIR)
/UmfPackSolver.h
\
$(SOURCE_DIR)
/UmfPackSolver.hh
\
$(SOURCE_DIR)
/Lagrange.h
$(SOURCE_DIR)
/Line.h
\
$(SOURCE_DIR)
/MacroElement.h
$(SOURCE_DIR)
/MacroWriter.h
$(SOURCE_DIR)
/Markings.h
$(SOURCE_DIR)
/Markings.hh
$(SOURCE_DIR)
/MemoryManager.h
$(SOURCE_DIR)
/Mesh.h
$(SOURCE_DIR)
/ODirSolver.h
$(SOURCE_DIR)
/ODirSolver.hh
$(SOURCE_DIR)
/OEMSolver.h
\
$(SOURCE_DIR)
/OEMSolver.hh
$(SOURCE_DIR)
/OResSolver.h
$(SOURCE_DIR)
/OResSolver.hh
$(SOURCE_DIR)
/Parameters.h
$(SOURCE_DIR)
/Parametric.h
$(SOURCE_DIR)
/Preconditioner.h
\
$(SOURCE_DIR)
/MacroElement.h
$(SOURCE_DIR)
/MacroWriter.h
\
$(SOURCE_DIR)
/Markings.h
$(SOURCE_DIR)
/Markings.hh
\
$(SOURCE_DIR)
/MemoryManager.h
\
$(SOURCE_DIR)
/Mesh.h
\
$(SOURCE_DIR)
/ODirSolver.h
$(SOURCE_DIR)
/ODirSolver.hh
\
$(SOURCE_DIR)
/OEMSolver.h
$(SOURCE_DIR)
/OEMSolver.hh
\
$(SOURCE_DIR)
/OResSolver.h
$(SOURCE_DIR)
/OResSolver.hh
\
$(SOURCE_DIR)
/Parameters.h
\
$(SOURCE_DIR)
/Parametric.h
\
$(SOURCE_DIR)
/Preconditioner.h
\
$(SOURCE_DIR)
/Quadrature.h
\
$(SOURCE_DIR)
/RCNeighbourList.h
$(SOURCE_DIRe)
/RefinementManager.h
$(SOURCE_DIR)
/RefinementManager1d.h
$(SOURCE_DIR)
/RefinementManager2d.h
$(SOURCE_DIR)
/RefinementManager3d.h
$(SOURCE_DIR)
/TecPlotWriter.h
$(SOURCE_DIR)
/TecPlotWriter.hh
$(SOURCE_DIR)
/Tetrahedron.h
\
$(SOURCE_DIR)
/Traverse.h
$(SOURCE_DIR)
/Triangle.h
$(SOURCE_DIR)
/NonLinSolver.h
$(SOURCE_DIR)
/NonLinSolver.hh
$(SOURCE_DIR)
/ProblemInstat.h
$(SOURCE_DIR)
/ProblemInstat.cc
$(SOURCE_DIR)
/ProblemTimeInterface.h
$(SOURCE_DIR)
/ProblemNonLin.h
$(SOURCE_DIR)
/ProblemNonLin.cc
\
...
...
AMDiS/compositeFEM/src/SubPolytope.cc
View file @
8f323098
...
...
@@ -3,8 +3,7 @@
#include
"SubElInfo.h"
#include
"SubPolytope.h"
bool
SubPolytope
::
checkIntPoints
()
bool
SubPolytope
::
checkIntPoints
()
{
////////////////////////////////////////////////////////////////////////////
//
...
...
@@ -15,13 +14,14 @@ SubPolytope::checkIntPoints()
// false - no
////////////////////////////////////////////////////////////////////////////
int
i
,
j
;
int
zeroCounter
;
for
(
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
zeroCounter
=
0
;
for
(
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
<=
1.e-15
)
{
zeroCounter
++
;
}
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
<=
1.e-15
)
{
zeroCounter
++
;
}
}
/**
...
...
@@ -29,21 +29,27 @@ SubPolytope::checkIntPoints()
*
* "Inner" points on edges aren't equal to 0.0 in any component.
*/
if
(
dim
==
1
&&
zeroCounter
!=
0
)
{
return
false
;
}
if
(
dim
==
1
&&
zeroCounter
!=
0
)
{
return
false
;
}
/**
* Dimension 2
*
* "Inner" points on edges are equal to 0.0 in exactly 1 component.
*/
if
(
dim
==
2
&&
zeroCounter
!=
1
)
{
return
false
;
}
if
(
dim
==
2
&&
zeroCounter
!=
1
)
{
return
false
;
}
/**
* Dimension 3
*
* "Inner" points on edges are equal to 0.0 in exactly 2 components.
*/
if
(
dim
==
3
&&
zeroCounter
!=
2
)
{
return
false
;
}
if
(
dim
==
3
&&
zeroCounter
!=
2
)
{
return
false
;
}
}
return
true
;
...
...
@@ -57,7 +63,7 @@ SubPolytope::SubPolytope(const ElInfo *elInfo_,
intPoints
(
intPoints_
),
numIntPoints
(
numIntPoints_
)
{
FUNCNAME
(
"SubPolytope::SubPolytope"
);
FUNCNAME
(
"SubPolytope::SubPolytope
()
"
);
dim
=
(
*
intPoints_
)[
0
].
getSize
()
-
1
;
...
...
@@ -87,8 +93,7 @@ SubPolytope::SubPolytope(const ElInfo *elInfo_,
case
3
:
if
(
numIntPoints
==
3
)
{
createSubElementPolytopeIsSubElement2D3D
();
}
else
{
}
else
{
createSubElementsForPolytope3D
(
indexElVertInPol_
);
}
break
;
...
...
@@ -98,8 +103,8 @@ SubPolytope::SubPolytope(const ElInfo *elInfo_,
}
}
void
SubPolytope
::
createSubElementPolytopeIsSubElement1D
(
int
indexElVertInPol
)
void
SubPolytope
::
createSubElementPolytopeIsSubElement1D
(
int
indexElVertInPol
)
{
//**************************************************************************
// The intersection of the one-dimensional element (interval) divides
...
...
@@ -107,7 +112,7 @@ SubPolytope::createSubElementPolytopeIsSubElement1D(int indexElVertInPol)
// subelement to take.
//**************************************************************************
FUNCNAME
(
"SubPolytope::createSubElementPolytopeIsSubElement1D"
);
FUNCNAME
(
"SubPolytope::createSubElementPolytopeIsSubElement1D
()
"
);
TEST_EXIT
(
dim
==
1
&&
numIntPoints
==
1
)(
"invalid call of this routine
\n
"
);
...
...
@@ -158,8 +163,7 @@ SubPolytope::createSubElementPolytopeIsSubElement1D(int indexElVertInPol)
}
void
SubPolytope
::
createSubElementPolytopeIsSubElement2D3D
()
void
SubPolytope
::
createSubElementPolytopeIsSubElement2D3D
()
{
//**************************************************************************
// The intersection with element produced dim intersection points.
...
...
@@ -176,7 +180,7 @@ SubPolytope::createSubElementPolytopeIsSubElement2D3D()
// components.
//**************************************************************************
FUNCNAME
(
"SubPolytope::createSubElementPolytopeIsSubElement2D3D"
);
FUNCNAME
(
"SubPolytope::createSubElementPolytopeIsSubElement2D3D
()
"
);
TEST_EXIT
((
dim
==
2
&&
numIntPoints
==
2
)
||
(
dim
==
3
&&
numIntPoints
==
3
))
...
...
@@ -190,10 +194,11 @@ SubPolytope::createSubElementPolytopeIsSubElement2D3D()
* Get the vertex which - with the intersection points intPoints - forms
* a subelement of element.
*/
int
i
,
j
;
for
(
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
for
(
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
<=
1.e-15
)
{
vertex
[
j
]
=
0.0
;
};
for
(
int
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
<=
1.e-15
)
{
vertex
[
j
]
=
0.0
;
};
}
}
...
...
@@ -206,7 +211,7 @@ SubPolytope::createSubElementPolytopeIsSubElement2D3D()
* not to be an intersection point.
*/
(
*
subElVertices
)[
0
]
=
vertex
;
for
(
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
(
*
subElVertices
)[
i
+
1
]
=
(
*
intPoints
)[
i
];
}
...
...
@@ -222,22 +227,21 @@ SubPolytope::createSubElementPolytopeIsSubElement2D3D()
DELETE
subElVertices
;
}
int
SubPolytope
::
getIndexSecondFaceIntPoint0
(
int
indexFirstFace
,
int
dim
)
{
int
i
;
for
(
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
int
SubPolytope
::
getIndexSecondFaceIntPoint0
(
int
indexFirstFace
,
int
dim
)
{
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
if
(
fabs
((
*
intPoints
)[
0
][
i
])
<=
1.e-15
&&
i
!=
indexFirstFace
)
{
return
i
;
}
}
ERROR_EXIT
(
"couldn't determine the second face for IntPoint0
\n
"
);
return
-
1
;
}
void
SubPolytope
::
createSubElementsForPolytope3D
(
int
indexElVertInPol1
)
void
SubPolytope
::
createSubElementsForPolytope3D
(
int
indexElVertInPol1
)
{
//**************************************************************************
// The intersection with element produced four intersection points. Thus the
...
...
@@ -292,14 +296,13 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
int
indexEdge
[
2
];
// For a vertex lying on an edge indexEdge
// stores the indices of the two barycentric
// coordinates which are not equal to zero.
int
indexA
;
int
indexB
;
int
indexS_0
;
int
indexS_1
;
int
indexS_2
;
int
indexS_3
;
int
indexSecondFaceIntPoint0
;
int
i
,
j
,
k
;
int
indexA
=
0
;
int
indexB
=
0
;
int
indexS_0
=
0
;
int
indexS_1
=
0
;
int
indexS_2
=
0
;
int
indexS_3
=
0
;
int
indexSecondFaceIntPoint0
=
0
;
/**
* Get the second vertex of element lying in subpolytope.
...
...
@@ -312,10 +315,10 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
*/
// Get the edges including the intersection points.
for
(
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
k
=
0
;
for
(
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
>
1.e-15
)
{
for
(
int
i
=
0
;
i
<
numIntPoints
;
i
++
)
{
int
k
=
0
;
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
{
if
(
fabs
((
*
intPoints
)[
i
][
j
])
>
1.e-15
)
{
indexEdge
[
k
]
=
j
;
k
++
;
}
...
...
@@ -327,9 +330,9 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
// Get the vertex of element adjacent with indexElVertInPol1 whose
// common edge with indexElVertInPol1 doesn't contain an
// intersection point, and store it in indexElVertInPol2.
for
(
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
if
(
intPointOnEdge
[
indexElVertInPol1
][
i
]
==
false
&&
i
!=
indexElVertInPol1
)
{
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
if
(
intPointOnEdge
[
indexElVertInPol1
][
i
]
==
false
&&
i
!=
indexElVertInPol1
)
{
indexElVertInPol2
=
i
;
break
;
}
...
...
@@ -343,23 +346,21 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
* face opposite to A.
*/
if
(
fabs
((
*
intPoints
)[
0
][
indexElVertInPol1
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
0
][
indexElVertInPol1
])
<=
1.e-15
)
{
// (*intPoints)[0] lies in the face opposite to vertex
// /ref indexElVertInPol1.
indexA
=
indexElVertInPol2
;
indexB
=
indexElVertInPol1
;
}
else
if
(
fabs
((
*
intPoints
)[
0
][
indexElVertInPol2
])
<=
1.e-15
)
{
}
else
if
(
fabs
((
*
intPoints
)[
0
][
indexElVertInPol2
])
<=
1.e-15
)
{
// (*intPoints)[0] lies in the face opposite to vertex
// /ref indexElVertInPol2.
indexA
=
indexElVertInPol1
;
indexB
=
indexElVertInPol2
;
}
else
{
}
else
{
ERROR_EXIT
(
"couldn't determine A and B
\n
"
);
}
...
...
@@ -370,7 +371,7 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
// (*intPoints)[0] is a neighbour of A (A has been constructed this way).
indexS_0
=
0
;
if
(
fabs
((
*
intPoints
)[
1
][
indexB
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
1
][
indexB
])
<=
1.e-15
)
{
// (*intPoints)[1] lies in the face opposite to B, thus is a neighbour
// of A.
...
...
@@ -379,14 +380,13 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
indexSecondFaceIntPoint0
=
getIndexSecondFaceIntPoint0
(
indexB
,
dim
);
if
(
fabs
((
*
intPoints
)[
2
][
indexSecondFaceIntPoint0
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
2
][
indexSecondFaceIntPoint0
])
<=
1.e-15
)
{
// (*intPoints)[2] is neighbour of (*intPoints)[0]
indexS_2
=
3
;
indexS_3
=
2
;
}
else
{
}
else
{
// (*intPoints)[2] is opposite to (*intPoints)[0] in the intersection
// plane
...
...
@@ -394,28 +394,26 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
indexS_2
=
2
;
indexS_3
=
3
;
}
}
else
if
(
fabs
((
*
intPoints
)[
1
][
indexA
])
<=
1.e-15
)
{
}
else
if
(
fabs
((
*
intPoints
)[
1
][
indexA
])
<=
1.e-15
)
{
// (*intPoints)[1] lies in the face opposite to A
indexSecondFaceIntPoint0
=
getIndexSecondFaceIntPoint0
(
indexB
,
dim
);
if
(
fabs
((
*
intPoints
)[
1
][
indexSecondFaceIntPoint0
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
1
][
indexSecondFaceIntPoint0
])
<=
1.e-15
)
{
// (*intPoints)[1] is neighbour of (*intPoints)[0], but isn't
// neighbour of A
indexS_3
=
1
;
if
(
fabs
((
*
intPoints
)[
2
][
indexB
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
2
][
indexB
])
<=
1.e-15
)
{
// (*intPoints)[2] is neighbour of (*intPoints)[0] and neighbour of A
indexS_1
=
2
;
indexS_2
=
3
;
}
else
{
}
else
{
// (*intPoints)[2] is opposite to (*intPoints)[0] in the intersection
// plane
...
...
@@ -423,22 +421,20 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
indexS_1
=
3
;
indexS_2
=
2
;
}
}
else
{
}
else
{
// (*intPoints)[1] isn't neighbour of (*intPoints)[0], thus lies opposite
// to (*intPoints)[0] in the intersection plane
indexS_2
=
1
;
if
(
fabs
((
*
intPoints
)[
2
][
indexB
])
<=
1.e-15
)
{
if
(
fabs
((
*
intPoints
)[
2
][
indexB
])
<=
1.e-15
)
{
// (*intPoints)[2] is neighbour of A
indexS_1
=
2
;
indexS_3
=
3
;
}
else
{
}
else
{
// (*intPoints)[2] isn't neighbour of A
...
...
@@ -446,8 +442,7 @@ SubPolytope::createSubElementsForPolytope3D(int indexElVertInPol1)
indexS_3
=
2
;
}
}
}
else
{
}
else
{
ERROR_EXIT
(
"IntPoint1 isn't either part of the face opposite to A nor part of the face opposite to B
\n
"
);
}
...
...
AMDiS/src/AbstractFunction.h
View file @
8f323098
...
...
@@ -93,7 +93,9 @@ namespace AMDiS {
/** \brief
* Returns \ref degree_.
*/
inline
int
getDegree
()
const
{
return
degree_
;
};
inline
int
getDegree
()
const
{
return
degree_
;
};
/** \brief
* Deligates the evaluation to overriden method f.
...
...
@@ -132,7 +134,9 @@ namespace AMDiS {
/** \brief
* Returns \ref degree_.
*/
inline
int
getDegree
()
const
{
return
degree_
;
};
inline
int
getDegree
()
const
{
return
degree_
;
};
/** \brief
* function evaluation.
...
...
@@ -174,7 +178,9 @@ namespace AMDiS {
/** \brief
* Returns \ref degree_.
*/
inline
int
getDegree
()
const
{
return
degree_
;
};
inline
int
getDegree
()
const
{
return
degree_
;
};
/** \brief
* function evaluation.
...
...
AMDiS/src/AdaptBase.h
View file @
8f323098
...
...
@@ -69,7 +69,9 @@ namespace AMDiS {
/** \brief
* Returns \ref name_
*/
inline
const
::
std
::
string
&
getName
()
const
{
return
name_
;
};
inline
const
::
std
::
string
&
getName
()
const
{
return
name_
;
};
/** \brief
* Returns \ref problemIteration_
...
...
@@ -85,7 +87,9 @@ namespace AMDiS {
/** \brief
* Returns \ref adaptInfo_
*/
inline
AdaptInfo
*
getAdaptInfo
()
{
return
adaptInfo_
;
};
inline
AdaptInfo
*
getAdaptInfo
()
{
return
adaptInfo_
;
};
/** \brief
* Returns \ref problemTime_
...
...
@@ -101,7 +105,9 @@ namespace AMDiS {
/** \brief
* Returns \ref initialAdaptInfo_
*/
inline
AdaptInfo
*
getInitialAdaptInfo
()
{
return
initialAdaptInfo_
;
};
inline
AdaptInfo
*
getInitialAdaptInfo
()
{
return
initialAdaptInfo_
;
};
protected:
/** \brief
...
...
AMDiS/src/AdaptInfo.h
View file @
8f323098
...
...
@@ -197,8 +197,7 @@ namespace AMDiS {
* Destructor.
*/
virtual
~
AdaptInfo
()
{
int
i
;
for
(
i
=
0
;
i
<
scalContents
.
getSize
();
i
++
)
{
for
(
int
i
=
0
;
i
<
scalContents
.
getSize
();
i
++
)
{
delete
scalContents
[
i
];
}
};
...
...
@@ -219,9 +218,9 @@ namespace AMDiS {
* Returns whether space tolerance is reached.
*/
virtual
bool
spaceToleranceReached
()
{
int
i
,
size
=
scalContents
.
getSize
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(
!
(
scalContents
[
i
]
->
est_sum
<
scalContents
[
i
]
->
spaceTolerance
))
{
int
size
=
scalContents
.
getSize
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
if
(
!
(
scalContents
[
i
]
->
est_sum
<
scalContents
[
i
]
->
spaceTolerance
))
{
return
false
;
}
}
...
...
@@ -232,7 +231,7 @@ namespace AMDiS {
* Returns whether space tolerance of component i is reached.
*/
virtual
bool
spaceToleranceReached
(
int
i
)
{
if
(
!
(
scalContents
[
i
]
->
est_sum
<
scalContents
[
i
]
->
spaceTolerance
))
{
if
(
!
(
scalContents
[
i
]
->
est_sum
<
scalContents
[
i
]
->
spaceTolerance
))
{
return
false
;
}
else
{
return
true
;
...
...
@@ -243,10 +242,9 @@ namespace AMDiS {
* Returns whether time tolerance is reached.
*/
virtual
bool
timeToleranceReached
()
{
//if(timestep <= minTimestep) return true;
int
i
,
size
=
scalContents
.
getSize
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(
!
(
scalContents
[
i
]
->
est_t_sum
<
scalContents
[
i
]
->
timeTolerance
))
{
int
size
=
scalContents
.
getSize
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
if
(
!
(
scalContents
[
i
]
->
est_t_sum
<
scalContents
[
i
]
->
timeTolerance
))
{
return
false
;
}
}
...
...
@@ -257,7 +255,7 @@ namespace AMDiS {
* Returns whether time tolerance of component i is reached.
*/
virtual
bool
timeToleranceReached
(
int
i
)
{
if
(
!
(
scalContents
[
i
]
->
est_t_sum
<
scalContents
[
i
]
->
timeTolerance
))
{
if
(
!
(
scalContents
[
i
]
->
est_t_sum
<
scalContents
[
i
]
->
timeTolerance
))
{
return
false
;
}
else
{
return
true
;
...
...
@@ -485,8 +483,11 @@ namespace AMDiS {
*/
inline
double
setTime
(
double
t
)
{
time
=
t
;
if
(
time
>
endTime
)
time
=
endTime
;
if
(
time
<
startTime
)
time
=
startTime
;
if
(
time
>
endTime
)
time
=
endTime
;
if
(
time
<
startTime
)
time
=
startTime
;
return
time
;
};
...
...
@@ -509,9 +510,13 @@ namespace AMDiS {
*/
inline
double
setTimestep
(
double
t
)
{
timestep
=
t
;
if
(
timestep
>
maxTimestep
)
timestep
=
maxTimestep
;
if
(
timestep
<
minTimestep
)
timestep
=
minTimestep
;
if
(
time
+
timestep
>
endTime
)
timestep
=
endTime
-
time
;
if
(
timestep
>
maxTimestep
)
timestep
=
maxTimestep
;
if
(
timestep
<
minTimestep
)
timestep
=
minTimestep
;
if
(
time
+
timestep
>
endTime
)
timestep
=
endTime
-
time
;
return
timestep
;
};
...
...
@@ -763,8 +768,14 @@ namespace AMDiS {
*/
int
maxSolverIterations
;
/** \brief
*
*/
double
solverTolerance
;
/** \brief
*
*/
double
solverResidual
;
/** \brief
...
...
AMDiS/src/AdaptInstationary.cc
View file @
8f323098
...
...
@@ -112,7 +112,7 @@ namespace AMDiS {
adaptInfo_
->
incTimestepIteration
();
if
(
!
fixedTimestep_
&&
if
(
!
fixedTimestep_
&&
!
adaptInfo_
->
timeToleranceReached
()
&&
!
adaptInfo_
->
getTimestep
()
<=
adaptInfo_
->
getMinTimestep
())
{
...
...
@@ -126,8 +126,8 @@ namespace AMDiS {
do
{
problemIteration_
->
beginIteration
(
adaptInfo_
);
if
(
problemIteration_
->
oneIteration
(
adaptInfo_
,
FULL_ITERATION
))
{
if
(
!
fixedTimestep_
&&
if
(
problemIteration_
->
oneIteration
(
adaptInfo_
,
FULL_ITERATION
))
{
if
(
!
fixedTimestep_
&&
!
adaptInfo_
->
timeToleranceReached
()
&&
!
adaptInfo_
->
getTimestep
()
<=
adaptInfo_
->
getMinTimestep
())
{
...
...
@@ -148,7 +148,7 @@ namespace AMDiS {
!
adaptInfo_
->
getTimestep
()
<=
adaptInfo_
->
getMinTimestep
()
&&
adaptInfo_
->
getTimestepIteration
()
<=
adaptInfo_
->
getMaxTimestepIteration
());
if
(
!
fixedTimestep_
&&
adaptInfo_
->
timeErrorLow
())
{
if
(
!
fixedTimestep_
&&
adaptInfo_
->
timeErrorLow
())
{
adaptInfo_
->
setTimestep
(
adaptInfo_
->
getTimestep
()
*
time_delta_2
);
}
}
...
...
AMDiS/src/AdaptInstationary.h
View file @
8f323098
...
...
@@ -149,12 +149,12 @@ namespace AMDiS {
/** \brief
* Parameter \f$ \delta_1 \f$ used in time step reduction
*/
double
time_delta_1
;
double
time_delta_1
;
/** \brief
* Parameter \f$ \delta_2 \f$ used in time step enlargement
*/
double
time_delta_2
;
double
time_delta_2
;
/** \brief
* If this parameter is 1 and the instationary problem is stable, hence the number
...
...
AMDiS/src/AdaptStationary.cc
View file @
8f323098
...
...
@@ -28,19 +28,19 @@ namespace AMDiS {
}
// adaption loop
while
(
!
adaptInfo_
->
spaceToleranceReached
()
&&
(
adaptInfo_
->
getSpaceIteration
()
<
adaptInfo_
->
getMaxSpaceIteration
()
||
adaptInfo_
->
getMaxSpaceIteration
()
<
0
)
)
{
problemIteration_
->
beginIteration
(
adaptInfo_
);
Flag
adapted
=
problemIteration_
->
oneIteration
(
adaptInfo_
,
FULL_ITERATION
);
problemIteration_
->
endIteration
(
adaptInfo_
);
if
(
!
adapted
)
break
;
adaptInfo_
->
incSpaceIteration
();
}
while
(
!
adaptInfo_
->
spaceToleranceReached
()
&&
(
adaptInfo_
->
getSpaceIteration
()
<
adaptInfo_
->
getMaxSpaceIteration
()
||
adaptInfo_
->
getMaxSpaceIteration
()
<
0
)
)
{
problemIteration_
->
beginIteration
(
adaptInfo_
);
Flag
adapted
=
problemIteration_
->
oneIteration
(
adaptInfo_
,
FULL_ITERATION
);
problemIteration_
->
endIteration
(
adaptInfo_
);
if
(
!
adapted
)
break
;
adaptInfo_
->
incSpaceIteration
();
}
return
0
;
}
...
...
AMDiS/src/Assembler.cc
View file @
8f323098
This diff is collapsed.
Click to expand it.
AMDiS/src/Assembler.h