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
GitLab 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
46941251
Commit
46941251
authored
Mar 5, 2009
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
Mar 5, 2009
Browse files
Options
Downloads
Patches
Plain Diff
compile with current Dune
[[Imported from SVN: r10049]]
parent
bb21c2fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
linelast.cc
+1
-1
1 addition, 1 deletion
linelast.cc
nonlinelast.cc
+8
-8
8 additions, 8 deletions
nonlinelast.cc
viscoelast.cc
+24
-46
24 additions, 46 deletions
viscoelast.cc
with
33 additions
and
55 deletions
linelast.cc
+
1
−
1
View file @
46941251
...
...
@@ -244,7 +244,7 @@ int main (int argc, char *argv[]) try
// Output result
LeafAmiraMeshWriter
<
GridType
>
amiramesh
;
amiramesh
.
addLeafGrid
(
grid
,
true
);
amiramesh
.
addVertexData
(
x
,
grid
.
leaf
IndexSet
());
amiramesh
.
addVertexData
(
x
,
grid
.
leaf
View
());
amiramesh
.
write
(
"resultGrid"
);
}
catch
(
Exception
e
)
{
...
...
This diff is collapsed.
Click to expand it.
nonlinelast.cc
+
8
−
8
View file @
46941251
#include
<config.h>
#include
<dune/common/bit
field
.hh>
#include
<dune/common/bit
setvector
.hh>
#include
<dune/common/configparser.hh>
#include
<dune/grid/uggrid.hh>
...
...
@@ -83,13 +83,13 @@ int main (int argc, char *argv[]) try
PatchProlongator
<
GridType
>::
prolong
(
dirichletBoundary
);
std
::
vector
<
Bit
Field
>
dirichletNodes
(
numLevels
);
std
::
vector
<
Bit
SetVector
<
dim
>
>
dirichletNodes
(
numLevels
);
for
(
int
i
=
0
;
i
<
numLevels
;
i
++
)
{
dirichletNodes
[
i
].
resize
(
grid
.
size
(
i
,
dim
)
*
dim
);
dirichletNodes
[
i
].
resize
(
grid
.
size
(
i
,
dim
));
for
(
int
j
=
0
;
j
<
grid
.
size
(
i
,
dim
);
j
++
)
{
for
(
int
k
=
0
;
k
<
dim
;
k
++
)
dirichletNodes
[
i
][
j
*
dim
+
k
]
=
dirichletBoundary
[
i
].
containsVertex
(
j
);
dirichletNodes
[
i
][
j
][
k
]
=
dirichletBoundary
[
i
].
containsVertex
(
j
);
}
}
...
...
@@ -151,7 +151,7 @@ int main (int argc, char *argv[]) try
QuadraticIPOptSolver
<
OperatorType
,
VectorType
>
solver
;
solver
.
verbosity_
=
NumProc
::
QUIET
;
solver
.
dirichlet
Nodes_
=
&
dirichletNodes
[
maxlevel
];
solver
.
ignore
Nodes_
=
&
dirichletNodes
[
maxlevel
];
#elif defined GAUSS_SEIDEL
...
...
@@ -226,7 +226,7 @@ int main (int argc, char *argv[]) try
// Set new Dirichlet values in solution
for
(
int
j
=
0
;
j
<
x
.
size
();
j
++
)
for
(
int
k
=
0
;
k
<
dim
;
k
++
)
if
(
dirichletNodes
[
maxlevel
][
j
*
dim
+
k
])
if
(
dirichletNodes
[
maxlevel
][
j
][
k
])
x
[
j
][
k
]
=
scaledDirichlet
[
j
][
k
];
...
...
@@ -244,7 +244,7 @@ int main (int argc, char *argv[]) try
// Set new Dirichlet values in the right hand side
for
(
int
k
=
0
;
k
<
rhs
.
size
();
k
++
)
for
(
int
l
=
0
;
l
<
dim
;
l
++
)
if
(
dirichletNodes
[
maxlevel
][
k
*
dim
+
l
])
if
(
dirichletNodes
[
maxlevel
][
k
][
l
])
rhs
[
k
][
l
]
=
0
;
solver
.
setProblem
(
*
ogdenAssembler
.
matrix_
,
corr
,
rhs
);
...
...
@@ -277,7 +277,7 @@ int main (int argc, char *argv[]) try
// Output result
LeafAmiraMeshWriter
<
GridType
>
amiramesh
;
amiramesh
.
addLeafGrid
(
grid
,
true
);
amiramesh
.
addVertexData
(
x
,
grid
.
leaf
IndexSet
());
amiramesh
.
addVertexData
(
x
,
grid
.
leaf
View
());
amiramesh
.
write
(
"resultGrid"
,
true
);
}
catch
(
Exception
e
)
{
...
...
This diff is collapsed.
Click to expand it.
viscoelast.cc
+
24
−
46
View file @
46941251
#include
<config.h>
#include
<dune/common/bit
field
.hh>
#include
<dune/common/bit
setvector
.hh>
#include
<dune/common/configparser.hh>
#include
<dune/grid/uggrid.hh>
...
...
@@ -16,7 +16,7 @@
#include
<dune/ag-common/readbitfield.hh>
#include
<dune/ag-common/blockgsstep.hh>
#include
<dune/ag-common/multigridstep.hh>
#include
<dune/ag-common/multigridtransfer.hh>
#include
<dune/ag-common/
transferoperators/compressed
multigridtransfer.hh>
#include
<dune/ag-common/iterativesolver.hh>
#include
<dune/ag-common/computestress.hh>
#include
<dune/ag-common/neumannassembler.hh>
...
...
@@ -40,26 +40,6 @@
// The grid dimension
const
int
dim
=
3
;
// function which turns an integer into a string
//used for naming the different resultGrids of the timesteps
inline
std
::
string
int_to_string
(
int
x
){
int
j
=
x
;
int
k
=
(
int
)
floor
(
log10
(
j
));
std
::
string
s
=
""
;
int
p
;
char
c
;
for
(
int
i
=
0
;
i
<=
k
;
++
i
){
p
=
(
int
)
floor
(
j
/
pow
(
10
,
k
-
i
));
c
=
(
char
)
(
p
+
48
);
s
+=
c
;
j
-=
(
int
)
(
p
*
pow
(
10
,
k
-
i
));
}
return
s
;
}
using
namespace
Dune
;
...
...
@@ -131,11 +111,11 @@ int main (int argc, char *argv[]) try
// Read Dirichlet boundary values
std
::
vector
<
BitField
>
dirichletNodes
(
maxLevel
+
1
);
readBitField
(
dirichletNodes
[
0
],
grid
.
size
(
0
,
dim
),
path
+
dirichletFile
);
std
::
vector
<
BitSetVector
<
dim
>
>
dirichletNodes
(
maxLevel
+
1
);
std
::
vector
<
BoundaryPatch
<
GridType
>
>
dirichletBoundary
(
maxLevel
+
1
);
dirichletBoundary
[
0
].
setup
(
grid
,
0
,
dirichletNodes
[
0
]);
dirichletBoundary
[
0
].
setup
(
grid
,
0
);
readBoundaryPatch
(
dirichletBoundary
[
0
],
path
+
dirichletFile
);
std
::
vector
<
VectorType
>
dirichletValues
(
maxLevel
+
1
);
dirichletValues
[
0
].
resize
(
grid
.
size
(
0
,
dim
));
...
...
@@ -151,15 +131,15 @@ int main (int argc, char *argv[]) try
dirichletBoundaryAll[0].setup(grid, 0, dirichletNodesAll[0]);
*/
std
::
vector
<
Bit
Field
>
neumannNodes
(
maxLevel
+
1
);
std
::
vector
<
Bit
SetVector
<
dim
>
>
neumannNodes
(
maxLevel
+
1
);
std
::
vector
<
BoundaryPatch
<
GridType
>
>
neumannBoundary
(
maxLevel
+
1
);
std
::
vector
<
VectorType
>
neumannValues
(
maxLevel
+
1
);
//Read neumann boundary values
if
(
neumannBV
)
{
readBitField
(
neumannNodes
[
0
],
grid
.
size
(
0
,
dim
),
path
+
neumannFile
);
neumannBoundary
[
0
].
setup
(
grid
,
0
,
neumannNodes
[
0
]);
neumannBoundary
[
0
].
setup
(
grid
,
0
);
readBoundaryPatch
(
neumannBoundary
[
0
],
path
+
neumannFile
);
neumannValues
[
0
].
resize
(
grid
.
size
(
0
,
dim
));
AmiraMeshReader
<
int
>::
readFunction
(
neumannValues
[
0
],
path
+
neumannValuesFile
);
}
...
...
@@ -193,8 +173,7 @@ int main (int argc, char *argv[]) try
dirichletNodes
[
i
].
resize
(
grid
.
size
(
i
,
dim
)
*
dim
);
for
(
int
j
=
0
;
j
<
grid
.
size
(
i
,
dim
);
j
++
)
for
(
int
k
=
0
;
k
<
dim
;
k
++
)
dirichletNodes
[
i
][
j
*
dim
+
k
]
=
dirichletBoundary
[
i
].
containsVertex
(
j
);
dirichletNodes
[
i
][
j
]
=
dirichletBoundary
[
i
].
containsVertex
(
j
);
}
...
...
@@ -205,10 +184,10 @@ int main (int argc, char *argv[]) try
PatchProlongator
<
GridType
>::
prolong
(
neumannBoundary
);
for
(
int
i
=
0
;
i
<=
grid
.
maxLevel
();
i
++
)
{
neumannNodes
[
i
].
resize
(
grid
.
size
(
i
,
dim
)
*
dim
);
neumannNodes
[
i
].
resize
(
grid
.
size
(
i
,
dim
));
for
(
int
j
=
0
;
j
<
grid
.
size
(
i
,
dim
);
j
++
)
for
(
int
k
=
0
;
k
<
dim
;
k
++
)
neumannNodes
[
i
][
j
*
dim
+
k
]
=
neumannBoundary
[
i
].
containsVertex
(
j
);
neumannNodes
[
i
][
j
][
k
]
=
neumannBoundary
[
i
].
containsVertex
(
j
);
}
sampleOnBitField
(
grid
,
neumannValues
,
neumannNodes
);
...
...
@@ -229,7 +208,7 @@ int main (int argc, char *argv[]) try
for
(
int
i
=
0
;
i
<
rhs
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
dim
;
j
++
)
{
if
(
dirichletNodes
[
grid
.
maxLevel
()][
i
*
dim
+
j
])
if
(
dirichletNodes
[
grid
.
maxLevel
()][
i
][
j
])
x
[
i
][
j
]
=
dirichletValues
[
grid
.
maxLevel
()][
i
][
j
];
}
...
...
@@ -245,12 +224,6 @@ int main (int argc, char *argv[]) try
elasticbilinearForm
.
assemble
(
lstiff
,
u
,
f
);
//Assemble viscous part of the problem
//Needed?
*
u
=
0
;
*
f
=
0
;
LinearViscosityLocalStiffness
<
GridType
::
LeafGridView
,
double
>
vstiff
(
nu_shear
,
nu_bulk
);
LeafP1OperatorAssembler
<
GridType
,
double
,
dim
>
viscousbilinearForm
(
grid
);
viscousbilinearForm
.
assemble
(
vstiff
,
u
,
f
);
...
...
@@ -275,7 +248,7 @@ int main (int argc, char *argv[]) try
EnergyNorm
<
OperatorType
,
VectorType
>
baseEnergyNorm
(
baseSolverStep
);
Iterative
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
::
Loop
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
baseIt
,
baseTolerance
,
&
baseEnergyNorm
,
...
...
@@ -311,7 +284,7 @@ int main (int argc, char *argv[]) try
multigridStep
.
setMGType
(
1
,
nu1
,
nu2
);
multigridStep
.
dirichlet
Nodes_
=
&
dirichletNodes
;
multigridStep
.
ignore
Nodes_
=
&
dirichletNodes
.
back
()
;
multigridStep
.
basesolver_
=
&
baseSolver
;
multigridStep
.
presmoother_
=
&
presmoother
;
...
...
@@ -319,14 +292,14 @@ int main (int argc, char *argv[]) try
multigridStep
.
mgTransfer_
.
resize
(
grid
.
maxLevel
());
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
)
{
Multi
G
ridTransfer
<
VectorType
>*
newTransferOp
=
new
Multi
G
ridTransfer
<
VectorType
>
;
Compressed
Multi
g
ridTransfer
<
VectorType
>*
newTransferOp
=
new
Compressed
Multi
g
ridTransfer
<
VectorType
>
;
newTransferOp
->
setup
(
grid
,
i
,
i
+
1
);
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
}
EnergyNorm
<
OperatorType
,
VectorType
>
energyNorm
(
multigridStep
);
Iterative
Solver
<
VectorType
>
solver
(
&
multigridStep
,
::
Loop
Solver
<
VectorType
>
solver
(
&
multigridStep
,
numIt
,
tolerance
,
&
energyNorm
,
...
...
@@ -343,11 +316,16 @@ int main (int argc, char *argv[]) try
x
=
multigridStep
.
getSol
();
std
::
string
name
=
"resultGrid"
;
std
::
string
num
=
int_to_string
(
j
);
// make string from int (always four digits, with leading zeros)
std
::
stringstream
numberString
;
numberString
<<
std
::
setw
(
4
)
<<
std
::
setfill
(
'0'
)
<<
j
;
std
::
string
num
=
numberString
.
str
();
name
+=
num
;
LeafAmiraMeshWriter
<
GridType
>
amiramesh
;
amiramesh
.
addLeafGrid
(
grid
,
true
);
amiramesh
.
addVertexData
(
x
,
grid
.
leafView
()
,
true
);
amiramesh
.
addVertexData
(
x
,
grid
.
leafView
());
amiramesh
.
write
(
resultpath
+
name
,
1
);
...
...
@@ -363,7 +341,7 @@ int main (int argc, char *argv[]) try
std
::
string
namestress
=
"resultGridstress"
;
namestress
+=
num
;
Stress
<
GridType
,
dim
>::
getViscoelasticStress
(
grid
,
x
,
v
,
stress
,
E
,
nu
,
nu_bulk
,
nu_shear
);
LeafAmiraMeshWriter
<
GridType
>::
writeBlockVector
(
grid
,
stress
,
resultpath
+
namestress
,
true
);
LeafAmiraMeshWriter
<
GridType
>::
writeBlockVector
(
grid
,
stress
,
resultpath
+
namestress
);
...
...
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