Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Sander, Oliver
dune-gfe
Commits
3568f255
Commit
3568f255
authored
13 years ago
by
Youett, Jonathan
Committed by
akbib@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
A global geodesic finite element grid function. Not tested yet.
[[Imported from SVN: r7914]]
parent
375b068f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gfe/globalgeodesicfefunction.hh
+81
-0
81 additions, 0 deletions
dune/gfe/globalgeodesicfefunction.hh
with
81 additions
and
0 deletions
dune/gfe/globalgeodesicfefunction.hh
0 → 100644
+
81
−
0
View file @
3568f255
#ifndef GLOBAL_GEODESIC_FINITE_ELEMENT_FUNCTION_HH
#define GLOBAL_GEODESIC_FINITE_ELEMENT_FUNCTION_HH
#include
<vector>
#include
<dune/common/fvector.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/gfe/localgeodesicfefunction.hh>
/** \brief Global geodesic finite element function.
*
* \tparam Basis - The global basis type.
* \tparam TargetSpace - The manifold that this functions takes its values in.
*/
template
<
class
Basis
,
class
TargetSpace
>
GlobalGeodesicFEFunction
{
typedef
typename
Basis
::
LocalFiniteElement
LocalFiniteElement
;
typedef
typename
Basis
::
GridView
GridView
;
typedef
typename
GridView
::
template
Codim
<
0
>
::
Entity
Element
;
typedef
typename
GridView
::
Grid
::
ctype
ctype
;
typedef
LocalGeodesicFEFunction
<
GridView
::
dimension
,
ctype
,
LocalFiniteElement
,
TargetSpace
>
LocalGFEFunction
;
typedef
typename
TargetSpace
::
EmbeddedTangentVector
EmbeddedTangentVector
;
//! Dimension of the grid.
enum
{
gridDim
=
GridView
::
dimension
};
//! Dimension of the embedded tanget space
enum
{
embeddedDim
=
EmbeddedTangentVector
::
dimension
};
//! Create global function by a global basis and the corresponding coefficient vector
GlobalGeodesicFEFunction
(
const
Basis
&
basis
,
const
std
::
vector
<
TargetSpace
>&
coefficients
)
:
basis_
(
basis
),
coefficients_
(
coefficients
)
{}
/** \brief Evaluate the function at local coordinates. */
void
evaluateLocal
(
const
Element
&
element
,
const
Dune
::
FieldVector
<
gridDim
,
ctype
>&
local
,
TargetSpace
&
out
)
{
int
numOfBasisFct
=
basis_
.
getLocalFiniteElement
(
element
).
size
();
// Extract local solution
std
::
vector
<
TargetSpace
>
localSolution
(
numOfBaseFct
);
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localCoeff
[
i
]
=
coefficients_
[
basis_
.
index
(
element
,
i
)];
// create local gfe function
LocalGFEFunction
localGFE
(
basis_
.
getLocalFiniteElement
(
element
),
localCoeff
);
out
=
localGFE
.
evaluate
(
local
);
}
/** \brief Evaluate the derivative of the function at local coordinates. */
void
evaluateDerivativeLocal
(
const
Element
&
element
,
const
Dune
::
FieldVector
<
gridDim
,
ctype
>&
local
,
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
gridDim
>&
out
)
{
int
numOfBasisFct
=
basis_
.
getLocalFiniteElement
(
element
).
size
();
// Extract local solution
std
::
vector
<
TargetSpace
>
localSolution
(
numOfBaseFct
);
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localCoeff
[
i
]
=
coefficients_
[
basis_
.
index
(
element
,
i
)];
// create local gfe function
LocalGFEFunction
localGFE
(
basis_
.
getLocalFiniteElement
(
element
),
localCoeff
);
// use it to evaluate the derivative
out
=
localGFE
.
evaluateDerivative
(
local
);
}
private
:
//! The global basis
const
Basis
&
basis_
;
//! The coefficient vector
const
std
::
vector
<
TargetSpace
>&
coefficients_
;
};
#endif
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