Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lisa_julia.nebel_at_tu-dresden.de
dune-elasticity
Commits
0a1b7cf2
Commit
0a1b7cf2
authored
Apr 14, 2014
by
akbib
Committed by
akbib
Apr 14, 2014
Browse files
Use BoundaryFunctionalAssembler and NeumannBoundaryAssembler to make compile again.
[[Imported from SVN: r13123]]
parent
7d4d52da
Changes
1
Hide whitespace changes
Inline
Side-by-side
viscoelast.cc
View file @
0a1b7cf2
...
...
@@ -21,9 +21,10 @@
#include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/readbitfield.hh>
#include <dune/fufem/computestress.hh>
#include <dune/fufem/neumannassembler.hh>
#include <dune/fufem/functionspacebases/p1nodalbasis.hh>
#include <dune/fufem/assemblers/operatorassembler.hh>
#include <dune/fufem/assemblers/boundaryfunctionalassembler.hh>
#include <dune/fufem/assemblers/localassemblers/neumannboundaryassembler.hh>
#include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include <dune/fufem/assemblers/localassemblers/viscosityassembler.hh>
#include <dune/fufem/functiontools/gridfunctionadaptor.hh>
...
...
@@ -142,17 +143,16 @@ int main (int argc, char *argv[]) try
dirichletBoundaryAll[0].setup(grid, 0, dirichletNodesAll[0]);
*/
std
::
vector
<
BitSetVector
<
dim
>
>
neumannNodes
(
maxLevel
+
1
);
std
::
vector
<
LevelBoundaryPatch
>
neumannBoundary
(
maxLevel
+
1
);
std
::
vector
<
VectorType
>
neumannValues
(
maxLevel
+
1
);
LevelBoundaryPatch
coarseNeumannBoundary
;
VectorType
coarseNeumannValues
;
//Read neumann boundary values
if
(
neumannBV
)
{
n
eumannBoundary
[
0
]
.
setup
(
grid
.
levelView
(
0
));
readBoundaryPatch
<
GridType
>
(
n
eumannBoundary
[
0
]
,
path
+
neumannFile
);
n
eumannValues
[
0
]
.
resize
(
grid
.
size
(
0
,
dim
));
AmiraMeshReader
<
GridType
>::
readFunction
(
n
eumannValues
[
0
]
,
path
+
neumannValuesFile
);
coarseN
eumannBoundary
.
setup
(
grid
.
levelView
(
0
));
readBoundaryPatch
<
GridType
>
(
coarseN
eumannBoundary
,
path
+
neumannFile
);
coarseN
eumannValues
.
resize
(
grid
.
size
(
0
,
dim
));
AmiraMeshReader
<
GridType
>::
readFunction
(
coarseN
eumannValues
,
path
+
neumannValuesFile
);
}
...
...
@@ -191,23 +191,20 @@ int main (int argc, char *argv[]) try
sampleOnBitField
(
grid
,
dirichletValues
,
dirichletNodes
);
//Determine Neumann dofs
if
(
neumannBV
){
BoundaryPatchProlongator
<
GridType
>::
prolong
(
neumannBoundary
);
BitSetVector
<
dim
>
neumannNodes
(
grid
.
size
(
dim
));
VectorType
neumannValues
(
neumannNodes
.
size
());
BoundaryPatch
<
GridType
::
LeafGridView
>
neumannBoundary
(
grid
.
leafGridView
());
if
(
neumannBV
)
{
BoundaryPatchProlongator
<
GridType
>::
prolong
(
coarseNeumannBoundary
,
neumannBoundary
);
for
(
int
i
=
0
;
i
<=
grid
.
maxLevel
();
i
++
)
{
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
][
k
]
=
neumannBoundary
[
i
].
containsVertex
(
j
);
}
for
(
size_t
j
=
0
;
j
<
neumannNodes
.
size
();
j
++
)
for
(
int
k
=
0
;
k
<
dim
;
k
++
)
neumannNodes
[
j
][
k
]
=
neumannBoundary
.
containsVertex
(
j
);
sampleOnBitField
(
grid
,
neumannValues
,
neumannNodes
);
sampleOnBitField
(
grid
,
coarseNeumannValues
,
neumannValues
,
neumannNodes
);
}
//PatchProlongator<GridType>::prolong(dirichletBoundaryAll);
//right-hand-side rhs = bodyforces + neumanboundary
VectorType
rhs
(
grid
.
size
(
dim
));
...
...
@@ -224,10 +221,7 @@ int main (int argc, char *argv[]) try
}
// Assemble neumann boundary values
if
(
neumannBV
)
assembleAndAddNeumannTerm
(
neumannBoundary
[
grid
.
maxLevel
()],
neumannValues
[
grid
.
maxLevel
()],
rhs
);
OperatorType
elasticPart
,
viscousPart
;
typedef
P1NodalBasis
<
GridType
::
LeafGridView
,
double
>
P1Basis
;
P1Basis
p1Basis
(
grid
.
leafView
());
...
...
@@ -237,8 +231,14 @@ int main (int argc, char *argv[]) try
ViscosityAssembler
<
GridType
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
>
visLocalAssembler
(
nu_shear
,
nu_bulk
);
globalAssembler
.
assemble
(
visLocalAssembler
,
viscousPart
);
if
(
neumannBV
)
{
BasisGridFunction
<
P1Basis
,
VectorType
>
neumannFunction
(
p1Basis
,
neumannValues
);
NeumannBoundaryAssembler
<
GridType
,
Dune
::
FieldVector
<
double
,
dim
>
>
neumannBoundaryAssembler
(
neumannFunction
);
BoundaryFunctionalAssembler
<
P1Basis
>
boundaryFunctionalAssembler
(
p1Basis
,
neumannBoundary
);
boundaryFunctionalAssembler
.
assemble
(
neumannBoundaryAssembler
,
rhs
,
true
);
}
/*
//test vectors with time ,total surfacestress and total strain data
BlockVector<FieldVector<double,1> > time(num_timesteps),surfacestress(num_timesteps), strain(num_timesteps);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment