Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
fufem
dune-fufem
Commits
66faabf3
Commit
66faabf3
authored
1 month ago
by
Carsten Gräser
Browse files
Options
Downloads
Patches
Plain Diff
[examples] Add skeleton for nested iteration to adaptive example
parent
231e843a
No related branches found
No related tags found
1 merge request
!258
Add constraints support for dune-functions basis
Pipeline
#77067
failed
1 month ago
Stage: .pre
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/poisson-adaptive.cc
+12
-2
12 additions, 2 deletions
examples/poisson-adaptive.cc
with
12 additions
and
2 deletions
examples/poisson-adaptive.cc
+
12
−
2
View file @
66faabf3
...
...
@@ -262,6 +262,9 @@ int main (int argc, char *argv[]) try
// Discretize -> solve -> estimate -> mark -> refine
using
Vector
=
Dune
::
BlockVector
<
double
>
;
auto
sol_initial
=
Vector
();
std
::
size_t
refinementStep
=
0
;
while
(
true
)
{
...
...
@@ -344,8 +347,13 @@ int main (int argc, char *argv[]) try
// Initialize solution vector
// *********************************************
Dune
::
Functions
::
istlVectorBackend
(
sol
).
resize
(
basis
);
Dune
::
Functions
::
istlVectorBackend
(
sol
)
=
0
;
// For simplicity use zero as initial value.
// Here we could use an adapted solution from
// the previous grid as initial value.
Dune
::
Functions
::
istlVectorBackend
(
sol_initial
).
resize
(
basis
);
Dune
::
Functions
::
istlVectorBackend
(
sol_initial
)
=
0
;
sol
=
sol_initial
;
// *********************************************
// Solve linear system
...
...
@@ -441,6 +449,7 @@ int main (int argc, char *argv[]) try
// *********************************************
{
auto
u_initial
=
bindToCoefficients
(
trialFunction
(
basis
),
sol_initial
);
auto
d
=
bindToCoefficients
(
trialFunction
(
extensionBasis
),
defect
);
#if DUNE_VERSION_GT(DUNE_VTK, 2, 9)
using
Dune
::
Vtk
::
LagrangeDataCollector
;
...
...
@@ -448,6 +457,7 @@ int main (int argc, char *argv[]) try
using
Dune
::
VTK
::
FieldInfo
;
auto
vtkWriter
=
UnstructuredGridWriter
(
LagrangeDataCollector
(
basis
.
gridView
(),
extensionOrder
));
vtkWriter
.
addPointData
(
u
,
FieldInfo
(
"sol"
,
FieldInfo
::
Type
::
scalar
,
1
));
vtkWriter
.
addPointData
(
u_initial
,
FieldInfo
(
"sol_initial"
,
FieldInfo
::
Type
::
scalar
,
1
));
vtkWriter
.
addPointData
(
d
,
FieldInfo
(
"defect"
,
FieldInfo
::
Type
::
scalar
,
1
));
vtkWriter
.
write
(
Dune
::
formatString
(
"poisson-adaptive-%03d"
,
refinementStep
));
#else
...
...
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