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
ce6d8778
Commit
ce6d8778
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
complete implementation, not tested beyond compilation yet, though
[[Imported from SVN: r4059]]
parent
57edb168
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/harmonicenergystiffness.hh
+28
-16
28 additions, 16 deletions
src/harmonicenergystiffness.hh
with
28 additions
and
16 deletions
src/harmonicenergystiffness.hh
+
28
−
16
View file @
ce6d8778
#ifndef HARMONIC_ENERGY_LOCAL_STIFFNESS_HH
#ifndef HARMONIC_ENERGY_LOCAL_STIFFNESS_HH
#define HARMONIC_ENERGY_LOCAL_STIFFNESS_HH
#define HARMONIC_ENERGY_LOCAL_STIFFNESS_HH
#include
<dune/istl/bcrsmatrix.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/istl/matrixindexset.hh>
#include
<dune/grid/common/quadraturerules.hh>
#include
<dune/istl/matrix.hh>
#include
<dune/disc/operators/localstiffness.hh>
#include
"localgeodesicfestiffness.hh"
#include
"localgeodesicfefunction.hh"
template
<
class
GridView
,
class
TargetSpace
>
template
<
class
GridView
,
class
TargetSpace
>
class
HarmonicEnergyLocalStiffness
class
HarmonicEnergyLocalStiffness
:
public
Dune
::
LocalGeodesicFEStiffness
<
GridView
,
TargetSpace
>
:
public
LocalGeodesicFEStiffness
<
GridView
,
TargetSpace
>
{
{
// grid types
// grid types
typedef
typename
GridView
::
Grid
::
ctype
DT
;
typedef
typename
GridView
::
Grid
::
ctype
DT
;
typedef
typename
TargetSpace
::
ctype
RT
;
typedef
typename
GridView
::
template
Codim
<
0
>
::
Entity
Entity
;
typedef
typename
GridView
::
template
Codim
<
0
>
::
Entity
Entity
;
// some other sizes
// some other sizes
...
@@ -23,14 +24,18 @@ public:
...
@@ -23,14 +24,18 @@ public:
//! Dimension of a tangent space
//! Dimension of a tangent space
enum
{
blocksize
=
TargetSpace
::
TangentVector
::
size
};
enum
{
blocksize
=
TargetSpace
::
TangentVector
::
size
};
#if 0
// types for matrics, vectors and boundary conditions
// types for matrics, vectors and boundary conditions
typedef Dune::FieldMatrix<RT,m,m> MBlockType; // one entry in the stiffness matrix
typedef Dune::FieldMatrix<RT,m,m> MBlockType; // one entry in the stiffness matrix
typedef Dune::FieldVector<RT,m> VBlockType; // one entry in the global vectors
typedef Dune::FieldVector<RT,m> VBlockType; // one entry in the global vectors
typedef Dune::array<Dune::BoundaryConditions::Flags,m> BCBlockType; // componentwise boundary conditions
typedef Dune::array<Dune::BoundaryConditions::Flags,m> BCBlockType; // componentwise boundary conditions
#endif
#if 0
//! Default Constructor
//! Default Constructor
HarmonicEnergyLocalStiffness ()
HarmonicEnergyLocalStiffness ()
{}
{}
#endif
/** \brief Assemble the energy for a single element */
/** \brief Assemble the energy for a single element */
RT
energy
(
const
Entity
&
e
,
RT
energy
(
const
Entity
&
e
,
...
@@ -38,19 +43,19 @@ public:
...
@@ -38,19 +43,19 @@ public:
};
};
template
<
class
Grid
Type
,
class
R
T
>
template
<
class
Grid
View
,
class
T
argetSpace
>
RT
RodLocalStiffness
<
GridType
,
RT
>::
typename
HarmonicEnergyLocalStiffness
<
GridView
,
TargetSpace
>::
RT
HarmonicEnergyLocalStiffness
<
GridView
,
TargetSpace
>::
energy
(
const
Entity
&
element
,
energy
(
const
Entity
&
element
,
const
Dune
::
array
<
RigidBodyMotion
<
3
>
,
2
>&
localSolution
)
const
const
std
::
vector
<
TargetSpace
>&
localSolution
)
const
{
{
RT
energy
=
0
;
RT
energy
=
0
;
assert
(
element
.
type
().
isSimplex
()
);
LocalGeodesicFEFunction
<
gridDim
,
double
,
TargetSpace
>
localGeodesicFEFunction
(
element
.
type
(),
localSolution
);
int
quadOrder
=
gridDim
;
int
quadOrder
=
gridDim
;
const
Dune
::
QuadratureRule
<
double
,
1
>&
quad
const
Dune
::
QuadratureRule
<
double
,
gridDim
>&
quad
=
Dune
::
QuadratureRules
<
double
,
1
>::
rule
(
element
.
type
(),
quadOrder
);
=
Dune
::
QuadratureRules
<
double
,
gridDim
>::
rule
(
element
.
type
(),
quadOrder
);
for
(
size_t
pt
=
0
;
pt
<
quad
.
size
();
pt
++
)
{
for
(
size_t
pt
=
0
;
pt
<
quad
.
size
();
pt
++
)
{
...
@@ -58,17 +63,24 @@ energy(const Entity& element,
...
@@ -58,17 +63,24 @@ energy(const Entity& element,
const
Dune
::
FieldVector
<
double
,
gridDim
>&
quadPos
=
quad
[
pt
].
position
();
const
Dune
::
FieldVector
<
double
,
gridDim
>&
quadPos
=
quad
[
pt
].
position
();
const
double
integrationElement
=
element
.
geometry
().
integrationElement
(
quadPos
);
const
double
integrationElement
=
element
.
geometry
().
integrationElement
(
quadPos
);
const
Dune
::
FieldMatrix
<
double
,
gridDim
,
gridDim
>&
jacobianInverseTransposed
=
element
.
geometry
().
jacobianInverseTransposed
(
quadPos
);
double
weight
=
quad
[
pt
].
weight
()
*
integrationElement
;
double
weight
=
quad
[
pt
].
weight
()
*
integrationElement
;
for
(
int
comp
=
0
;
comp
<
4
;
comp
++
)
{
// The derivative of the local function defined on the reference element
Dune
::
FieldMatrix
<
double
,
TargetSpace
::
EmbeddedTangentVector
::
size
,
gridDim
>
referenceDerivative
=
localGeodesicFEFunction
.
evaluateDerivative
(
quadPos
);
// The derivative of the function defined on the actual element
Dune
::
FieldMatrix
<
double
,
TargetSpace
::
EmbeddedTangentVector
::
size
,
gridDim
>
derivative
(
0
);
for
(
int
dir
=
0
;
dir
<
gridDim
;
dir
++
)
{
for
(
int
comp
=
0
;
comp
<
4
;
comp
++
)
jacobianInverseTransposed
.
umv
(
referenceDerivative
[
comp
],
derivative
[
comp
]);
double
derivative
=
localGeodesicFunction
.
evaluateDerivative
(
comp
,
dir
);
for
(
int
comp
=
0
;
comp
<
4
;
comp
++
)
{
energy
+=
weight
*
derivative
*
derivative
;
}
for
(
int
dir
=
0
;
dir
<
gridDim
;
dir
++
)
energy
+=
weight
*
derivative
[
comp
][
dir
]
*
derivative
[
comp
][
dir
];
}
}
...
...
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