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
a7b9c21d
Commit
a7b9c21d
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
compile and run again after recent interface changes
[[Imported from SVN: r7996]]
parent
fb6d9096
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cosseratenergytest.cc
+17
-23
17 additions, 23 deletions
test/cosseratenergytest.cc
with
17 additions
and
23 deletions
test/cosseratenergytest.cc
+
17
−
23
View file @
a7b9c21d
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
#include
<dune/grid/uggrid.hh>
#include
<dune/grid/uggrid.hh>
#include
<dune/
gfe/rigidbodymotion
.hh>
#include
<dune/
localfunctions/lagrange/pqkfactory
.hh>
#include
<dune/gfe/rigidbodymotion.hh>
#include
<dune/gfe/cosseratenergystiffness.hh>
#include
<dune/gfe/cosseratenergystiffness.hh>
#include
"multiindex.hh"
#include
"multiindex.hh"
...
@@ -56,9 +57,9 @@ void testEnergy(const GridType* grid, const std::vector<TargetSpace>& coefficien
...
@@ -56,9 +57,9 @@ void testEnergy(const GridType* grid, const std::vector<TargetSpace>& coefficien
#endif
#endif
template
<
int
domainDim
>
template
<
int
domainDim
,
class
LocalFiniteElement
>
Tensor3
<
double
,
3
,
3
,
3
>
evaluateDerivativeFD
(
const
LocalGeodesicFEFunction
<
domainDim
,
double
,
TargetSpace
>&
f
,
Tensor3
<
double
,
3
,
3
,
3
>
evaluateDerivativeFD
(
const
LocalGeodesicFEFunction
<
domainDim
,
double
,
LocalFiniteElement
,
TargetSpace
>&
f
,
const
Dune
::
FieldVector
<
double
,
domainDim
>&
local
)
const
Dune
::
FieldVector
<
double
,
domainDim
>&
local
)
{
{
Tensor3
<
double
,
3
,
3
,
3
>
result
(
0
);
Tensor3
<
double
,
3
,
3
,
3
>
result
(
0
);
...
@@ -90,10 +91,16 @@ Tensor3<double,3,3,3> evaluateDerivativeFD(const LocalGeodesicFEFunction<domainD
...
@@ -90,10 +91,16 @@ Tensor3<double,3,3,3> evaluateDerivativeFD(const LocalGeodesicFEFunction<domainD
}
}
template
<
int
domainDim
>
template
<
int
domainDim
>
void
testDerivativeOfRotationMatrix
(
const
array
<
TargetSpace
,
dim
+
1
>&
corners
)
void
testDerivativeOfRotationMatrix
(
const
std
::
vector
<
TargetSpace
>&
corners
)
{
{
// Make local fe function to be tested
// Make local fe function to be tested
LocalGeodesicFEFunction
<
domainDim
,
double
,
TargetSpace
>
f
(
corners
);
PQkLocalFiniteElementCache
<
double
,
double
,
domainDim
,
1
>
feCache
;
typedef
typename
PQkLocalFiniteElementCache
<
double
,
double
,
domainDim
,
1
>::
FiniteElementType
LocalFiniteElement
;
GeometryType
simplex
;
simplex
.
makeSimplex
(
domainDim
);
LocalGeodesicFEFunction
<
domainDim
,
double
,
LocalFiniteElement
,
TargetSpace
>
f
(
feCache
.
get
(
simplex
),
corners
);
// A quadrature rule as a set of test points
// A quadrature rule as a set of test points
int
quadOrder
=
3
;
int
quadOrder
=
3
;
...
@@ -106,10 +113,10 @@ void testDerivativeOfRotationMatrix(const array<TargetSpace,dim+1>& corners)
...
@@ -106,10 +113,10 @@ void testDerivativeOfRotationMatrix(const array<TargetSpace,dim+1>& corners)
const
Dune
::
FieldVector
<
double
,
domainDim
>&
quadPos
=
quad
[
pt
].
position
();
const
Dune
::
FieldVector
<
double
,
domainDim
>&
quadPos
=
quad
[
pt
].
position
();
// evaluate actual derivative
// evaluate actual derivative
Dune
::
FieldMatrix
<
double
,
TargetSpace
::
EmbeddedTangentVector
::
size
,
domainDim
>
derivative
=
f
.
evaluateDerivative
(
quadPos
);
Dune
::
FieldMatrix
<
double
,
TargetSpace
::
EmbeddedTangentVector
::
dimension
,
domainDim
>
derivative
=
f
.
evaluateDerivative
(
quadPos
);
Tensor3
<
double
,
3
,
3
,
3
>
DR
;
Tensor3
<
double
,
3
,
3
,
3
>
DR
;
CosseratEnergyLocalStiffness
<
typename
UGGrid
<
domainDim
>::
LeafGridView
,
3
>::
computeDR
(
f
.
evaluate
(
quadPos
),
derivative
,
DR
);
CosseratEnergyLocalStiffness
<
typename
UGGrid
<
domainDim
>::
LeafGridView
,
LocalFiniteElement
,
3
>::
computeDR
(
f
.
evaluate
(
quadPos
),
derivative
,
DR
);
//std::cout << "DR:\n" << DR << std::endl;
//std::cout << "DR:\n" << DR << std::endl;
...
@@ -137,30 +144,17 @@ void testDerivativeOfRotationMatrix(const array<TargetSpace,dim+1>& corners)
...
@@ -137,30 +144,17 @@ void testDerivativeOfRotationMatrix(const array<TargetSpace,dim+1>& corners)
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
array
<
double
,
4
>
coords
=
{
0
,
0
,
1
,
0
};
UnitVector
<
4
>
uv
(
coords
);
Rotation
<
3
,
double
>
ro
(
coords
);
FieldVector
<
double
,
4
>
v
(
0
);
v
[
1
]
=
1
;
UnitVector
<
4
>
uv_c
=
UnitVector
<
4
>::
exp
(
uv
,
v
);
Rotation
<
3
,
double
>
ro_c
=
Rotation
<
3
,
double
>::
exp
(
ro
,
v
);
std
::
cout
<<
"uv_c: "
<<
uv_c
<<
std
::
endl
;
std
::
cout
<<
"ro_c: "
<<
ro_c
<<
std
::
endl
;
exit
(
0
);
const
int
domainDim
=
2
;
const
int
domainDim
=
2
;
std
::
cout
<<
" --- Testing Rotation<3>, domain dimension: "
<<
domainDim
<<
" ---"
<<
std
::
endl
;
std
::
cout
<<
" --- Testing Rotation<3>, domain dimension: "
<<
domainDim
<<
" ---"
<<
std
::
endl
;
std
::
vector
<
Rotation
<
3
,
double
>
>
testPoints
;
std
::
vector
<
Rotation
<
3
,
double
>
>
testPoints
;
ValueFactory
<
Rotation
<
3
,
double
>
>::
get
(
testPoints
);
ValueFactory
<
Rotation
<
3
,
double
>
>::
get
(
testPoints
);
int
nTestPoints
=
testPoints
.
size
();
int
nTestPoints
=
testPoints
.
size
();
// Set up elements of SO(3)
// Set up elements of SO(3)
array
<
TargetSpace
,
domainDim
+
1
>
corners
;
std
::
vector
<
TargetSpace
>
corners
(
domainDim
+
1
)
;
MultiIndex
<
domainDim
+
1
>
index
(
nTestPoints
);
MultiIndex
<
domainDim
+
1
>
index
(
nTestPoints
);
int
numIndices
=
index
.
cycle
();
int
numIndices
=
index
.
cycle
();
...
...
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