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
4021b000
Commit
4021b000
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Only write out data for a central node
parent
ba17f611
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
+32
-22
32 additions, 22 deletions
src/one-body-sample.cc
with
32 additions
and
22 deletions
src/one-body-sample.cc
+
32
−
22
View file @
4021b000
...
@@ -86,7 +86,8 @@ void setup_boundary(GridView const &gridView,
...
@@ -86,7 +86,8 @@ void setup_boundary(GridView const &gridView,
Dune
::
BitSetVector
<
dim
>
&
ignoreNodes
,
Dune
::
BitSetVector
<
dim
>
&
ignoreNodes
,
Dune
::
BitSetVector
<
1
>
&
neumannNodes
,
Dune
::
BitSetVector
<
1
>
&
neumannNodes
,
Dune
::
BitSetVector
<
1
>
&
frictionalNodes
,
Dune
::
BitSetVector
<
1
>
&
frictionalNodes
,
GridCorner
const
&
lowerLeft
,
GridCorner
const
&
upperRight
)
{
GridCorner
const
&
lowerLeft
,
GridCorner
const
&
upperRight
,
size_t
&
specialNode
)
{
typedef
typename
GridView
::
template
Codim
<
dim
>
::
Iterator
VertexLeafIterator
;
typedef
typename
GridView
::
template
Codim
<
dim
>
::
Iterator
VertexLeafIterator
;
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
...
@@ -97,6 +98,22 @@ void setup_boundary(GridView const &gridView,
...
@@ -97,6 +98,22 @@ void setup_boundary(GridView const &gridView,
assert
(
it
->
geometry
().
corners
()
==
1
);
assert
(
it
->
geometry
().
corners
()
==
1
);
Dune
::
FieldVector
<
double
,
dim
>
const
coordinates
=
it
->
geometry
().
corner
(
0
);
Dune
::
FieldVector
<
double
,
dim
>
const
coordinates
=
it
->
geometry
().
corner
(
0
);
size_t
const
id
=
myVertexMapper
.
map
(
*
it
);
size_t
const
id
=
myVertexMapper
.
map
(
*
it
);
// Find the center of the lower face
switch
(
dim
)
{
case
3
:
if
(
coordinates
[
2
]
!=
lowerLeft
[
2
])
break
;
// fallthrough
case
2
:
if
(
coordinates
[
1
]
==
lowerLeft
[
1
]
&&
std
::
abs
(
coordinates
[
0
]
-
lowerLeft
[
0
])
<
1e-8
)
specialNode
=
id
;
break
;
default:
assert
(
false
);
}
if
(
coordinates
[
1
]
==
upperRight
[
1
])
// upper face
if
(
coordinates
[
1
]
==
upperRight
[
1
])
// upper face
ignoreNodes
[
id
]
=
true
;
ignoreNodes
[
id
]
=
true
;
else
if
(
coordinates
[
1
]
==
lowerLeft
[
1
])
{
// lower face
else
if
(
coordinates
[
1
]
==
lowerLeft
[
1
])
{
// lower face
...
@@ -234,11 +251,14 @@ int main(int argc, char *argv[]) {
...
@@ -234,11 +251,14 @@ int main(int argc, char *argv[]) {
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
stiffnessMatrix
);
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
stiffnessMatrix
);
// Set up the boundary
// Set up the boundary
size_t
specialNode
=
finestSize
;
Dune
::
BitSetVector
<
dim
>
ignoreNodes
(
finestSize
,
false
);
Dune
::
BitSetVector
<
dim
>
ignoreNodes
(
finestSize
,
false
);
Dune
::
BitSetVector
<
1
>
neumannNodes
(
finestSize
,
false
);
Dune
::
BitSetVector
<
1
>
neumannNodes
(
finestSize
,
false
);
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
finestSize
,
false
);
Dune
::
BitSetVector
<
1
>
frictionalNodes
(
finestSize
,
false
);
setup_boundary
(
leafView
,
ignoreNodes
,
neumannNodes
,
frictionalNodes
,
setup_boundary
(
leafView
,
ignoreNodes
,
neumannNodes
,
frictionalNodes
,
lowerLeft
,
upperRight
);
lowerLeft
,
upperRight
,
specialNode
);
assert
(
specialNode
!=
finestSize
);
assert
(
frictionalNodes
[
specialNode
][
0
]);
auto
const
nodalIntegrals
=
auto
const
nodalIntegrals
=
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
...
@@ -425,26 +445,16 @@ int main(int argc, char *argv[]) {
...
@@ -425,26 +445,16 @@ int main(int argc, char *argv[]) {
alpha_old
=
alpha
;
alpha_old
=
alpha
;
{
// Write all kinds of data
{
// Write all kinds of data
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
state_writer
<<
alpha
[
specialNode
][
0
]
<<
" "
<<
std
::
endl
;
if
(
frictionalNodes
[
i
][
0
])
state_writer
<<
alpha
[
i
][
0
]
<<
" "
;
displacement_writer
<<
u
[
specialNode
][
0
]
<<
" "
<<
std
::
endl
;
state_writer
<<
std
::
endl
;
velocity_writer
<<
ud
[
specialNode
][
0
]
<<
" "
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
coefficient_writer
<<
mu
+
displacement_writer
<<
u
[
i
][
0
]
<<
" "
;
a
*
std
::
log
(
ud
[
specialNode
].
two_norm
()
/
V0
)
+
displacement_writer
<<
std
::
endl
;
b
*
(
alpha
[
specialNode
]
+
std
::
log
(
V0
/
L
))
<<
" "
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
velocity_writer
<<
ud
[
i
][
0
]
<<
" "
;
velocity_writer
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
coefficient_writer
<<
mu
+
a
*
std
::
log
(
ud
[
i
].
two_norm
()
/
V0
)
+
b
*
(
alpha
[
i
]
+
std
::
log
(
V0
/
L
))
<<
" "
;
coefficient_writer
<<
std
::
endl
;
}
}
// Compute von Mises stress and write everything to a file
// Compute von Mises stress and write everything to a file
...
...
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