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
431163b5
Commit
431163b5
authored
11 years ago
by
Elias Pipping
Committed by
Elias Pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Rename: stiffnessMatrix, massMatrix -> A, M
parent
639e0bd9
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/one-body-sample.cc
+19
-21
19 additions, 21 deletions
src/one-body-sample.cc
with
19 additions
and
21 deletions
src/one-body-sample.cc
+
19
−
21
View file @
431163b5
...
...
@@ -261,8 +261,8 @@ int main(int argc, char *argv[]) {
// Set up normal stress, mass matrix, and gravity functional
double
normalStress
;
MatrixType
massMatrix
;
EnergyNorm
<
MatrixType
,
VectorType
>
const
massMatrixNorm
(
massMatrix
);
MatrixType
M
;
EnergyNorm
<
MatrixType
,
VectorType
>
const
MNorm
(
M
);
VectorType
gravityFunctional
;
{
double
const
gravity
=
9.81
;
...
...
@@ -271,8 +271,8 @@ int main(int argc, char *argv[]) {
MassAssembler
<
GridType
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
,
Dune
::
ScaledIdentityMatrix
<
double
,
dims
>>
const
localMass
;
p1Assembler
.
assembleOperator
(
localMass
,
massMatrix
);
massMatrix
*=
density
;
p1Assembler
.
assembleOperator
(
localMass
,
M
);
M
*=
density
;
}
{
double
volume
=
1.0
;
...
...
@@ -303,14 +303,13 @@ int main(int argc, char *argv[]) {
FrictionData
const
frictionData
(
parset
.
sub
(
"boundary.friction"
),
normalStress
);
MatrixType
stiffnessMatrix
;
EnergyNorm
<
MatrixType
,
VectorType
>
const
stiffnessMatrixNorm
(
stiffnessMatrix
);
MatrixType
A
;
EnergyNorm
<
MatrixType
,
VectorType
>
const
ANorm
(
A
);
{
StVenantKirchhoffAssembler
<
GridType
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
>
const
localStiffness
(
E
,
nu
);
p1Assembler
.
assembleOperator
(
localStiffness
,
stiffnessMatrix
);
p1Assembler
.
assembleOperator
(
localStiffness
,
A
);
}
SingletonMatrixType
frictionalBoundaryMassMatrix
;
...
...
@@ -328,8 +327,7 @@ int main(int argc, char *argv[]) {
frictionalBoundaryMassMatrix
);
}
// Q: Does it make sense to weigh them in this manner?
SumNorm
<
VectorType
>
const
velocityEnergyNorm
(
1.0
,
stiffnessMatrixNorm
,
1.0
,
massMatrixNorm
);
SumNorm
<
VectorType
>
const
velocityEnergyNorm
(
1.0
,
ANorm
,
1.0
,
MNorm
);
auto
const
nodalIntegrals
=
assemble_frictional
<
GridView
,
SmallVector
>
(
leafView
,
p1Assembler
,
frictionalNodes
);
...
...
@@ -370,7 +368,7 @@ int main(int argc, char *argv[]) {
VectorType
problem_rhs_initial
(
finestSize
);
{
problem_rhs_initial
=
0.0
;
Arithmetic
::
addProduct
(
problem_rhs_initial
,
stiffnessMatrix
,
u_initial
);
Arithmetic
::
addProduct
(
problem_rhs_initial
,
A
,
u_initial
);
myGlobalNonlinearity
->
updateState
(
alpha_initial
);
// NOTE: We assume differentiability of Psi at v0 here!
myGlobalNonlinearity
->
addGradient
(
v_initial
,
problem_rhs_initial
);
...
...
@@ -379,13 +377,13 @@ int main(int argc, char *argv[]) {
problem_rhs_initial
*=
-
1.0
;
}
BlockGSStep
<
MatrixType
,
VectorType
>
accelerationSolverStep
(
massMatrix
,
a_initial
,
problem_rhs_initial
);
M
,
a_initial
,
problem_rhs_initial
);
accelerationSolverStep
.
ignoreNodes_
=
&
noNodes
;
LoopSolver
<
VectorType
>
accelerationSolver
(
&
accelerationSolverStep
,
100000
,
// FIXME
1e-12
,
// FIXME
&
massMatrix
Norm
,
Solver
::
FULL
,
// FIXME
false
);
// absolute error
LoopSolver
<
VectorType
>
accelerationSolver
(
&
accelerationSolverStep
,
100000
,
// FIXME
1e-12
,
// FIXME
&
M
Norm
,
Solver
::
FULL
,
// FIXME
false
);
// absolute error
accelerationSolver
.
solve
();
}
// }}}
...
...
@@ -413,10 +411,10 @@ int main(int argc, char *argv[]) {
std
::
fstream
iterationWriter
(
"iterations"
,
std
::
fstream
::
out
);
std
::
fstream
dampingWriter
(
"damping"
,
std
::
fstream
::
out
);
auto
timeSteppingScheme
=
initTimeStepper
(
parset
.
get
<
Config
::
scheme
>
(
"timeSteppingScheme"
),
velocityDirichletFunction
,
velocityDirichletNodes
,
massMatrix
,
stiffnessMatrix
,
u_initial
,
v_initial
,
a_initial
);
auto
timeSteppingScheme
=
initTimeStepper
(
parset
.
get
<
Config
::
scheme
>
(
"timeSteppingScheme"
),
velocityDirichletFunction
,
velocityDirichletNodes
,
M
,
A
,
u_initial
,
v_initial
,
a_initial
);
auto
stateUpdater
=
initStateUpdater
<
SingletonVectorType
,
VectorType
>
(
parset
.
get
<
Config
::
state_model
>
(
"boundary.friction.state_model"
),
alpha_initial
,
frictionalNodes
,
frictionData
);
...
...
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