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
c0d389f8
Commit
c0d389f8
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
remove method getStrain() from class RodAssembler and use the one from LocalRodAssembler
[[Imported from SVN: r1713]]
parent
1bec9166
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rodassembler.cc
+10
-90
10 additions, 90 deletions
src/rodassembler.cc
src/rodassembler.hh
+0
-6
0 additions, 6 deletions
src/rodassembler.hh
with
10 additions
and
96 deletions
src/rodassembler.cc
+
10
−
90
View file @
c0d389f8
...
@@ -1329,6 +1329,14 @@ getStrain(const std::vector<Configuration>& sol,
...
@@ -1329,6 +1329,14 @@ getStrain(const std::vector<Configuration>& sol,
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!"
);
// ////////////////////////////////////////////////////
// Create local assembler
// ////////////////////////////////////////////////////
Dune
::
array
<
double
,
3
>
K
=
{
K_
[
0
],
K_
[
1
],
K_
[
2
]};
Dune
::
array
<
double
,
3
>
A
=
{
A_
[
0
],
A_
[
1
],
A_
[
2
]};
RodLocalStiffness
<
GridType
,
double
>
localStiffness
(
K
,
A
);
// Strain defined on each element
// Strain defined on each element
strain
.
resize
(
indexSet
.
size
(
0
));
strain
.
resize
(
indexSet
.
size
(
0
));
strain
=
0
;
strain
=
0
;
...
@@ -1346,7 +1354,7 @@ getStrain(const std::vector<Configuration>& sol,
...
@@ -1346,7 +1354,7 @@ getStrain(const std::vector<Configuration>& sol,
=
Dune
::
LagrangeShapeFunctions
<
double
,
double
,
gridDim
>::
general
(
it
->
type
(),
elementOrder
);
=
Dune
::
LagrangeShapeFunctions
<
double
,
double
,
gridDim
>::
general
(
it
->
type
(),
elementOrder
);
int
numOfBaseFct
=
baseSet
.
size
();
int
numOfBaseFct
=
baseSet
.
size
();
Configuration
localSolution
[
numOfBaseFct
]
;
array
<
Configuration
,
2
>
localSolution
;
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
...
@@ -1362,7 +1370,7 @@ getStrain(const std::vector<Configuration>& sol,
...
@@ -1362,7 +1370,7 @@ getStrain(const std::vector<Configuration>& sol,
double
weight
=
quad
[
pt
].
weight
()
*
it
->
geometry
().
integrationElement
(
quadPos
);
double
weight
=
quad
[
pt
].
weight
()
*
it
->
geometry
().
integrationElement
(
quadPos
);
FieldVector
<
double
,
blocksize
>
localStrain
=
getStrain
(
sol
,
it
,
quad
[
pt
].
position
());
FieldVector
<
double
,
blocksize
>
localStrain
=
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
);
...
@@ -1381,94 +1389,6 @@ getStrain(const std::vector<Configuration>& sol,
...
@@ -1381,94 +1389,6 @@ getStrain(const std::vector<Configuration>& sol,
}
}
template
<
class
GridType
>
Dune
::
FieldVector
<
double
,
6
>
RodAssembler
<
GridType
>::
getStrain
(
const
std
::
vector
<
Configuration
>&
sol
,
const
EntityPointer
&
element
,
double
pos
)
const
{
using
namespace
Dune
;
if
(
!
element
->
isLeaf
())
DUNE_THROW
(
Dune
::
NotImplemented
,
"Only for leaf elements"
);
const
typename
GridType
::
Traits
::
LeafIndexSet
&
indexSet
=
grid_
->
leafIndexSet
();
if
(
sol
.
size
()
!=
indexSet
.
size
(
gridDim
))
DUNE_THROW
(
Exception
,
"Configuration vector doesn't match the grid!"
);
// Strain defined on each element
FieldVector
<
double
,
blocksize
>
strain
(
0
);
// Extract local solution on this element
const
LagrangeShapeFunctionSet
<
double
,
double
,
gridDim
>
&
baseSet
=
Dune
::
LagrangeShapeFunctions
<
double
,
double
,
gridDim
>::
general
(
element
->
type
(),
elementOrder
);
int
numOfBaseFct
=
baseSet
.
size
();
Configuration
localSolution
[
numOfBaseFct
];
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
element
,
i
)];
const
FieldMatrix
<
double
,
1
,
1
>&
inv
=
element
->
geometry
().
jacobianInverseTransposed
(
pos
);
// ///////////////////////////////////////
// Compute deformation gradient
// ///////////////////////////////////////
FieldVector
<
double
,
gridDim
>
shapeGrad
[
numOfBaseFct
];
for
(
int
dof
=
0
;
dof
<
numOfBaseFct
;
dof
++
)
{
for
(
int
i
=
0
;
i
<
gridDim
;
i
++
)
shapeGrad
[
dof
][
i
]
=
baseSet
[
dof
].
evaluateDerivative
(
0
,
i
,
pos
);
//std::cout << "Gradient " << dof << ": " << shape_grads[dof] << std::endl;
// multiply with jacobian inverse
FieldVector
<
double
,
gridDim
>
tmp
(
0
);
inv
.
umv
(
shapeGrad
[
dof
],
tmp
);
shapeGrad
[
dof
]
=
tmp
;
//std::cout << "Gradient " << dof << ": " << shape_grads[dof] << std::endl;
}
// //////////////////////////////////
// Interpolate
// //////////////////////////////////
FieldVector
<
double
,
3
>
r_s
;
r_s
[
0
]
=
localSolution
[
0
].
r
[
0
]
*
shapeGrad
[
0
][
0
]
+
localSolution
[
1
].
r
[
0
]
*
shapeGrad
[
1
][
0
];
r_s
[
1
]
=
localSolution
[
0
].
r
[
1
]
*
shapeGrad
[
0
][
0
]
+
localSolution
[
1
].
r
[
1
]
*
shapeGrad
[
1
][
0
];
r_s
[
2
]
=
localSolution
[
0
].
r
[
2
]
*
shapeGrad
[
0
][
0
]
+
localSolution
[
1
].
r
[
2
]
*
shapeGrad
[
1
][
0
];
// Interpolate the rotation at the quadrature point
Quaternion
<
double
>
q
=
Quaternion
<
double
>::
interpolate
(
localSolution
[
0
].
q
,
localSolution
[
1
].
q
,
pos
);
// Get the derivative of the rotation at the quadrature point by interpolating in $H$
Quaternion
<
double
>
q_s
=
Quaternion
<
double
>::
interpolateDerivative
(
localSolution
[
0
].
q
,
localSolution
[
1
].
q
,
pos
,
1
/
shapeGrad
[
1
]);
// /////////////////////////////////////////////
// Sum it all up
// /////////////////////////////////////////////
// Part I: the shearing and stretching strain
//std::cout << "tangent : " << r_s << std::endl;
strain
[
0
]
=
r_s
*
q
.
director
(
0
);
// shear strain
strain
[
1
]
=
r_s
*
q
.
director
(
1
);
// shear strain
strain
[
2
]
=
r_s
*
q
.
director
(
2
);
// stretching strain
//std::cout << "strain : " << v << std::endl;
// Part II: the Darboux vector
FieldVector
<
double
,
3
>
u
=
darboux
(
q
,
q_s
);
strain
[
3
]
=
u
[
0
];
strain
[
4
]
=
u
[
1
];
strain
[
5
]
=
u
[
2
];
return
strain
;
}
template
<
class
GridType
>
template
<
class
GridType
>
Dune
::
FieldVector
<
double
,
3
>
RodAssembler
<
GridType
>::
Dune
::
FieldVector
<
double
,
3
>
RodAssembler
<
GridType
>::
getResultantForce
(
const
BoundaryPatch
<
GridType
>&
boundary
,
getResultantForce
(
const
BoundaryPatch
<
GridType
>&
boundary
,
...
...
This diff is collapsed.
Click to expand it.
src/rodassembler.hh
+
0
−
6
View file @
c0d389f8
...
@@ -270,12 +270,6 @@ public:
...
@@ -270,12 +270,6 @@ public:
void
getStrain
(
const
std
::
vector
<
Configuration
>&
sol
,
void
getStrain
(
const
std
::
vector
<
Configuration
>&
sol
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
strain
)
const
;
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
blocksize
>
>&
strain
)
const
;
/** \brief Get the strain at a particular point of the grid */
Dune
::
FieldVector
<
double
,
6
>
getStrain
(
const
std
::
vector
<
Configuration
>&
sol
,
const
EntityPointer
&
element
,
double
pos
)
const
;
/** \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 */
...
...
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