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
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
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
agnumpde
dune-tectonic
Commits
4612a93a
Commit
4612a93a
authored
11 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Renaming vertex variables
parent
b4237a76
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/one-body-sample.cc
+22
-23
22 additions, 23 deletions
src/one-body-sample.cc
with
22 additions
and
23 deletions
src/one-body-sample.cc
+
22
−
23
View file @
4612a93a
...
...
@@ -193,7 +193,7 @@ int main(int argc, char *argv[]) {
auto
const
refinements
=
parset
.
get
<
size_t
>
(
"grid.refinements"
);
grid
->
globalRefine
(
refinements
);
size_t
const
fine
stSize
=
grid
->
size
(
grid
->
maxLevel
(),
dims
);
size_t
const
fine
VertexCount
=
grid
->
size
(
grid
->
maxLevel
(),
dims
);
using
GridView
=
GridType
::
LeafGridView
;
GridView
const
leafView
=
grid
->
leafView
();
...
...
@@ -208,23 +208,22 @@ int main(int argc, char *argv[]) {
Assembler
<
P1Basis
,
P1Basis
>
const
p1Assembler
(
p1Basis
,
p1Basis
);
// Set up the boundary
Dune
::
BitSetVector
<
dims
>
velocityDirichletNodes
(
fine
stSize
,
false
);
Dune
::
BitSetVector
<
dims
>
velocityDirichletNodes
(
fine
VertexCount
,
false
);
Dune
::
BitSetVector
<
dims
>
const
&
displacementDirichletNodes
=
velocityDirichletNodes
;
Dune
::
BitSetVector
<
dims
>
accelerationDirichletNodes
(
fine
stSize
,
false
);
Dune
::
BitSetVector
<
1
>
neumannNodes
(
fine
stSize
,
false
);
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
fine
stSize
,
false
);
Dune
::
BitSetVector
<
dims
>
accelerationDirichletNodes
(
fine
VertexCount
,
false
);
Dune
::
BitSetVector
<
1
>
neumannNodes
(
fine
VertexCount
,
false
);
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
fine
VertexCount
,
false
);
VectorType
c
oordinates
(
fine
stSize
);
VectorType
vertexC
oordinates
(
fine
VertexCount
);
{
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGVertexLayout
>
const
myVertexMapper
(
leafView
);
GridView
,
Dune
::
MCMGVertexLayout
>
const
vertexMapper
(
leafView
);
for
(
auto
it
=
leafView
.
begin
<
dims
>
();
it
!=
leafView
.
end
<
dims
>
();
++
it
)
{
assert
(
it
->
geometry
().
corners
()
==
1
);
size_t
const
id
=
myV
ertexMapper
.
map
(
*
it
);
c
oordinates
[
id
]
=
it
->
geometry
().
corner
(
0
);
auto
const
&
localCoordinates
=
c
oordinates
[
id
];
size_t
const
id
=
v
ertexMapper
.
map
(
*
it
);
vertexC
oordinates
[
id
]
=
it
->
geometry
().
corner
(
0
);
auto
const
&
localCoordinates
=
vertexC
oordinates
[
id
];
// lower face
if
(
localCoordinates
[
1
]
==
lowerLeft
[
1
])
{
...
...
@@ -350,11 +349,11 @@ int main(int argc, char *argv[]) {
neumannFunction
,
_relativeTime
);
_ell
+=
gravityFunctional
;
};
VectorType
ell
(
fine
stSize
);
VectorType
ell
(
fine
VertexCount
);
createRHS
(
0.0
,
ell
);
// {{{ Initial conditions
SingletonVectorType
alpha_initial
(
fine
stSize
);
SingletonVectorType
alpha_initial
(
fine
VertexCount
);
alpha_initial
=
std
::
log
(
parset
.
get
<
double
>
(
"boundary.friction.initialState"
));
...
...
@@ -365,7 +364,7 @@ int main(int argc, char *argv[]) {
ZeroNonlinearity
<
SmallVector
,
SmallMatrix
>
zeroNonlinearity
;
// Solve the stationary problem
VectorType
u_initial
(
fine
stSize
);
VectorType
u_initial
(
fine
VertexCount
);
u_initial
=
0.0
;
{
LinearFactoryType
displacementFactory
(
parset
.
sub
(
"solver.tnnmg"
),
// FIXME
...
...
@@ -389,7 +388,7 @@ int main(int argc, char *argv[]) {
initialDisplacementProblemSolver
.
preprocess
();
initialDisplacementProblemSolver
.
solve
();
}
VectorType
v_initial
(
fine
stSize
);
VectorType
v_initial
(
fine
VertexCount
);
v_initial
=
0.0
;
{
// Prescribe a homogeneous velocity field in the x-direction
...
...
@@ -400,13 +399,13 @@ int main(int argc, char *argv[]) {
for
(
auto
&
x
:
v_initial
)
x
[
0
]
=
v_initial_const
;
}
VectorType
a_initial
(
fine
stSize
);
VectorType
a_initial
(
fine
VertexCount
);
a_initial
=
0.0
;
{
/* We solve Au + Cv + Ma + Psi(v) = ell, thus
Ma = - (Au + Cv + Psi(v) - ell)
*/
VectorType
accelerationRHS
(
fine
stSize
);
VectorType
accelerationRHS
(
fine
VertexCount
);
{
accelerationRHS
=
0.0
;
Arithmetic
::
addProduct
(
accelerationRHS
,
A
,
u_initial
);
...
...
@@ -453,11 +452,11 @@ int main(int argc, char *argv[]) {
auto
multigridStep
=
factory
.
getSolver
();
{
std
::
fstream
c
oordinateWriter
(
"coordinates"
,
std
::
fstream
::
out
);
std
::
fstream
vertexC
oordinateWriter
(
"coordinates"
,
std
::
fstream
::
out
);
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
c
oordinateWriter
<<
c
oordinates
[
i
]
<<
std
::
endl
;
c
oordinateWriter
.
close
();
vertexC
oordinateWriter
<<
vertexC
oordinates
[
i
]
<<
std
::
endl
;
vertexC
oordinateWriter
.
close
();
}
std
::
fstream
iterationWriter
(
"iterations"
,
std
::
fstream
::
out
),
relaxationWriter
(
"relaxation"
,
std
::
fstream
::
out
);
...
...
@@ -471,7 +470,7 @@ int main(int argc, char *argv[]) {
alpha_initial
,
frictionalNodes
,
frictionData
);
VectorType
v
=
v_initial
;
SingletonVectorType
alpha
(
fine
stSize
);
SingletonVectorType
alpha
(
fine
VertexCount
);
auto
const
timesteps
=
parset
.
get
<
size_t
>
(
"timeSteps.number"
),
maximumStateFPI
=
parset
.
get
<
size_t
>
(
"v.fpi.maximumIterations"
),
...
...
@@ -497,8 +496,8 @@ int main(int argc, char *argv[]) {
createRHS
(
relativeTime
,
ell
);
MatrixType
velocityMatrix
;
VectorType
velocityRHS
(
fine
stSize
);
VectorType
velocityIterate
(
fine
stSize
);
VectorType
velocityRHS
(
fine
VertexCount
);
VectorType
velocityIterate
(
fine
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