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
7036bb96
Commit
7036bb96
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use the localInterpolation.interpolate method to get the positions of the Lagrange nodes
[[Imported from SVN: r8237]]
parent
c733ff17
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/geodesicfefunctionadaptor.hh
+33
-21
33 additions, 21 deletions
dune/gfe/geodesicfefunctionadaptor.hh
with
33 additions
and
21 deletions
dune/gfe/geodesicfefunctionadaptor.hh
+
33
−
21
View file @
7036bb96
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
#include
<vector>
#include
<vector>
#include
<map>
#include
<map>
#include
<dune/geometry/referenceelements.hh>
#include
<dune/fufem/functionspacebases/p2nodalbasis.hh>
#include
<dune/fufem/functionspacebases/p2nodalbasis.hh>
#include
"localgeodesicfefunction.hh"
#include
"localgeodesicfefunction.hh"
...
@@ -94,6 +92,26 @@ void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& x)
...
@@ -94,6 +92,26 @@ void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& x)
}
}
/** \brief Coordinate function in one variable, constant in the others
This is used to extract the positions of the Lagrange nodes.
*/
template
<
int
dim
>
struct
CoordinateFunction
:
public
Dune
::
VirtualFunction
<
Dune
::
FieldVector
<
double
,
dim
>
,
Dune
::
FieldVector
<
double
,
1
>
>
{
CoordinateFunction
(
int
d
)
:
d_
(
d
)
{}
void
evaluate
(
const
Dune
::
FieldVector
<
double
,
dim
>&
x
,
Dune
::
FieldVector
<
double
,
1
>&
out
)
const
{
out
[
0
]
=
x
[
d_
];
}
//
int
d_
;
};
/** \brief Refine a grid globally and prolong a given geodesic finite element function
/** \brief Refine a grid globally and prolong a given geodesic finite element function
*/
*/
...
@@ -185,30 +203,24 @@ void higherOrderGFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& x)
...
@@ -185,30 +203,24 @@ void higherOrderGFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& x)
// The embedding of this element into the father geometry
// The embedding of this element into the father geometry
const
typename
GridType
::
template
Codim
<
0
>
::
LocalGeometry
&
geometryInFather
=
eIt
->
geometryInFather
();
const
typename
GridType
::
template
Codim
<
0
>
::
LocalGeometry
&
geometryInFather
=
eIt
->
geometryInFather
();
for
(
int
i
=
0
;
i
<
lfe
.
localCoefficients
().
size
();
i
++
)
{
// Generate position of the Lagrange nodes
std
::
vector
<
Dune
::
FieldVector
<
double
,
dim
>
>
lagrangeNodes
(
lfe
.
localBasis
().
size
());
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
{
CoordinateFunction
<
dim
>
lFunction
(
i
);
std
::
vector
<
Dune
::
FieldVector
<
double
,
1
>
>
coordinates
;
lfe
.
localInterpolation
().
interpolate
(
lFunction
,
coordinates
);
IdType
id
=
std
::
make_pair
(
idSet
.
subId
(
*
eIt
,
for
(
size_t
j
=
0
;
j
<
coordinates
.
size
();
j
++
)
lfe
.
localCoefficients
().
localKey
(
i
).
subEntity
(),
lagrangeNodes
[
j
][
i
]
=
coordinates
[
j
];
lfe
.
localCoefficients
().
localKey
(
i
).
codim
()),
lfe
.
localCoefficients
().
localKey
(
i
).
codim
());
unsigned
int
idx
=
p2Basis
.
index
(
*
eIt
,
i
);
if
(
dofMap
.
find
(
id
)
!=
dofMap
.
end
())
{
}
// If the vertex exists on the coarser level we take the value from there.
// That should be faster and more accurate than interpolating
x
[
idx
]
=
dofMap
[
id
];
}
else
{
for
(
int
i
=
0
;
i
<
lfe
.
localCoefficients
().
size
();
i
++
)
{
// Interpolate
unsigned
int
idx
=
p2Basis
.
index
(
*
eIt
,
i
);
const
Dune
::
GenericReferenceElement
<
double
,
dim
>&
refElement
=
Dune
::
GenericReferenceElements
<
double
,
dim
>::
general
(
eIt
->
type
());
const
Dune
::
FieldVector
<
double
,
dim
>&
pos
=
refElement
.
position
(
lfe
.
localCoefficients
().
localKey
(
i
).
subEntity
(),
lfe
.
localCoefficients
().
localKey
(
i
).
codim
());
x
[
idx
]
=
fatherFunction
.
evaluate
(
geometryInFather
.
global
(
pos
));
}
x
[
idx
]
=
fatherFunction
.
evaluate
(
geometryInFather
.
global
(
lagrangeNodes
[
i
]));
}
}
...
...
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