Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
47ebad29
Commit
47ebad29
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup: RodAssembler is parametrized by a GridView (instead of a Grid) now
[[Imported from SVN: r5088]]
parent
f82c5bef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rodassembler.cc
+41
-56
41 additions, 56 deletions
src/rodassembler.cc
src/rodassembler.hh
+18
-20
18 additions, 20 deletions
src/rodassembler.hh
with
59 additions
and
76 deletions
src/rodassembler.cc
+
41
−
56
View file @
47ebad29
...
@@ -11,24 +11,23 @@
...
@@ -11,24 +11,23 @@
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
void
RodAssembler
<
Grid
Type
>::
void
RodAssembler
<
Grid
View
>::
assembleGradient
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
assembleGradient
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
grad
)
const
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
grad
)
const
{
{
using
namespace
Dune
;
using
namespace
Dune
;
const
typename
GridType
::
Traits
::
LevelIndexSet
&
indexSet
=
grid_
->
levelIndexSet
(
grid_
->
maxLevel
());
const
typename
GridView
::
Traits
::
IndexSet
&
indexSet
=
gridView_
.
indexSet
();
const
int
maxlevel
=
grid_
->
maxLevel
();
if
(
sol
.
size
()
!=
grid_
->
size
(
maxlevel
,
gridDim
))
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
grad
.
resize
(
sol
.
size
());
grad
.
resize
(
sol
.
size
());
grad
=
0
;
grad
=
0
;
ElementIterator
it
=
grid
_
->
template
l
begin
<
0
>(
maxlevel
);
ElementIterator
it
=
grid
View_
.
template
begin
<
0
>();
ElementIterator
endIt
=
grid
_
->
template
l
end
<
0
>(
maxlevel
);
ElementIterator
endIt
=
grid
View_
.
template
end
<
0
>();
// Loop over all elements
// Loop over all elements
for
(;
it
!=
endIt
;
++
it
)
{
for
(;
it
!=
endIt
;
++
it
)
{
...
@@ -69,11 +68,11 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
...
@@ -69,11 +68,11 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
}
}
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
double
RodAssembler
<
Grid
Type
>::
double
RodAssembler
<
Grid
View
>::
computeEnergy
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
)
const
computeEnergy
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
)
const
{
{
double
energy
=
GeodesicFEAssembler
<
typename
GridType
::
Leaf
GridView
,
RigidBodyMotion
<
3
>
>::
computeEnergy
(
sol
);
double
energy
=
GeodesicFEAssembler
<
GridView
,
RigidBodyMotion
<
3
>
>::
computeEnergy
(
sol
);
// ///////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////
// Add the contributions of the Neumann data. Since the boundary is
// Add the contributions of the Neumann data. Since the boundary is
...
@@ -93,14 +92,14 @@ computeEnergy(const std::vector<RigidBodyMotion<3> >& sol) const
...
@@ -93,14 +92,14 @@ computeEnergy(const std::vector<RigidBodyMotion<3> >& sol) const
}
}
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
void
RodAssembler
<
Grid
Type
>::
void
RodAssembler
<
Grid
View
>::
getStrain
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
getStrain
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
strain
)
const
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
strain
)
const
{
{
using
namespace
Dune
;
using
namespace
Dune
;
const
typename
Grid
Type
::
Traits
::
Leaf
IndexSet
&
indexSet
=
grid
_
->
leafI
ndexSet
();
const
typename
Grid
View
::
Traits
::
IndexSet
&
indexSet
=
grid
View_
.
i
ndexSet
();
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
...
@@ -109,8 +108,8 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
...
@@ -109,8 +108,8 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
strain
.
resize
(
indexSet
.
size
(
0
));
strain
.
resize
(
indexSet
.
size
(
0
));
strain
=
0
;
strain
=
0
;
Element
Leaf
Iterator
it
=
grid
_
->
template
leaf
begin
<
0
>();
ElementIterator
it
=
grid
View_
.
template
begin
<
0
>();
Element
Leaf
Iterator
endIt
=
grid
_
->
template
leaf
end
<
0
>();
ElementIterator
endIt
=
grid
View_
.
template
end
<
0
>();
// Loop over all elements
// Loop over all elements
for
(;
it
!=
endIt
;
++
it
)
{
for
(;
it
!=
endIt
;
++
it
)
{
...
@@ -138,7 +137,7 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
...
@@ -138,7 +137,7 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
double
weight
=
quad
[
pt
].
weight
()
*
it
->
geometry
().
integrationElement
(
quadPos
);
double
weight
=
quad
[
pt
].
weight
()
*
it
->
geometry
().
integrationElement
(
quadPos
);
FieldVector
<
double
,
blocksize
>
localStrain
=
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localSolution
,
*
it
,
quad
[
pt
].
position
());
FieldVector
<
double
,
blocksize
>
localStrain
=
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localSolution
,
*
it
,
quad
[
pt
].
position
());
// Sum it all up
// Sum it all up
strain
[
elementIdx
].
axpy
(
weight
,
localStrain
);
strain
[
elementIdx
].
axpy
(
weight
,
localStrain
);
...
@@ -157,8 +156,8 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
...
@@ -157,8 +156,8 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
}
}
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
void
RodAssembler
<
Grid
Type
>::
void
RodAssembler
<
Grid
View
>::
getStress
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
getStress
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
stress
)
const
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
stress
)
const
{
{
...
@@ -167,84 +166,72 @@ getStress(const std::vector<RigidBodyMotion<3> >& sol,
...
@@ -167,84 +166,72 @@ getStress(const std::vector<RigidBodyMotion<3> >& sol,
// Get reference strain
// Get reference strain
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>
referenceStrain
;
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>
referenceStrain
;
getStrain
(
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
,
referenceStrain
);
getStrain
(
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
,
referenceStrain
);
// Linear diagonal constitutive law
// Linear diagonal constitutive law
for
(
size_t
i
=
0
;
i
<
stress
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
stress
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
stress
[
i
][
j
]
=
(
stress
[
i
][
j
]
-
referenceStrain
[
i
][
j
])
*
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
A_
[
j
];
stress
[
i
][
j
]
=
(
stress
[
i
][
j
]
-
referenceStrain
[
i
][
j
])
*
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
A_
[
j
];
stress
[
i
][
j
+
3
]
=
(
stress
[
i
][
j
+
3
]
-
referenceStrain
[
i
][
j
+
3
])
*
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
K_
[
j
];
stress
[
i
][
j
+
3
]
=
(
stress
[
i
][
j
+
3
]
-
referenceStrain
[
i
][
j
+
3
])
*
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
K_
[
j
];
}
}
}
}
}
}
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
Dune
::
FieldVector
<
double
,
3
>
RodAssembler
<
Grid
Type
>::
Dune
::
FieldVector
<
double
,
3
>
RodAssembler
<
Grid
View
>::
getResultantForce
(
const
Level
BoundaryPatch
<
Grid
Type
>&
boundary
,
getResultantForce
(
const
BoundaryPatch
Base
<
Grid
View
>&
boundary
,
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
Dune
::
FieldVector
<
double
,
3
>&
canonicalTorque
)
const
Dune
::
FieldVector
<
double
,
3
>&
canonicalTorque
)
const
{
{
using
namespace
Dune
;
using
namespace
Dune
;
if
(
grid_
!=
&
boundary
.
gridView
()
.
grid
()
)
//
if (grid
View
_ != &boundary.gridView())
DUNE_THROW
(
Dune
::
Exception
,
"The boundary patch has to match the grid of the assembler!"
);
//
DUNE_THROW(Dune::Exception, "The boundary patch has to match the grid
view
of the assembler!");
const
typename
Grid
Type
::
Traits
::
Leaf
IndexSet
&
indexSet
=
grid
_
->
leafI
ndexSet
();
const
typename
Grid
View
::
Traits
::
IndexSet
&
indexSet
=
grid
View_
.
i
ndexSet
();
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
DUNE_THROW
(
Exception
,
"Solution vector doesn't match the grid!"
);
/** \todo Eigentlich sollte das BoundaryPatch ein LeafBoundaryPatch sein */
if
(
boundary
.
level
()
!=
grid_
->
maxLevel
())
DUNE_THROW
(
Exception
,
"The boundary patch has to refer to the max level!"
);
FieldVector
<
double
,
3
>
canonicalStress
(
0
);
FieldVector
<
double
,
3
>
canonicalStress
(
0
);
canonicalTorque
=
0
;
canonicalTorque
=
0
;
// Loop over the given boundary
// Loop over the given boundary
ElementLeafIterator
eIt
=
grid_
->
template
leafbegin
<
0
>();
typename
BoundaryPatchBase
<
GridView
>::
iterator
it
=
boundary
.
begin
();
ElementLeafIterator
eEndIt
=
grid_
->
template
leafend
<
0
>();
typename
BoundaryPatchBase
<
GridView
>::
iterator
endIt
=
boundary
.
end
();
for
(;
eIt
!=
eEndIt
;
++
eIt
)
{
typename
EntityType
::
LeafIntersectionIterator
nIt
=
eIt
->
ileafbegin
();
typename
EntityType
::
LeafIntersectionIterator
nEndIt
=
eIt
->
ileafend
();
for
(;
nIt
!=
nEndIt
;
++
nIt
)
{
for
(;
it
!=
endIt
;
++
it
)
{
if
(
!
boundary
.
contains
(
*
eIt
,
nIt
->
indexInInside
()))
continue
;
// //////////////////////////////////////////////
// //////////////////////////////////////////////
// Compute force across this boundary face
// Compute force across this boundary face
// //////////////////////////////////////////////
// //////////////////////////////////////////////
double
pos
=
nI
t
->
geometryInInside
().
corner
(
0
);
double
pos
=
i
t
->
geometryInInside
().
corner
(
0
);
std
::
vector
<
RigidBodyMotion
<
3
>
>
localSolution
(
2
);
std
::
vector
<
RigidBodyMotion
<
3
>
>
localSolution
(
2
);
localSolution
[
0
]
=
sol
[
indexSet
.
subIndex
(
*
eIt
,
0
,
1
)];
localSolution
[
0
]
=
sol
[
indexSet
.
subIndex
(
*
it
->
inside
()
,
0
,
1
)];
localSolution
[
1
]
=
sol
[
indexSet
.
subIndex
(
*
eIt
,
1
,
1
)];
localSolution
[
1
]
=
sol
[
indexSet
.
subIndex
(
*
it
->
inside
()
,
1
,
1
)];
std
::
vector
<
RigidBodyMotion
<
3
>
>
localRefConf
(
2
);
std
::
vector
<
RigidBodyMotion
<
3
>
>
localRefConf
(
2
);
localRefConf
[
0
]
=
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
[
indexSet
.
subIndex
(
*
eIt
,
0
,
1
)];
localRefConf
[
0
]
=
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
[
indexSet
.
subIndex
(
*
it
->
inside
()
,
0
,
1
)];
localRefConf
[
1
]
=
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
[
indexSet
.
subIndex
(
*
eIt
,
1
,
1
)];
localRefConf
[
1
]
=
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
referenceConfiguration_
[
indexSet
.
subIndex
(
*
it
->
inside
()
,
1
,
1
)];
FieldVector
<
double
,
blocksize
>
strain
=
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localSolution
,
*
eIt
,
pos
);
FieldVector
<
double
,
blocksize
>
strain
=
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localSolution
,
*
it
->
inside
()
,
pos
);
FieldVector
<
double
,
blocksize
>
referenceStrain
=
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localRefConf
,
*
eIt
,
pos
);
FieldVector
<
double
,
blocksize
>
referenceStrain
=
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
getStrain
(
localRefConf
,
*
it
->
inside
()
,
pos
);
FieldVector
<
double
,
3
>
localStress
;
FieldVector
<
double
,
3
>
localStress
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
i
=
0
;
i
<
3
;
i
++
)
localStress
[
i
]
=
(
strain
[
i
]
-
referenceStrain
[
i
])
*
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
A_
[
i
];
localStress
[
i
]
=
(
strain
[
i
]
-
referenceStrain
[
i
])
*
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
A_
[
i
];
FieldVector
<
double
,
3
>
localTorque
;
FieldVector
<
double
,
3
>
localTorque
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
i
=
0
;
i
<
3
;
i
++
)
localTorque
[
i
]
=
(
strain
[
i
+
3
]
-
referenceStrain
[
i
+
3
])
*
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
K_
[
i
];
localTorque
[
i
]
=
(
strain
[
i
+
3
]
-
referenceStrain
[
i
+
3
])
*
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
K_
[
i
];
// Transform stress given with respect to the basis given by the three directors to
// Transform stress given with respect to the basis given by the three directors to
// the canonical basis of R^3
// the canonical basis of R^3
FieldMatrix
<
double
,
3
,
3
>
orientationMatrix
;
FieldMatrix
<
double
,
3
,
3
>
orientationMatrix
;
sol
[
indexSet
.
subIndex
(
*
eIt
,
nI
t
->
indexInInside
(),
1
)].
q
.
matrix
(
orientationMatrix
);
sol
[
indexSet
.
subIndex
(
*
it
->
inside
(),
i
t
->
indexInInside
(),
1
)].
q
.
matrix
(
orientationMatrix
);
orientationMatrix
.
umv
(
localStress
,
canonicalStress
);
orientationMatrix
.
umv
(
localStress
,
canonicalStress
);
...
@@ -257,11 +244,9 @@ getResultantForce(const LevelBoundaryPatch<GridType>& boundary,
...
@@ -257,11 +244,9 @@ getResultantForce(const LevelBoundaryPatch<GridType>& boundary,
// Multiply force times boundary normal to get the transmitted force
// Multiply force times boundary normal to get the transmitted force
/** \todo The minus sign comes from the coupling conditions. It
/** \todo The minus sign comes from the coupling conditions. It
should really be in the Dirichlet-Neumann code. */
should really be in the Dirichlet-Neumann code. */
canonicalStress
*=
-
nI
t
->
unitOuterNormal
(
FieldVector
<
double
,
0
>
(
0
))[
0
];
canonicalStress
*=
-
i
t
->
unitOuterNormal
(
FieldVector
<
double
,
0
>
(
0
))[
0
];
canonicalTorque
*=
-
nI
t
->
unitOuterNormal
(
FieldVector
<
double
,
0
>
(
0
))[
0
];
canonicalTorque
*=
-
i
t
->
unitOuterNormal
(
FieldVector
<
double
,
0
>
(
0
))[
0
];
}
}
}
return
canonicalStress
;
return
canonicalStress
;
...
...
This diff is collapsed.
Click to expand it.
src/rodassembler.hh
+
18
−
20
View file @
47ebad29
...
@@ -14,17 +14,16 @@
...
@@ -14,17 +14,16 @@
/** \brief The FEM operator for an extensible, shearable rod
/** \brief The FEM operator for an extensible, shearable rod
*/
*/
template
<
class
Grid
Type
>
template
<
class
Grid
View
>
class
RodAssembler
:
public
GeodesicFEAssembler
<
typename
GridType
::
Leaf
GridView
,
RigidBodyMotion
<
3
>
>
class
RodAssembler
:
public
GeodesicFEAssembler
<
GridView
,
RigidBodyMotion
<
3
>
>
{
{
typedef
typename
GridType
::
template
Codim
<
0
>
::
Entity
EntityType
;
//typedef typename GridType::template Codim<0>::Entity EntityType;
typedef
typename
GridType
::
template
Codim
<
0
>
::
EntityPointer
EntityPointer
;
//typedef typename GridType::template Codim<0>::EntityPointer EntityPointer;
typedef
typename
GridType
::
template
Codim
<
0
>
::
LevelIterator
ElementIterator
;
typedef
typename
GridView
::
template
Codim
<
0
>
::
Iterator
ElementIterator
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
LeafIterator
ElementLeafIterator
;
//! Dimension of the grid. This needs to be one!
//! Dimension of the grid. This needs to be one!
enum
{
gridDim
=
Grid
Type
::
dimension
};
enum
{
gridDim
=
Grid
View
::
dimension
};
enum
{
elementOrder
=
1
};
enum
{
elementOrder
=
1
};
...
@@ -36,7 +35,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
...
@@ -36,7 +35,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
/** \todo public only for debugging! */
/** \todo public only for debugging! */
public
:
public
:
const
GridType
*
grid_
;
GridView
grid
View
_
;
protected
:
protected
:
Dune
::
FieldVector
<
double
,
3
>
leftNeumannForce_
;
Dune
::
FieldVector
<
double
,
3
>
leftNeumannForce_
;
...
@@ -47,21 +46,20 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
...
@@ -47,21 +46,20 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
public
:
public
:
//! ???
//! ???
RodAssembler
(
const
GridType
&
grid
,
RodAssembler
(
const
GridView
&
gridView
,
RodLocalStiffness
<
typename
GridType
::
LeafGridView
,
double
>*
localStiffness
)
:
RodLocalStiffness
<
GridView
,
double
>*
localStiffness
)
GeodesicFEAssembler
<
typename
GridType
::
LeafGridView
,
RigidBodyMotion
<
3
>
>
(
grid
.
leafView
(),
:
GeodesicFEAssembler
<
GridView
,
RigidBodyMotion
<
3
>
>
(
gridView
,
localStiffness
),
localStiffness
),
gridView_
(
gridView
),
grid_
(
&
grid
),
leftNeumannForce_
(
0
),
leftNeumannTorque_
(
0
),
rightNeumannForce_
(
0
),
rightNeumannTorque_
(
0
)
leftNeumannForce_
(
0
),
leftNeumannTorque_
(
0
),
rightNeumannForce_
(
0
),
rightNeumannTorque_
(
0
)
{
{
std
::
vector
<
RigidBodyMotion
<
3
>
>
referenceConfiguration
(
grid
.
size
(
gridDim
));
std
::
vector
<
RigidBodyMotion
<
3
>
>
referenceConfiguration
(
grid
View
.
size
(
gridDim
));
typename
Grid
Type
::
template
Codim
<
gridDim
>
::
Leaf
Iterator
it
=
grid
.
template
leaf
begin
<
gridDim
>();
typename
Grid
View
::
template
Codim
<
gridDim
>
::
Iterator
it
=
grid
View
.
template
begin
<
gridDim
>();
typename
Grid
Type
::
template
Codim
<
gridDim
>
::
Leaf
Iterator
endIt
=
grid
.
template
leaf
end
<
gridDim
>();
typename
Grid
View
::
template
Codim
<
gridDim
>
::
Iterator
endIt
=
grid
View
.
template
end
<
gridDim
>();
for
(;
it
!=
endIt
;
++
it
)
{
for
(;
it
!=
endIt
;
++
it
)
{
int
idx
=
grid
.
leafI
ndexSet
().
index
(
*
it
);
int
idx
=
grid
View
.
i
ndexSet
().
index
(
*
it
);
referenceConfiguration
[
idx
].
r
[
0
]
=
0
;
referenceConfiguration
[
idx
].
r
[
0
]
=
0
;
referenceConfiguration
[
idx
].
r
[
1
]
=
0
;
referenceConfiguration
[
idx
].
r
[
1
]
=
0
;
...
@@ -69,7 +67,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
...
@@ -69,7 +67,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
referenceConfiguration
[
idx
].
q
=
Rotation
<
3
,
double
>::
identity
();
referenceConfiguration
[
idx
].
q
=
Rotation
<
3
,
double
>::
identity
();
}
}
dynamic_cast
<
RodLocalStiffness
<
typename
GridType
::
Leaf
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
setReferenceConfiguration
(
referenceConfiguration
);
dynamic_cast
<
RodLocalStiffness
<
GridView
,
double
>*
>
(
this
->
localStiffness_
)
->
setReferenceConfiguration
(
referenceConfiguration
);
}
}
void
setNeumannData
(
const
Dune
::
FieldVector
<
double
,
3
>&
leftForce
,
void
setNeumannData
(
const
Dune
::
FieldVector
<
double
,
3
>&
leftForce
,
...
@@ -98,7 +96,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
...
@@ -98,7 +96,7 @@ class RodAssembler : public GeodesicFEAssembler<typename GridType::LeafGridView,
/** \brief Return resultant force across boundary in canonical coordinates
/** \brief Return resultant force across boundary in canonical coordinates
\note Linear run-time in the size of the grid */
\note Linear run-time in the size of the grid */
Dune
::
FieldVector
<
double
,
3
>
getResultantForce
(
const
Level
BoundaryPatch
<
Grid
Type
>&
boundary
,
Dune
::
FieldVector
<
double
,
3
>
getResultantForce
(
const
BoundaryPatch
Base
<
Grid
View
>&
boundary
,
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
sol
,
Dune
::
FieldVector
<
double
,
3
>&
canonicalTorque
)
const
;
Dune
::
FieldVector
<
double
,
3
>&
canonicalTorque
)
const
;
...
...
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