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
Backofen, Rainer
amdis
Commits
bbd936aa
Commit
bbd936aa
authored
Oct 14, 2009
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug for FOT operators when using 2d meshes in 3d.
parent
005e656e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
226 additions
and
284 deletions
+226
-284
AMDiS/src/FixVec.h
AMDiS/src/FixVec.h
+10
-8
AMDiS/src/Operator.cc
AMDiS/src/Operator.cc
+188
-217
AMDiS/src/Operator.h
AMDiS/src/Operator.h
+28
-59
No files found.
AMDiS/src/FixVec.h
View file @
bbd936aa
...
...
@@ -277,7 +277,8 @@ namespace AMDiS {
* VectorOfFixVecs constructors.
*/
MatrixOfFixVecs
(
int
dim
,
int
r
,
int
c
,
InitType
initType
)
:
rows
(
r
),
columns
(
c
)
:
rows
(
r
),
columns
(
c
)
{
TEST_EXIT_DBG
(
initType
==
NO_INIT
)(
"wrong initType or wrong initializer
\n
"
);
vec
=
new
VectorOfFixVecs
<
FixVecType
>*
[
rows
];
...
...
@@ -309,12 +310,14 @@ namespace AMDiS {
}
/// Returns \ref rows
inline
int
getNumberOfRows
()
const
{
inline
int
getNumberOfRows
()
const
{
return
rows
;
}
/// Returns \ref columns
inline
int
getNumberOfColumns
()
const
{
inline
int
getNumberOfColumns
()
const
{
return
columns
;
}
...
...
@@ -337,7 +340,8 @@ namespace AMDiS {
* parts of an element.
*/
template
<
typename
T
>
class
DimVec
:
public
FixVec
<
T
,
PARTS
>
{
class
DimVec
:
public
FixVec
<
T
,
PARTS
>
{
public:
DimVec
()
{}
...
...
@@ -549,8 +553,7 @@ namespace AMDiS {
return
result
;
}
inline
bool
operator
<
(
const
WorldVector
<
double
>&
v1
,
const
WorldVector
<
double
>&
v2
)
inline
bool
operator
<
(
const
WorldVector
<
double
>&
v1
,
const
WorldVector
<
double
>&
v2
)
{
int
dow
=
Global
::
getGeo
(
WORLD
);
for
(
int
i
=
0
;
i
<
dow
;
i
++
)
{
...
...
@@ -561,8 +564,7 @@ namespace AMDiS {
return
false
;
}
inline
bool
operator
==
(
const
WorldVector
<
double
>&
v1
,
const
WorldVector
<
double
>&
v2
)
inline
bool
operator
==
(
const
WorldVector
<
double
>&
v1
,
const
WorldVector
<
double
>&
v2
)
{
int
dow
=
Global
::
getGeo
(
WORLD
);
for
(
int
i
=
0
;
i
<
dow
;
i
++
)
...
...
AMDiS/src/Operator.cc
View file @
bbd936aa
This diff is collapsed.
Click to expand it.
AMDiS/src/Operator.h
View file @
bbd936aa
...
...
@@ -172,8 +172,9 @@ namespace AMDiS {
double
factor
)
{
const
int
dimOfWorld
=
Global
::
getGeo
(
WORLD
);
for (int i = 0; i <= dimOfWorld; i++) {
const
int
dim
=
Lambda
.
size
()
-
1
;
for
(
int
i
=
0
;
i
<=
dim
;
i
++
)
{
double
val
=
0.0
;
for
(
int
j
=
0
;
j
<
dimOfWorld
;
j
++
)
...
...
@@ -192,8 +193,9 @@ namespace AMDiS {
double
factor
)
{
const
int
dimOfWorld
=
Global
::
getGeo
(
WORLD
);
const
int
dim
=
Lambda
.
size
()
-
1
;
for (int i = 0; i <= dim
OfWorld
; i++) {
for
(
int
i
=
0
;
i
<=
dim
;
i
++
)
{
double
val
=
0.0
;
for
(
int
j
=
0
;
j
<
dimOfWorld
;
j
++
)
...
...
@@ -476,9 +478,7 @@ namespace AMDiS {
setSymmetric
(
symmetric
);
}
/** \brief
* Implements SecondOrderTerm::getLALt().
*/
/// Implements SecondOrderTerm::getLALt().
inline
void
getLALt
(
const
ElInfo
*
elInfo
,
int
nPoints
,
DimMat
<
double
>
**
LALt
)
const
{
const
DimVec
<
WorldVector
<
double
>
>&
Lambda
=
elInfo
->
getGrdLambda
();
...
...
@@ -486,9 +486,7 @@ namespace AMDiS {
lalt
(
Lambda
,
matrix
,
*
(
LALt
[
iq
]),
symmetric
,
1.0
);
}
/** \brief
* Implenetation of SecondOrderTerm::eval().
*/
/// Implenetation of SecondOrderTerm::eval().
void
eval
(
int
nPoints
,
const
double
*
uhAtQP
,
const
WorldVector
<
double
>
*
grdUhAtQP
,
...
...
@@ -496,22 +494,16 @@ namespace AMDiS {
double
*
result
,
double
factor
)
const
;
/** \brief
* Implenetation of SecondOrderTerm::weakEval().
*/
/// Implenetation of SecondOrderTerm::weakEval().
void
weakEval
(
int
nPoints
,
const
WorldVector
<
double
>
*
grdUhAtQP
,
WorldVector
<
double
>
*
result
)
const
;
protected:
/** \brief
* Matrix stroring A.
*/
/// Matrix stroring A.
WorldMatrix
<
double
>
matrix
;
/** \brief
* True, if \ref matrix is symmetric.
*/
/// True, if \ref matrix is symmetric.
bool
symmetric
;
};
...
...
@@ -543,12 +535,10 @@ namespace AMDiS {
setSymmetric
(
xi
==
xj
);
}
/** \brief
* Implements SecondOrderTerm::getLALt().
*/
/// Implements SecondOrderTerm::getLALt().
inline
void
getLALt
(
const
ElInfo
*
elInfo
,
int
nPoints
,
DimMat
<
double
>
**
LALt
)
const
{
const DimVec<WorldVector<double> > &Lambda
= elInfo->getGrdLambda();
const
DimVec
<
WorldVector
<
double
>
>
&
Lambda
=
elInfo
->
getGrdLambda
();
for
(
int
iq
=
0
;
iq
<
nPoints
;
iq
++
)
lalt_kl
(
Lambda
,
xi
,
xj
,
*
(
LALt
[
iq
]),
(
*
factor
));
}
...
...
@@ -1357,21 +1347,15 @@ namespace AMDiS {
:
OperatorTerm
(
deg
)
{}
/** \brief
* Destructor.
*/
/// Destructor.
virtual
~
FirstOrderTerm
()
{}
/** \brief
* Evaluation of \f$ \Lambda b \f$.
*/
/// Evaluation of \f$ \Lambda b \f$.
virtual
void
getLb
(
const
ElInfo
*
elInfo
,
int
nPoints
,
VectorOfFixVecs
<
DimVec
<
double
>
>&
result
)
const
=
0
;
/** \brief
* Implenetation of FirstOrderTerm::eval().
*/
/// Implenetation of FirstOrderTerm::eval().
void
eval
(
int
nPoints
,
const
double
*
,
const
WorldVector
<
double
>
*
grdUhAtQP
,
...
...
@@ -1384,9 +1368,9 @@ namespace AMDiS {
if
(
grdUhAtQP
)
{
for
(
int
iq
=
0
;
iq
<
nPoints
;
iq
++
)
{
double
resultQP
=
0.0
;
for (int i = 0; i < dow; i++)
{
for
(
int
i
=
0
;
i
<
dow
;
i
++
)
resultQP
+=
grdUhAtQP
[
iq
][
i
];
}
result
[
iq
]
+=
resultQP
*
factor
;
}
}
...
...
@@ -1409,9 +1393,7 @@ namespace AMDiS {
:
FirstOrderTerm
(
0
)
{}
/** \brief
* Implements FirstOrderTerm::getLb().
*/
/// Implements FirstOrderTerm::getLb().
inline
void
getLb
(
const
ElInfo
*
elInfo
,
int
nPoints
,
VectorOfFixVecs
<
DimVec
<
double
>
>&
Lb
)
const
...
...
@@ -1491,9 +1473,7 @@ namespace AMDiS {
lb
(
Lambda
,
b
,
Lb
[
iq
],
1.0
);
}
/** \brief
* Implements FirstOrderTerm::eval().
*/
/// Implements FirstOrderTerm::eval().
void
eval
(
int
nPoints
,
const
double
*
,
const
WorldVector
<
double
>
*
grdUhAtQP
,
...
...
@@ -1502,14 +1482,12 @@ namespace AMDiS {
double
factor
)
const
{
if
(
grdUhAtQP
)
for(int iq = 0; iq < nPoints; iq++)
for
(
int
iq
=
0
;
iq
<
nPoints
;
iq
++
)
result
[
iq
]
+=
b
*
grdUhAtQP
[
iq
]
*
factor
;
}
protected:
/** \brief
* Vector which is multiplied with \f$ \nabla u(\vec{x}) \f$
*/
/// Vector which is multiplied with \f$ \nabla u(\vec{x}) \f$
WorldVector
<
double
>
b
;
};
...
...
@@ -1532,7 +1510,8 @@ namespace AMDiS {
Quadrature
*
quad
=
NULL
);
/// Implements FirstOrderTerm::getLb().
void getLb(const ElInfo *elInfo, int nPoints, VectorOfFixVecs<DimVec<double> >& Lb) const;
void
getLb
(
const
ElInfo
*
elInfo
,
int
nPoints
,
VectorOfFixVecs
<
DimVec
<
double
>
>&
Lb
)
const
;
/// Implements FirstOrderTerm::eval().
void
eval
(
int
nPoints
,
...
...
@@ -2224,9 +2203,7 @@ namespace AMDiS {
/// Implements ZeroOrderTerm::getC().
void
getC
(
const
ElInfo
*
,
int
nPoints
,
std
::
vector
<
double
>
&
C
)
const
;
/** \brief
* Implements ZeroOrderTerm::eval().
*/
/// Implements ZeroOrderTerm::eval().
void
eval
(
int
nPoints
,
const
double
*
uhAtQP
,
const
WorldVector
<
double
>
*
grdUhAtQP
,
...
...
@@ -2235,19 +2212,13 @@ namespace AMDiS {
double
fac
)
const
;
protected:
/** \brief
* DOFVector to be evaluated at quadrature points.
*/
/// DOFVector to be evaluated at quadrature points.
DOFVectorBase
<
double
>*
vec
;
/** \brief
* Vector v at quadrature points.
*/
/// Vector v at quadrature points.
double
*
vecAtQPs
;
/** \brief
* Function for c.
*/
/// Function for c.
AbstractFunction
<
double
,
double
>
*
f
;
};
...
...
@@ -2266,9 +2237,7 @@ namespace AMDiS {
AbstractFunction
<
double
,
double
>
*
f1
,
AbstractFunction
<
double
,
double
>
*
f2
);
/** \brief
* Implementation of \ref OperatorTerm::initElement().
*/
/// Implementation of \ref OperatorTerm::initElement().
void
initElement
(
const
ElInfo
*
elInfo
,
SubAssembler
*
subAssembler
,
Quadrature
*
quad
=
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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