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
2ea7dd7d
Commit
2ea7dd7d
authored
1 month ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
SimoFoxEnergy: Take GFE function as a tuple
This is what the other energies do.
parent
e794a07f
No related branches found
Branches containing commit
No related tags found
1 merge request
!181
Improve handling of local functions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gfe/assemblers/simofoxenergy.hh
+17
-16
17 additions, 16 deletions
dune/gfe/assemblers/simofoxenergy.hh
src/simofoxshell.cc
+14
-6
14 additions, 6 deletions
src/simofoxshell.cc
with
31 additions
and
22 deletions
dune/gfe/assemblers/simofoxenergy.hh
+
17
−
16
View file @
2ea7dd7d
...
...
@@ -48,7 +48,7 @@ namespace Dune::GFE
* \tparam LocalFEFunction Decides which interpolation function is used for the interpolation of the midsurface
* and director field.
*/
template
<
class
Basis
,
t
emplate
<
typename
,
typename
>
typename
LocalFEFunction
,
typename
field_type
=
double
>
template
<
class
Basis
,
t
ypename
LocalFEFunction
,
typename
Reference
Local
G
FEFunction
,
typename
field_type
=
double
>
class
SimoFoxEnergy
:
public
LocalEnergy
<
Basis
,
ProductManifold
<
RealTuple
<
field_type
,
3
>
,
UnitVector
<
field_type
,
3
>
>
>
...
...
@@ -163,8 +163,8 @@ namespace Dune::GFE
* b is similar to the second fundamental form of the surface, but the unit normal is replaced with the shell director
* gamma_1 and gamma_2 are the transverse shear in the two parametric directions
* Paper Equation 4.10 */
template
<
class
Basis
,
t
emplate
<
typename
,
typename
>
typename
LocalFEFunction
,
typename
field_type
>
Dune
::
FieldVector
<
field_type
,
8
>
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
field_type
>::
calculateGreenLagrangianStrains
(
template
<
class
Basis
,
t
ypename
LocalFEFunction
,
typename
Reference
Local
G
FEFunction
,
typename
field_type
>
Dune
::
FieldVector
<
field_type
,
8
>
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
ReferenceLocalGFEFunction
,
field_type
>::
calculateGreenLagrangianStrains
(
const
KinematicVariables
&
kin
)
{
Dune
::
FieldVector
<
RT
,
8
>
egl
;
...
...
@@ -190,10 +190,10 @@ namespace Dune::GFE
*
* Paper Equations 6.4 - 6.8
*/
template
<
class
Basis
,
t
emplate
<
typename
,
typename
>
typename
LocalFEFunction
,
typename
field_type
>
template
<
class
Basis
,
t
ypename
LocalFEFunction
,
typename
Reference
Local
G
FEFunction
,
typename
field_type
>
template
<
typename
Element
,
typename
LocalDirectorFunction
,
typename
LocalMidSurfaceFunction
,
typename
LocalDirectorReferenceFunction
,
typename
LocalMidSurfaceReferenceFunction
,
typename
IntegrationPointPosition
>
auto
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
field_type
>::
kinematicVariablesFactory
(
auto
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
ReferenceLocalGFEFunction
,
field_type
>::
kinematicVariablesFactory
(
const
Element
&
element
,
const
LocalDirectorFunction
&
directorFunction
,
const
LocalDirectorReferenceFunction
&
directorReferenceFunction
,
const
LocalMidSurfaceFunction
&
midSurfaceFunction
,
const
LocalMidSurfaceReferenceFunction
&
midSurfaceReferenceFunction
,
const
LocalMidSurfaceFunction
&
midSurfaceDisplacementFunction
,
const
IntegrationPointPosition
&
quadPos
)
...
...
@@ -213,8 +213,8 @@ namespace Dune::GFE
return
kin
;
}
template
<
class
Basis
,
t
emplate
<
typename
,
typename
>
typename
LocalFEFunction
,
typename
field_type
>
auto
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
field_type
>::
getReferenceLocalConfigurations
(
template
<
class
Basis
,
t
ypename
LocalFEFunction
,
typename
Reference
Local
G
FEFunction
,
typename
field_type
>
auto
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
ReferenceLocalGFEFunction
,
field_type
>::
getReferenceLocalConfigurations
(
const
typename
Basis
::
LocalView
&
localView
)
const
{
using
namespace
Dune
::
Indices
;
const
int
nDofs0
=
localView
.
tree
().
child
(
_0
,
0
).
finiteElement
().
size
();
...
...
@@ -251,9 +251,9 @@ namespace Dune::GFE
* E are the components of the Green-Lagrangian strains [membrane strains, bending, transverse shear]
* see for details Paper Equation 4.11,4.10 and 10.1
*/
template
<
class
Basis
,
t
emplate
<
typename
,
typename
>
typename
LocalFEFunction
,
typename
field_type
>
typename
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
field_type
>::
RT
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
field_type
>::
energy
(
template
<
class
Basis
,
t
ypename
LocalFEFunction
,
typename
Reference
Local
G
FEFunction
,
typename
field_type
>
typename
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
ReferenceLocalGFEFunction
,
field_type
>::
RT
SimoFoxEnergy
<
Basis
,
LocalFEFunction
,
ReferenceLocalGFEFunction
,
field_type
>::
energy
(
const
typename
Basis
::
LocalView
&
localView
,
const
typename
Impl
::
LocalEnergyTypes
<
TargetSpace
>::
CompositeCoefficients
&
localConfiguration
)
const
{
...
...
@@ -274,17 +274,18 @@ namespace Dune::GFE
displacements
.
emplace_back
(
localMidSurfaceConfiguration
[
i
].
globalCoordinates
()
-
localRefMidSurfaceConfiguration
[
i
].
globalCoordinates
());
// The local finite element type used for midsurface position and displacement interpolation
const
auto
midSurfaceBasis
=
Functions
::
subspaceBasis
(
localView
.
globalBasis
(),
_0
,
0
);
const
auto
directorBasis
=
Functions
::
subspaceBasis
(
localView
.
globalBasis
(),
_1
,
0
);
// TODO: Do not hard-wire the order here!
Functions
::
LagrangeBasis
<
GridView
,
1
>
midSurfaceBasis
(
localView
.
globalBasis
().
gridView
());
Functions
::
LagrangeBasis
<
GridView
,
1
>
directorBasis
(
localView
.
globalBasis
().
gridView
());
// The local finite element function type to evaluate the midsurface position
using
LocalMidSurfaceFunctionType
=
LocalFEFunction
<
decltype
(
midSurfaceBasis
),
RealTuple
<
field_type
,
3
>
>
;
using
LocalMidSurfaceFunctionType
=
std
::
tuple_element_t
<
0
,
LocalFEFunction
>
;
// The local finite element function type to evaluate the director
using
LocalDirectorFunctionType
=
LocalFEFunction
<
decltype
(
directorBasis
),
UnitVector
<
field_type
,
3
>
>
;
using
LocalDirectorFunctionType
=
std
::
tuple_element_t
<
1
,
LocalFEFunction
>
;
// Extra function type for reference quantities since they are unconditionally doubles, i.e. no ADOL-C types
using
LocalMidSurfaceReferenceFunctionType
=
LocalFEFunction
<
decltype
(
midSurfaceBasis
),
RealTuple
<
double
,
3
>
>
;
using
LocalDirectorReferenceFunctionType
=
LocalFEFunction
<
decltype
(
directorBasis
),
UnitVector
<
double
,
3
>
>
;
using
LocalMidSurfaceReferenceFunctionType
=
std
::
tuple_element_t
<
0
,
Reference
Local
G
FEFunction
>
;
using
LocalDirectorReferenceFunctionType
=
std
::
tuple_element_t
<
1
,
Reference
Local
G
FEFunction
>
;
LocalMidSurfaceFunctionType
localMidSurfaceFunction
(
midSurfaceBasis
);
LocalMidSurfaceFunctionType
localMidSurfaceDisplacementFunction
(
midSurfaceBasis
);
...
...
This diff is collapsed.
Click to expand it.
src/simofoxshell.cc
+
14
−
6
View file @
2ea7dd7d
...
...
@@ -30,7 +30,6 @@
#include
<dune/gfe/assemblers/mixedgfeassembler.hh>
#include
<dune/gfe/assemblers/sumenergy.hh>
#include
<dune/gfe/functions/embeddedglobalgfefunction.hh>
#include
<dune/gfe/functions/localgeodesicfefunction.hh>
#include
<dune/gfe/functions/localprojectedfefunction.hh>
#include
<dune/gfe/mixedriemanniantrsolver.hh>
#include
<dune/gfe/neumannenergy.hh>
...
...
@@ -44,10 +43,6 @@
#include
<dune/vtk/vtkreader.hh>
template
<
class
Basis
,
class
TS
>
using
LocalFEFunction
=
Dune
::
GFE
::
LocalProjectedFEFunction
<
Basis
,
TS
>
;
//using LocalFEFunction = LocalGeodesicFEFunction<Basis,TS>;
// Order of the approximation space for the midsurface position
const
int
midsurfaceOrder
=
1
;
...
...
@@ -321,10 +316,23 @@ int main(int argc, char *argv[]) try
// The total energy on one element
auto
sumEnergy
=
std
::
make_shared
<
GFE
::
SumEnergy
<
decltype
(
compositeBasis
),
GFE
::
RealTuple
<
adouble
,
3
>
,
GFE
::
UnitVector
<
adouble
,
3
>
>
>
();
// Select which type of geometric interpolation to use
using
LocalMidsurfaceInterpolationRule
=
GFE
::
LocalProjectedFEFunction
<
decltype
(
midsurfaceFEBasis
),
GFE
::
RealTuple
<
double
,
3
>
>
;
using
LocalDirectorInterpolationRule
=
GFE
::
LocalProjectedFEFunction
<
decltype
(
directorFEBasis
),
GFE
::
UnitVector
<
double
,
3
>
>
;
std
::
tuple
referenceLocalGFEFunction
{
LocalMidsurfaceInterpolationRule
(
midsurfaceFEBasis
),
LocalDirectorInterpolationRule
(
directorFEBasis
)};
using
LocalMidsurfaceInterpolationRuleA
=
GFE
::
LocalProjectedFEFunction
<
decltype
(
midsurfaceFEBasis
),
GFE
::
RealTuple
<
adouble
,
3
>
>
;
using
LocalDirectorInterpolationRuleA
=
GFE
::
LocalProjectedFEFunction
<
decltype
(
directorFEBasis
),
GFE
::
UnitVector
<
adouble
,
3
>
>
;
std
::
tuple
localGFEFunction
{
LocalMidsurfaceInterpolationRuleA
(
midsurfaceFEBasis
),
LocalDirectorInterpolationRuleA
(
directorFEBasis
)};
// Internal energy of the shell
auto
simoFoxEnergy
=
std
::
make_shared
<
GFE
::
SimoFoxEnergy
<
decltype
(
compositeBasis
),
LocalFEFunction
,
decltype
(
localGFEFunction
),
decltype
(
reference
Local
G
FEFunction
)
,
adouble
>
>
(
materialParameters
,
x0
);
sumEnergy
->
addLocalEnergy
(
simoFoxEnergy
);
...
...
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