Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-elasticity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
dune-elasticity
Commits
ef8ae0dc
Commit
ef8ae0dc
authored
5 years ago
by
oliver.sander_at_tu-dresden.de
Browse files
Options
Downloads
Patches
Plain Diff
First steps towards porting to the dune-functions bases
parent
eb67d8b5
Branches
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/linear-elasticity.cc
+15
-11
15 additions, 11 deletions
src/linear-elasticity.cc
with
15 additions
and
11 deletions
src/linear-elasticity.cc
+
15
−
11
View file @
ef8ae0dc
...
@@ -10,10 +10,10 @@
...
@@ -10,10 +10,10 @@
#include
<dune/istl/io.hh>
#include
<dune/istl/io.hh>
#include
<dune/functions/functionspacebases/lagrangebasis.hh>
#include
<dune/fufem/functiontools/gridfunctionadaptor.hh>
#include
<dune/fufem/functiontools/gridfunctionadaptor.hh>
#include
<dune/fufem/functions/coarsegridfunctionwrapper.hh>
#include
<dune/fufem/functions/coarsegridfunctionwrapper.hh>
#include
<dune/fufem/functionspacebases/p1nodalbasis.hh>
#include
<dune/fufem/functionspacebases/p2nodalbasis.hh>
#include
<dune/fufem/assemblers/operatorassembler.hh>
#include
<dune/fufem/assemblers/operatorassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include
<dune/fufem/sampleonbitfield.hh>
#include
<dune/fufem/sampleonbitfield.hh>
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include
<dune/fufem/readbitfield.hh>
#include
<dune/fufem/readbitfield.hh>
#include
<dune/fufem/estimators/fractionalmarking.hh>
#include
<dune/fufem/estimators/fractionalmarking.hh>
#include
<dune/fufem/estimators/hierarchicalestimator.hh>
#include
<dune/fufem/estimators/hierarchicalestimator.hh>
#include
<dune/fufem/functionspacebases/dunefunctionsbasis.hh>
#ifdef HAVE_IPOPT
#ifdef HAVE_IPOPT
#include
<dune/solvers/solvers/quadraticipopt.hh>
#include
<dune/solvers/solvers/quadraticipopt.hh>
...
@@ -138,8 +139,9 @@ int main (int argc, char *argv[]) try
...
@@ -138,8 +139,9 @@ int main (int argc, char *argv[]) try
while
(
true
)
{
while
(
true
)
{
typedef
P1NodalBasis
<
GridType
::
LeafGridView
,
double
>
P1Basis
;
using
P1Basis
=
Dune
::
Functions
::
LagrangeBasis
<
GridType
::
LeafGridView
,
1
>
;
P1Basis
p1NodalBasis
(
grid
->
leafGridView
());
using
FufemP1Basis
=
DuneFunctionsBasis
<
P1Basis
>
;
FufemP1Basis
p1NodalBasis
(
grid
->
leafGridView
());
// Determine fine Dirichlet and Neumann dofs
// Determine fine Dirichlet and Neumann dofs
LeafBoundaryPatch
leafDirichletBoundary
(
grid
->
leafGridView
());
LeafBoundaryPatch
leafDirichletBoundary
(
grid
->
leafGridView
());
...
@@ -172,16 +174,16 @@ int main (int argc, char *argv[]) try
...
@@ -172,16 +174,16 @@ int main (int argc, char *argv[]) try
}
}
// Assemble elasticity problem#
// Assemble elasticity problem#
OperatorAssembler
<
P1Basis
,
P1Basis
>
p1Assembler
(
p1NodalBasis
,
p1NodalBasis
);
OperatorAssembler
<
Fufem
P1Basis
,
Fufem
P1Basis
>
p1Assembler
(
p1NodalBasis
,
p1NodalBasis
);
StVenantKirchhoffAssembler
<
GridType
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
>
p1LocalAssembler
(
E
,
nu
);
StVenantKirchhoffAssembler
<
GridType
,
Fufem
P1Basis
::
LocalFiniteElement
,
Fufem
P1Basis
::
LocalFiniteElement
>
p1LocalAssembler
(
E
,
nu
);
OperatorType
stiffnessMatrix
;
OperatorType
stiffnessMatrix
;
p1Assembler
.
assemble
(
p1LocalAssembler
,
stiffnessMatrix
);
p1Assembler
.
assemble
(
p1LocalAssembler
,
stiffnessMatrix
);
// Assemble Neumann forces
// Assemble Neumann forces
BoundaryFunctionalAssembler
<
P1Basis
>
boundaryFunctionalAssembler
(
p1NodalBasis
,
leafNeumannBoundary
);
BoundaryFunctionalAssembler
<
Fufem
P1Basis
>
boundaryFunctionalAssembler
(
p1NodalBasis
,
leafNeumannBoundary
);
BasisGridFunction
<
P1Basis
,
VectorType
>
neumannFunction
(
p1NodalBasis
,
neumannValues
);
BasisGridFunction
<
Fufem
P1Basis
,
VectorType
>
neumannFunction
(
p1NodalBasis
,
neumannValues
);
NeumannBoundaryAssembler
<
GridType
,
Dune
::
FieldVector
<
double
,
3
>
>
localNeumannAssembler
(
neumannFunction
);
NeumannBoundaryAssembler
<
GridType
,
Dune
::
FieldVector
<
double
,
3
>
>
localNeumannAssembler
(
neumannFunction
);
boundaryFunctionalAssembler
.
assemble
(
localNeumannAssembler
,
rhs
);
boundaryFunctionalAssembler
.
assemble
(
localNeumannAssembler
,
rhs
);
...
@@ -260,11 +262,13 @@ int main (int argc, char *argv[]) try
...
@@ -260,11 +262,13 @@ int main (int argc, char *argv[]) try
// Estimate error and refine grid
// Estimate error and refine grid
// /////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////
HierarchicalEstimator
<
P2NodalBasis
<
GridType
::
LeafGridView
>
,
dim
>
estimator
(
*
grid
);
using
P2Basis
=
Dune
::
Functions
::
LagrangeBasis
<
GridType
::
LeafGridView
,
2
>
;
using
FufemP2NodalBasis
=
DuneFunctionsBasis
<
P2Basis
>
;
HierarchicalEstimator
<
FufemP2NodalBasis
,
dim
>
estimator
(
*
grid
);
RefinementIndicator
<
GridType
>
indicator
(
*
grid
);
RefinementIndicator
<
GridType
>
indicator
(
*
grid
);
typedef
P2NodalBasis
<
GridType
::
LeafGridView
>
::
LocalFiniteElement
P2FiniteElement
;
typedef
Fufem
P2NodalBasis
::
LocalFiniteElement
P2FiniteElement
;
StVenantKirchhoffAssembler
<
GridType
,
P2FiniteElement
,
P2FiniteElement
>*
localStiffness
=
new
StVenantKirchhoffAssembler
<
GridType
,
P2FiniteElement
,
P2FiniteElement
>
(
E
,
nu
);
StVenantKirchhoffAssembler
<
GridType
,
P2FiniteElement
,
P2FiniteElement
>*
localStiffness
=
new
StVenantKirchhoffAssembler
<
GridType
,
P2FiniteElement
,
P2FiniteElement
>
(
E
,
nu
);
...
@@ -278,7 +282,7 @@ int main (int argc, char *argv[]) try
...
@@ -278,7 +282,7 @@ int main (int argc, char *argv[]) try
// Refine grid
// Refine grid
// ////////////////////////////////////////////////////
// ////////////////////////////////////////////////////
GridFunctionAdaptor
<
P1Basis
>
adaptorP1
(
p1NodalBasis
,
true
,
true
);
GridFunctionAdaptor
<
Fufem
P1Basis
>
adaptorP1
(
p1NodalBasis
,
true
,
true
);
grid
->
preAdapt
();
grid
->
preAdapt
();
grid
->
adapt
();
grid
->
adapt
();
...
...
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