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
0ad38afb
Commit
0ad38afb
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement the L^2(Gamma_F) norm for the state
parent
b16cc903
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
-9
22 additions, 9 deletions
src/one-body-sample.cc
with
22 additions
and
9 deletions
src/one-body-sample.cc
+
22
−
9
View file @
0ad38afb
...
...
@@ -47,11 +47,13 @@
#include
<dune/istl/scaledidmatrix.hh>
#include
<dune/fufem/assemblers/functionalassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/boundarymassassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/l2functionalassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/massassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/vonmisesstressassembler.hh>
#include
<dune/fufem/assemblers/operatorassembler.hh>
#include
<dune/fufem/boundarypatch.hh>
#include
<dune/fufem/dunepython.hh>
#include
<dune/fufem/functions/basisgridfunction.hh>
#include
<dune/fufem/functions/constantfunction.hh>
...
...
@@ -134,13 +136,6 @@ template <class FunctionMap> void initPython(FunctionMap &functions) {
.
toC
<
typename
FunctionMap
::
Base
>
(
functions
);
}
template
<
class
VectorType
>
double
diff_two_norm
(
VectorType
const
&
v1
,
VectorType
const
&
v2
)
{
VectorType
tmp
=
v1
;
tmp
-=
v2
;
return
tmp
.
two_norm
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
Dune
::
Timer
timer
;
...
...
@@ -152,7 +147,9 @@ int main(int argc, char *argv[]) {
typedef
Dune
::
FieldVector
<
double
,
dims
>
SmallVector
;
typedef
Dune
::
FieldMatrix
<
double
,
dims
,
dims
>
SmallMatrix
;
typedef
Dune
::
FieldMatrix
<
double
,
1
,
1
>
SmallSingletonMatrix
;
typedef
Dune
::
BCRSMatrix
<
SmallMatrix
>
MatrixType
;
typedef
Dune
::
BCRSMatrix
<
SmallSingletonMatrix
>
SingletonMatrixType
;
typedef
Dune
::
BlockVector
<
SmallVector
>
VectorType
;
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>
SingletonVectorType
;
...
...
@@ -289,7 +286,23 @@ int main(int argc, char *argv[]) {
localStiffness
(
E
,
nu
);
OperatorAssembler
<
P1Basis
,
P1Basis
>
(
p1Basis
,
p1Basis
)
.
assemble
(
localStiffness
,
stiffnessMatrix
);
};
}
SingletonMatrixType
frictionalBoundaryMassMatrix
;
EnergyNorm
<
SingletonMatrixType
,
SingletonVectorType
>
const
stateEnergyNorm
(
frictionalBoundaryMassMatrix
);
{
BoundaryPatch
<
GridView
>
const
frictionalBoundary
(
leafView
,
frictionalNodes
);
BoundaryMassAssembler
<
GridType
,
BoundaryPatch
<
GridView
>
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
,
SmallSingletonMatrix
>
const
frictionalBoundaryMassAssembler
(
frictionalBoundary
);
OperatorAssembler
<
P1Basis
,
P1Basis
>
(
p1Basis
,
p1Basis
).
assemble
(
frictionalBoundaryMassAssembler
,
frictionalBoundaryMassMatrix
);
}
auto
const
nodalIntegrals
=
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
...
...
@@ -412,7 +425,7 @@ int main(int argc, char *argv[]) {
{
SingletonVectorType
computed_state
;
stateUpdater
->
extractState
(
computed_state
);
double
const
correction
=
diff_two_norm
(
computed_state
,
alpha
);
double
const
correction
=
stateEnergyNorm
.
diff
(
computed_state
,
alpha
);
if
(
state_fpi
<=
2
// Let the first two steps pass through unchanged
||
correction
<
minimalCorrectionReduction
*
lastCorrection
)
{
alpha
=
computed_state
;
...
...
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