Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
50cb43cc
Commit
50cb43cc
authored
Jul 10, 2008
by
Thomas Witkowski
Browse files
* Residual Estimator faster!!!
parent
bf3468a4
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/BasisFunction.cc
View file @
50cb43cc
...
...
@@ -89,8 +89,10 @@ namespace AMDiS {
{
TEST_EXIT_DBG
(
val
)(
"return value is NULL
\n
"
);
DimVec
<
double
>
*
grdTmp1
=
grdTmpVec1
[
omp_get_thread_num
()];
DimVec
<
double
>
*
grdTmp2
=
grdTmpVec2
[
omp_get_thread_num
()];
int
myRank
=
omp_get_thread_num
();
DimVec
<
double
>
*
grdTmp1
=
grdTmpVec1
[
myRank
];
DimVec
<
double
>
*
grdTmp2
=
grdTmpVec2
[
myRank
];
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
(
*
grdTmp2
)[
j
]
=
0.0
;
...
...
AMDiS/src/DOFAdmin.cc
View file @
50cb43cc
...
...
@@ -298,16 +298,6 @@ namespace AMDiS {
return
;
}
const
int
DOFAdmin
::
getNumberOfDOFs
(
int
i
)
const
{
return
nrDOF
[
i
];
}
const
int
DOFAdmin
::
getNumberOfPreDOFs
(
int
i
)
const
{
TEST_EXIT_DBG
((
0
<=
i
)
&&
(
4
>
i
))(
""
);
return
nr0DOF
[
i
];
}
void
DOFAdmin
::
setNumberOfDOFs
(
int
i
,
int
v
)
{
TEST_EXIT_DBG
((
0
<=
i
)
&&
(
4
>
i
))(
""
);
...
...
AMDiS/src/DOFAdmin.h
View file @
50cb43cc
...
...
@@ -204,7 +204,9 @@ namespace AMDiS {
/** \brief
* Returns \ref nrDOF[i]
*/
const
int
getNumberOfDOFs
(
int
i
)
const
;
inline
const
int
getNumberOfDOFs
(
int
i
)
const
{
return
nrDOF
[
i
];
}
/** \brief
* Returns \ref nrDOF
...
...
@@ -216,7 +218,9 @@ namespace AMDiS {
/** \brief
* Returns \ref nr0DOF[i]
*/
const
int
getNumberOfPreDOFs
(
int
i
)
const
;
inline
const
int
getNumberOfPreDOFs
(
int
i
)
const
{
return
nr0DOF
[
i
];
}
/** \brief
* Returns \ref nr0DOF
...
...
AMDiS/src/ElInfo3d.cc
View file @
50cb43cc
...
...
@@ -380,7 +380,7 @@ namespace AMDiS {
if
(
fillFlag__local
.
isAnySet
())
{
cvg
=
Tetrahedron
::
childVertex
[
el_type_local
];
cv
=
const_cast
<
int
*>
(
cvg
[
ichild
]);
cv
=
const_cast
<
int
*>
(
cvg
[
ichild
]);
ochild
=
1
-
ichild
;
}
...
...
AMDiS/src/ResidualEstimator.cc
View file @
50cb43cc
...
...
@@ -118,6 +118,8 @@ namespace AMDiS {
jump_
.
resize
(
nPointsSurface_
);
localJump_
.
resize
(
nPointsSurface_
);
neighbours_
=
Global
::
getGeo
(
NEIGH
,
dim
);
lambdaNeigh_
=
NEW
DimVec
<
WorldVector
<
double
>
>
(
dim
,
NO_INIT
);
lambda_
=
NEW
DimVec
<
double
>
(
dim
,
NO_INIT
);
}
}
...
...
@@ -166,6 +168,11 @@ namespace AMDiS {
FREE_MEMORY
(
D2uhqp
,
WorldMatrix
<
double
>
,
numPoints
);
}
if
(
C1
&&
(
dim
>
1
))
{
DELETE
lambdaNeigh_
;
DELETE
lambda_
;
}
DELETE
neighInfo
;
}
...
...
@@ -185,7 +192,7 @@ namespace AMDiS {
el
=
elInfo
->
getElement
();
double
det
=
elInfo
->
getDet
();
const
DimVec
<
WorldVector
<
double
>
>
&
Lambda
=
elInfo
->
getGrdLambda
();
const
DimVec
<
WorldVector
<
double
>
>
&
grd
Lambda
=
elInfo
->
getGrdLambda
();
est_el
=
el
->
getEstimation
(
row
);
...
...
@@ -289,14 +296,10 @@ namespace AMDiS {
for
(
int
face
=
0
;
face
<
neighbours_
;
face
++
)
{
neigh
=
const_cast
<
Element
*>
(
elInfo
->
getNeighbour
(
face
));
if
(
neigh
&&
neigh
->
getMark
())
{
WorldVector
<
int
>
faceIndEl
,
faceIndNeigh
;
int
oppV
=
elInfo
->
getOppVertex
(
face
);
DimVec
<
WorldVector
<
double
>
>
LambdaNeigh
(
dim
,
NO_INIT
);
double
detNeigh
;
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
el
->
sortFaceIndices
(
face
,
&
faceIndEl
);
neigh
->
sortFaceIndices
(
oppV
,
&
faceIndNeigh
);
el
->
sortFaceIndices
(
face
,
&
faceIndEl
_
);
neigh
->
sortFaceIndices
(
oppV
,
&
faceIndNeigh
_
);
neighInfo
->
setElement
(
const_cast
<
Element
*>
(
neigh
));
neighInfo
->
setFillFlag
(
Mesh
::
FILL_COORDS
);
...
...
@@ -313,14 +316,14 @@ namespace AMDiS {
if
(
ldp
)
{
::
std
::
list
<
LeafDataPeriodic
::
PeriodicInfo
>::
iterator
it
;
::
std
::
list
<
LeafDataPeriodic
::
PeriodicInfo
>&
infoList
=
dynamic_cast
<
LeafDataPeriodic
*>
(
ldp
)
->
getInfoList
();
for
(
it
=
dynamic_cast
<
LeafDataPeriodic
*>
(
ldp
)
->
getInfoList
().
begin
();
it
!=
dynamic_cast
<
LeafDataPeriodic
*>
(
ldp
)
->
getInfoList
().
end
();
++
it
)
{
for
(
it
=
infoList
.
begin
();
it
!=
infoList
.
end
();
++
it
)
{
if
(
it
->
elementSide
==
face
)
{
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
{
i1
=
faceIndEl
[
i
];
i2
=
faceIndNeigh
[
i
];
i1
=
faceIndEl
_
[
i
];
i2
=
faceIndNeigh
_
[
i
];
for
(
j
=
0
;
j
<
dim
;
j
++
)
{
if
(
i1
==
el
->
getVertexOfPosition
(
INDEX_OF_DIM
(
dim
-
1
,
...
...
@@ -343,8 +346,8 @@ namespace AMDiS {
if
(
!
periodicCoords
)
{
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
{
i1
=
faceIndEl
[
i
];
i2
=
faceIndNeigh
[
i
];
i1
=
faceIndEl
_
[
i
];
i2
=
faceIndNeigh
_
[
i
];
for
(
j
=
0
;
j
<
dow
;
j
++
)
neighInfo
->
getCoord
(
i2
)[
j
]
=
elInfo
->
getCoord
(
i1
)[
j
];
}
...
...
@@ -355,7 +358,7 @@ namespace AMDiS {
neighInfo
=
parametric
->
addParametricInfo
(
neighInfo
);
}
detNeigh
=
abs
(
neighInfo
->
calcGrdLambda
(
L
ambdaNeigh
));
double
detNeigh
=
abs
(
neighInfo
->
calcGrdLambda
(
*
l
ambdaNeigh
_
));
for
(
iq
=
0
;
iq
<
nPointsSurface_
;
iq
++
)
{
jump_
[
iq
].
set
(
0.0
);
...
...
@@ -370,23 +373,23 @@ namespace AMDiS {
uh
[
system
]
->
getLocalVector
(
neigh
,
uhNeigh
[
system
]);
for
(
iq
=
0
;
iq
<
nPointsSurface_
;
iq
++
)
{
lambda
[
face
]
=
0.0
;
(
*
lambda
_
)
[
face
]
=
0.0
;
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
{
lambda
[
faceIndEl
[
i
]]
=
surfaceQuad_
->
getLambda
(
iq
,
i
);
(
*
lambda
_
)
[
faceIndEl
_
[
i
]]
=
surfaceQuad_
->
getLambda
(
iq
,
i
);
}
basFcts
[
system
]
->
evalGrdUh
(
lambda
,
Lambda
,
basFcts
[
system
]
->
evalGrdUh
(
*
lambda
_
,
grd
Lambda
,
uhEl
[
system
],
&
grdUhEl_
[
iq
]);
lambda
[
oppV
]
=
0.0
;
(
*
lambda
_
)
[
oppV
]
=
0.0
;
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
{
lambda
[
faceIndNeigh
[
i
]]
=
surfaceQuad_
->
getLambda
(
iq
,
i
);
(
*
lambda
_
)
[
faceIndNeigh
_
[
i
]]
=
surfaceQuad_
->
getLambda
(
iq
,
i
);
}
basFcts
[
system
]
->
evalGrdUh
(
lambda
,
L
ambdaNeigh
,
basFcts
[
system
]
->
evalGrdUh
(
*
lambda
_
,
*
l
ambdaNeigh
_
,
uhNeigh
[
system
],
&
grdUhNeigh_
[
iq
]);
...
...
AMDiS/src/ResidualEstimator.h
View file @
50cb43cc
...
...
@@ -169,6 +169,14 @@ namespace AMDiS {
Vector
<
WorldVector
<
double
>
>
localJump_
;
WorldVector
<
int
>
faceIndEl_
;
WorldVector
<
int
>
faceIndNeigh_
;
DimVec
<
WorldVector
<
double
>
>
*
lambdaNeigh_
;
DimVec
<
double
>
*
lambda_
;
int
neighbours_
;
};
}
...
...
Write
Preview
Supports
Markdown
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