Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iwr
amdis
Commits
2d8a6968
Commit
2d8a6968
authored
14 years ago
by
Thomas Witkowski
Browse files
Options
Downloads
Patches
Plain Diff
Added new functions for integrating abstract function with two DOFVectors.
parent
dc85616d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AMDiS/src/AMDiS.h
+2
-1
2 additions, 1 deletion
AMDiS/src/AMDiS.h
AMDiS/src/AMDiS_fwd.h
+13
-0
13 additions, 0 deletions
AMDiS/src/AMDiS_fwd.h
AMDiS/src/DOFVector.cc
+92
-0
92 additions, 0 deletions
AMDiS/src/DOFVector.cc
AMDiS/src/DOFVector.h
+20
-0
20 additions, 0 deletions
AMDiS/src/DOFVector.h
with
127 additions
and
1 deletion
AMDiS/src/AMDiS.h
+
2
−
1
View file @
2d8a6968
#ifndef AMDIS_H
#define AMDIS_H
#include
"MathFunctions.h"
#include
"AbstractFunction.h"
#include
"AdaptInfo.h"
#include
"AdaptInstationary.h"
...
...
@@ -49,6 +49,7 @@
#include
"MacroElement.h"
#include
"MacroWriter.h"
#include
"Marker.h"
#include
"MathFunctions.h"
#include
"MatrixVector.h"
#include
"Mesh.h"
#include
"MeshStructure.h"
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/AMDiS_fwd.h
+
13
−
0
View file @
2d8a6968
...
...
@@ -101,6 +101,19 @@ namespace AMDiS {
struct
AtomicBoundary
;
template
<
typename
ReturnType
,
typename
ArgumentType
>
class
AbstractFunction
;
template
<
typename
ReturnType
,
typename
ArgumentType1
,
typename
ArgumentType2
>
class
BinaryAbstractFunction
;
template
<
typename
ReturnType
,
typename
ArgumentType1
,
typename
ArgumentType2
,
typename
ArgumentType3
>
class
TertiaryAbstractFunction
;
template
<
typename
ReturnType
,
typename
ArgumentType1
,
typename
ArgumentType2
,
typename
ArgumentType3
,
typename
ArgumentType4
>
class
QuartAbstractFunction
;
template
<
typename
T
>
class
DOFIndexed
;
template
<
typename
T
>
class
DOFVectorBase
;
template
<
typename
T
>
class
DOFVector
;
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/DOFVector.cc
+
92
−
0
View file @
2d8a6968
...
...
@@ -865,5 +865,97 @@ namespace AMDiS {
}
double
integrate
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
)
{
if
(
vec1
.
getFESpace
()
->
getMesh
()
==
vec2
.
getFESpace
()
->
getMesh
())
return
intSingleMesh
(
vec1
,
vec2
,
fct
);
else
return
intDualMesh
(
vec1
,
vec2
,
fct
);
}
double
intSingleMesh
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
)
{
FUNCNAME
(
"intDualmesh()"
);
TEST_EXIT
(
fct
)(
"No function defined!
\n
"
);
int
deg
=
2
*
vec1
.
getFESpace
()
->
getBasisFcts
()
->
getDegree
();
Quadrature
*
quad
=
Quadrature
::
provideQuadrature
(
vec1
.
getFESpace
()
->
getMesh
()
->
getDim
(),
deg
);
FastQuadrature
*
fastQuad
=
FastQuadrature
::
provideFastQuadrature
(
vec1
.
getFESpace
()
->
getBasisFcts
(),
*
quad
,
INIT_PHI
);
std
::
vector
<
double
>
qp1
(
fastQuad
->
getNumPoints
());
std
::
vector
<
double
>
qp2
(
fastQuad
->
getNumPoints
());
double
value
=
0.0
;
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
|
Mesh
::
FILL_DET
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
vec1
.
getFESpace
()
->
getMesh
(),
-
1
,
traverseFlag
);
while
(
elInfo
)
{
double
det
=
elInfo
->
getDet
();
double
tmp
=
0.0
;
vec1
.
getVecAtQPs
(
elInfo
,
quad
,
fastQuad
,
&
(
qp1
[
0
]));
vec2
.
getVecAtQPs
(
elInfo
,
quad
,
fastQuad
,
&
(
qp2
[
0
]));
for
(
int
iq
=
0
;
iq
<
fastQuad
->
getNumPoints
();
iq
++
)
tmp
+=
fastQuad
->
getWeight
(
iq
)
*
(
*
fct
)(
qp1
[
iq
],
qp2
[
iq
]);
value
+=
tmp
*
det
;
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
return
value
;
}
double
intDualMesh
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
)
{
FUNCNAME
(
"intDualmesh()"
);
TEST_EXIT
(
fct
)(
"No function defined!
\n
"
);
int
deg
=
2
*
vec1
.
getFESpace
()
->
getBasisFcts
()
->
getDegree
();
Quadrature
*
quad
=
Quadrature
::
provideQuadrature
(
vec1
.
getFESpace
()
->
getMesh
()
->
getDim
(),
deg
);
FastQuadrature
*
fastQuad
=
FastQuadrature
::
provideFastQuadrature
(
vec1
.
getFESpace
()
->
getBasisFcts
(),
*
quad
,
INIT_PHI
);
std
::
vector
<
double
>
qp1
(
fastQuad
->
getNumPoints
());
std
::
vector
<
double
>
qp2
(
fastQuad
->
getNumPoints
());
double
value
=
0.0
;
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
|
Mesh
::
FILL_DET
;
DualTraverse
dualTraverse
;
DualElInfo
dualElInfo
;
bool
cont
=
dualTraverse
.
traverseFirst
(
vec1
.
getFESpace
()
->
getMesh
(),
vec2
.
getFESpace
()
->
getMesh
(),
-
1
,
-
1
,
traverseFlag
,
traverseFlag
,
dualElInfo
);
while
(
cont
)
{
double
det
=
dualElInfo
.
smallElInfo
->
getDet
();
double
tmp
=
0.0
;
vec1
.
getVecAtQPs
(
dualElInfo
.
smallElInfo
,
dualElInfo
.
largeElInfo
,
quad
,
fastQuad
,
&
(
qp1
[
0
]));
vec2
.
getVecAtQPs
(
dualElInfo
.
smallElInfo
,
dualElInfo
.
largeElInfo
,
quad
,
fastQuad
,
&
(
qp2
[
0
]));
for
(
int
iq
=
0
;
iq
<
fastQuad
->
getNumPoints
();
iq
++
)
tmp
+=
fastQuad
->
getWeight
(
iq
)
*
(
*
fct
)(
qp1
[
iq
],
qp2
[
iq
]);
value
+=
tmp
*
det
;
cont
=
dualTraverse
.
traverseNext
(
dualElInfo
);
}
return
value
;
}
}
This diff is collapsed.
Click to expand it.
AMDiS/src/DOFVector.h
+
20
−
0
View file @
2d8a6968
...
...
@@ -789,6 +789,26 @@ namespace AMDiS {
WorldVector
<
DOFVector
<
double
>*>
*
transform
(
DOFVector
<
WorldVector
<
double
>
>
*
vec
,
WorldVector
<
DOFVector
<
double
>*>
*
result
);
/** \brief
* Computes the integral of a function that includes two different DOFVectors. This
* function works also for the case that the DOFVectors are defined on two different
* meshes.
*/
double
integrate
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
);
/// Computes the integral of a function with two DOFVectors defined on the same mesh.
double
intSingleMesh
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
);
/// Computes the integral of a function with two DOFVectors defined on different meshes.
double
intDualMesh
(
const
DOFVector
<
double
>
&
vec1
,
const
DOFVector
<
double
>
&
vec2
,
BinaryAbstractFunction
<
double
,
double
,
double
>
*
fct
);
}
#include
"DOFVector.hh"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment