Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
podlesny
dune-tectonic
Commits
317c39af
Commit
317c39af
authored
10 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Do everything on the leaf grid
parent
af00ac8c
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
src/sand-wedge.cc
+20
-20
20 additions, 20 deletions
src/sand-wedge.cc
with
20 additions
and
20 deletions
src/sand-wedge.cc
+
20
−
20
View file @
317c39af
...
...
@@ -111,10 +111,10 @@ int main(int argc, char *argv[]) {
auto
const
refinements
=
parset
.
get
<
size_t
>
(
"grid.refinements"
);
grid
->
globalRefine
(
refinements
);
size_t
const
fineVertexCount
=
grid
->
size
(
grid
->
maxLevel
(),
dims
);
using
GridView
=
Grid
::
LeafGridView
;
GridView
const
leafView
=
grid
->
leafView
();
size_t
const
leafVertexCount
=
leafView
.
size
(
dims
);
auto
myFaces
=
gridConstructor
.
constructFaces
(
leafView
);
...
...
@@ -123,18 +123,18 @@ int main(int argc, char *argv[]) {
// Frictional Boundary
BoundaryPatch
<
GridView
>
const
&
frictionalBoundary
=
myFaces
.
lower
;
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
fine
VertexCount
);
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
leaf
VertexCount
);
frictionalBoundary
.
getVertices
(
frictionalNodes
);
// Surface
BoundaryPatch
<
GridView
>
const
&
surface
=
myFaces
.
upper
;
Dune
::
BitSetVector
<
1
>
surfaceNodes
(
fine
VertexCount
);
Dune
::
BitSetVector
<
1
>
surfaceNodes
(
leaf
VertexCount
);
surface
.
getVertices
(
surfaceNodes
);
// Dirichlet Boundary
Dune
::
BitSetVector
<
dims
>
noNodes
(
fine
VertexCount
);
Dune
::
BitSetVector
<
dims
>
dirichletNodes
(
fine
VertexCount
);
for
(
size_t
i
=
0
;
i
<
fine
VertexCount
;
++
i
)
{
Dune
::
BitSetVector
<
dims
>
noNodes
(
leaf
VertexCount
);
Dune
::
BitSetVector
<
dims
>
dirichletNodes
(
leaf
VertexCount
);
for
(
size_t
i
=
0
;
i
<
leaf
VertexCount
;
++
i
)
{
if
(
myFaces
.
right
.
containsVertex
(
i
))
dirichletNodes
[
i
][
0
]
=
true
;
...
...
@@ -200,7 +200,7 @@ int main(int argc, char *argv[]) {
_relativeTime
);
_ell
+=
gravityFunctional
;
};
Vector
ell
(
fine
VertexCount
);
Vector
ell
(
leaf
VertexCount
);
computeExternalForces
(
0.0
,
ell
);
// {{{ Initial conditions
...
...
@@ -235,16 +235,16 @@ int main(int argc, char *argv[]) {
};
// Solve the stationary problem
Vector
u_initial
(
fine
VertexCount
);
Vector
u_initial
(
leaf
VertexCount
);
u_initial
=
0.0
;
solveLinearProblem
(
dirichletNodes
,
A
,
ell
,
u_initial
,
ANorm
,
parset
.
sub
(
"u0.solver"
));
Vector
ur_initial
(
fine
VertexCount
);
Vector
ur_initial
(
leaf
VertexCount
);
ur_initial
=
0.0
;
ScalarVector
alpha_initial
(
fine
VertexCount
);
ScalarVector
alpha_initial
(
leaf
VertexCount
);
alpha_initial
=
parset
.
get
<
double
>
(
"boundary.friction.initialAlpha"
);
ScalarVector
normalStress
(
fine
VertexCount
);
ScalarVector
normalStress
(
leaf
VertexCount
);
myAssembler
.
assembleNormalStress
(
frictionalBoundary
,
normalStress
,
body
.
getYoungModulus
(),
body
.
getPoissonRatio
(),
u_initial
);
...
...
@@ -254,21 +254,21 @@ int main(int argc, char *argv[]) {
frictionalBoundary
,
frictionInfo
,
normalStress
);
myGlobalFriction
->
updateAlpha
(
alpha_initial
);
Vector
v_initial
(
fine
VertexCount
);
Vector
v_initial
(
leaf
VertexCount
);
v_initial
=
0.0
;
{
double
v_initial_const
;
velocityDirichletFunction
.
evaluate
(
0.0
,
v_initial_const
);
assert
(
std
::
abs
(
v_initial_const
)
<
1e-14
);
}
Vector
vr_initial
(
fine
VertexCount
);
Vector
vr_initial
(
leaf
VertexCount
);
vr_initial
=
0.0
;
Vector
a_initial
(
fine
VertexCount
);
Vector
a_initial
(
leaf
VertexCount
);
a_initial
=
0.0
;
{
// We solve Ma = ell - [Au + Cv + Psi(v)]
Vector
accelerationRHS
(
fine
VertexCount
);
Vector
accelerationRHS
(
leaf
VertexCount
);
{
accelerationRHS
=
0.0
;
Arithmetic
::
addProduct
(
accelerationRHS
,
A
,
u_initial
);
...
...
@@ -283,7 +283,7 @@ int main(int argc, char *argv[]) {
}
// }}}
Vector
vertexCoordinates
(
fine
VertexCount
);
Vector
vertexCoordinates
(
leaf
VertexCount
);
{
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGVertexLayout
>
const
vertexMapper
(
leafView
);
...
...
@@ -354,8 +354,8 @@ int main(int argc, char *argv[]) {
parset
.
get
<
double
>
(
"boundary.friction.V0"
));
Vector
v
=
v_initial
;
Vector
v_m
(
fine
VertexCount
);
ScalarVector
alpha
(
fine
VertexCount
);
Vector
v_m
(
leaf
VertexCount
);
ScalarVector
alpha
(
leaf
VertexCount
);
auto
const
timeSteps
=
parset
.
get
<
size_t
>
(
"timeSteps.number"
),
maximumStateFPI
=
parset
.
get
<
size_t
>
(
"v.fpi.maximumIterations"
),
...
...
@@ -379,8 +379,8 @@ int main(int argc, char *argv[]) {
computeExternalForces
(
relativeTime
,
ell
);
Matrix
velocityMatrix
;
Vector
velocityRHS
(
fine
VertexCount
);
Vector
velocityIterate
(
fine
VertexCount
);
Vector
velocityRHS
(
leaf
VertexCount
);
Vector
velocityIterate
(
leaf
VertexCount
);
stateUpdater
->
setup
(
tau
);
timeSteppingScheme
->
setup
(
ell
,
tau
,
relativeTime
,
velocityRHS
,
...
...
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