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
997bd2f4
Commit
997bd2f4
authored
17 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
getResultantForce for a given BoundaryPatch
[[Imported from SVN: r1471]]
parent
d32786b9
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/rodassembler.cc
+55
-26
55 additions, 26 deletions
src/rodassembler.cc
with
55 additions
and
26 deletions
src/rodassembler.cc
+
55
−
26
View file @
997bd2f4
...
@@ -166,7 +166,7 @@ getLocalMatrix( EntityPointer &entity,
...
@@ -166,7 +166,7 @@ getLocalMatrix( EntityPointer &entity,
Quaternion
<
double
>
q
=
Quaternion
<
double
>::
interpolate
(
localSolution
[
0
].
q
,
localSolution
[
1
].
q
,
quadPos
[
0
]);
Quaternion
<
double
>
q
=
Quaternion
<
double
>::
interpolate
(
localSolution
[
0
].
q
,
localSolution
[
1
].
q
,
quadPos
[
0
]);
// Contains \partial q / \partial v^i_j at v = 0
// Contains \partial q / \partial v^i_j at v = 0
FixedA
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj
;
a
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj
;
Quaternion
<
double
>
dq_dvij_ds
[
2
][
3
];
Quaternion
<
double
>
dq_dvij_ds
[
2
][
3
];
for
(
int
i
=
0
;
i
<
2
;
i
++
)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
...
@@ -207,7 +207,7 @@ getLocalMatrix( EntityPointer &entity,
...
@@ -207,7 +207,7 @@ getLocalMatrix( EntityPointer &entity,
}
}
// Contains \parder d \parder v^i_j
// Contains \parder d \parder v^i_j
FixedArray
<
FixedA
rray
<
FieldVector
<
double
,
3
>
,
3
>
,
3
>
dd_dvj
;
array
<
a
rray
<
FieldVector
<
double
,
3
>
,
3
>
,
3
>
dd_dvj
;
q
.
getFirstDerivativesOfDirectors
(
dd_dvj
);
q
.
getFirstDerivativesOfDirectors
(
dd_dvj
);
// Contains \parder {dm}{v^i_j}{v^k_l}
// Contains \parder {dm}{v^i_j}{v^k_l}
...
@@ -454,9 +454,9 @@ assembleGradient(const std::vector<Configuration>& sol,
...
@@ -454,9 +454,9 @@ assembleGradient(const std::vector<Configuration>& sol,
FieldVector
<
double
,
blocksize
>
referenceStrain
=
getStrain
(
referenceConfiguration_
,
it
,
quadPos
);
FieldVector
<
double
,
blocksize
>
referenceStrain
=
getStrain
(
referenceConfiguration_
,
it
,
quadPos
);
// Contains \partial q / \partial v^i_j at v = 0
// Contains \partial q / \partial v^i_j at v = 0
FixedA
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj
;
a
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj
;
FixedA
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj_ds
;
a
rray
<
Quaternion
<
double
>
,
3
>
dq_dvj_ds
;
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
...
@@ -470,7 +470,7 @@ assembleGradient(const std::vector<Configuration>& sol,
...
@@ -470,7 +470,7 @@ assembleGradient(const std::vector<Configuration>& sol,
}
}
// dd_dvij[k][i][j] = \parder {d_k} {v^i_j}
// dd_dvij[k][i][j] = \parder {d_k} {v^i_j}
FixedArray
<
FixedA
rray
<
FieldVector
<
double
,
3
>
,
3
>
,
3
>
dd_dvj
;
array
<
a
rray
<
FieldVector
<
double
,
3
>
,
3
>
,
3
>
dd_dvj
;
hatq
.
getFirstDerivativesOfDirectors
(
dd_dvj
);
hatq
.
getFirstDerivativesOfDirectors
(
dd_dvj
);
...
@@ -781,39 +781,68 @@ Dune::FieldVector<double, 6> Dune::RodAssembler<GridType>::getStrain(const std::
...
@@ -781,39 +781,68 @@ Dune::FieldVector<double, 6> Dune::RodAssembler<GridType>::getStrain(const std::
template
<
class
GridType
>
template
<
class
GridType
>
Dune
::
FieldVector
<
double
,
3
>
Dune
::
RodAssembler
<
GridType
>::
Dune
::
FieldVector
<
double
,
3
>
Dune
::
RodAssembler
<
GridType
>::
getResultantForce
(
const
std
::
vector
<
Configuration
>&
sol
)
const
getResultantForce
(
const
BoundaryPatch
<
GridType
>&
boundary
,
const
std
::
vector
<
Configuration
>&
sol
)
const
{
{
const
typename
GridType
::
Traits
::
LeafIndexSet
&
indexSet
=
grid_
->
leafIndexSet
();
const
typename
GridType
::
Traits
::
LeafIndexSet
&
indexSet
=
grid_
->
leafIndexSet
();
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!"
);
// HARDWIRED: the leftmost point on the grid
FieldVector
<
double
,
3
>
canonicalStress
(
0
);
EntityPointer
leftElement
=
grid_
->
template
leafbegin
<
0
>();
assert
(
leftElement
->
ileafbegin
().
boundary
());
// Loop over the given boundary
ElementLeafIterator
eIt
=
grid_
->
template
leafbegin
<
0
>();
ElementLeafIterator
eEndIt
=
grid_
->
template
leafend
<
0
>();
double
pos
=
0
;
for
(;
eIt
!=
eEndIt
;
++
eIt
)
{
FieldVector
<
double
,
blocksize
>
strain
=
getStrain
(
sol
,
leftElement
,
pos
);
typename
EntityType
::
LeafIntersectionIterator
nIt
=
eIt
->
ileafbegin
(
);
FieldVector
<
double
,
blocksize
>
referenceStrain
=
getStrain
(
referenceConfiguration_
,
leftElement
,
pos
);
typename
EntityType
::
LeafIntersectionIterator
nEndIt
=
eIt
->
ileafend
(
);
FieldVector
<
double
,
3
>
localStress
;
for
(;
nIt
!=
nEndIt
;
++
nIt
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
localStress
[
i
]
=
(
strain
[
i
]
-
referenceStrain
[
i
])
*
A_
[
i
];
// Transform stress given with respect to the basis given by the three directors to
if
(
!
boundary
.
contains
(
*
eIt
,
nIt
.
numberInSelf
()))
// the canonical basis of R^3
continue
;
/** \todo Hardwired: Entry 0 is the leftmost entry! */
FieldMatrix
<
double
,
3
,
3
>
orientationMatrix
;
sol
[
0
].
q
.
matrix
(
orientationMatrix
);
FieldVector
<
double
,
3
>
canonicalStress
(
0
);
// //////////////////////////////////////////////
orientationMatrix
.
umv
(
localStress
,
canonicalStress
);
// Compute force across this boundary face
// //////////////////////////////////////////////
double
pos
=
nIt
.
intersectionSelfLocal
()[
0
];
FieldVector
<
double
,
blocksize
>
strain
=
getStrain
(
sol
,
eIt
,
pos
);
FieldVector
<
double
,
blocksize
>
referenceStrain
=
getStrain
(
referenceConfiguration_
,
eIt
,
pos
);
FieldVector
<
double
,
3
>
localStress
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
localStress
[
i
]
=
(
strain
[
i
]
-
referenceStrain
[
i
])
*
A_
[
i
];
// Transform stress given with respect to the basis given by the three directors to
// the canonical basis of R^3
/** \todo Hardwired: Entry 0 is the leftmost entry! */
FieldMatrix
<
double
,
3
,
3
>
orientationMatrix
;
sol
[
0
].
q
.
matrix
(
orientationMatrix
);
orientationMatrix
.
umv
(
localStress
,
canonicalStress
);
// Reverse transformation to make sure we did the correct thing
// assert( std::abs(localStress[0]-canonicalStress*sol[0].q.director(0)) < 1e-6 );
// assert( std::abs(localStress[1]-canonicalStress*sol[0].q.director(1)) < 1e-6 );
// assert( std::abs(localStress[2]-canonicalStress*sol[0].q.director(2)) < 1e-6 );
}
// Reverse transformation to make sure we did the correct thing
}
assert
(
std
::
abs
(
localStress
[
0
]
-
canonicalStress
*
sol
[
0
].
q
.
director
(
0
))
<
1e-6
);
assert
(
std
::
abs
(
localStress
[
1
]
-
canonicalStress
*
sol
[
0
].
q
.
director
(
1
))
<
1e-6
);
assert
(
std
::
abs
(
localStress
[
2
]
-
canonicalStress
*
sol
[
0
].
q
.
director
(
2
))
<
1e-6
);
return
canonicalStress
;
return
canonicalStress
;
}
}
template
<
class
GridType
>
Dune
::
FieldVector
<
double
,
3
>
Dune
::
RodAssembler
<
GridType
>::
getResultantTorque
(
const
BoundaryPatch
<
GridType
>&
boundary
,
const
std
::
vector
<
Configuration
>&
sol
)
const
{
#warning getResultantForce non implemented yet!
}
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