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
304e015a
Commit
304e015a
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
factor out grid creation into a separate method
[[Imported from SVN: r8402]]
parent
6c6aafa4
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
test/cosseratenergytest.cc
+29
-37
29 additions, 37 deletions
test/cosseratenergytest.cc
with
29 additions
and
37 deletions
test/cosseratenergytest.cc
+
29
−
37
View file @
304e015a
...
@@ -24,6 +24,33 @@ typedef RigidBodyMotion<double,3> TargetSpace;
...
@@ -24,6 +24,33 @@ typedef RigidBodyMotion<double,3> TargetSpace;
using
namespace
Dune
;
using
namespace
Dune
;
// ////////////////////////////////////////////////////////
// Make a test grid consisting of a single simplex
// ////////////////////////////////////////////////////////
template
<
class
GridType
>
std
::
auto_ptr
<
GridType
>
makeSingleSimplexGrid
()
{
static
const
int
domainDim
=
GridType
::
dimension
;
GridFactory
<
GridType
>
factory
;
FieldVector
<
double
,
dim
>
pos
(
0
);
factory
.
insertVertex
(
pos
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
{
pos
=
0
;
pos
[
i
]
=
1
;
factory
.
insertVertex
(
pos
);
}
std
::
vector
<
unsigned
int
>
v
(
domainDim
+
1
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
v
[
i
]
=
i
;
factory
.
insertElement
(
GeometryType
(
GeometryType
::
simplex
,
dim
),
v
);
return
std
::
auto_ptr
<
GridType
>
(
factory
.
createGrid
());
}
template
<
int
domainDim
,
class
LocalFiniteElement
>
template
<
int
domainDim
,
class
LocalFiniteElement
>
Tensor3
<
double
,
3
,
3
,
3
>
evaluateDerivativeFD
(
const
LocalGeodesicFEFunction
<
domainDim
,
double
,
LocalFiniteElement
,
TargetSpace
>&
f
,
Tensor3
<
double
,
3
,
3
,
3
>
evaluateDerivativeFD
(
const
LocalGeodesicFEFunction
<
domainDim
,
double
,
LocalFiniteElement
,
TargetSpace
>&
f
,
...
@@ -185,24 +212,7 @@ void testFrameInvariance()
...
@@ -185,24 +212,7 @@ void testFrameInvariance()
// ////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////
typedef
UGGrid
<
domainDim
>
GridType
;
typedef
UGGrid
<
domainDim
>
GridType
;
const
std
::
auto_ptr
<
GridType
>
grid
=
makeSingleSimplexGrid
<
GridType
>
();
GridFactory
<
GridType
>
factory
;
FieldVector
<
double
,
dim
>
pos
(
0
);
factory
.
insertVertex
(
pos
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
{
pos
=
0
;
pos
[
i
]
=
1
;
factory
.
insertVertex
(
pos
);
}
std
::
vector
<
unsigned
int
>
v
(
domainDim
+
1
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
v
[
i
]
=
i
;
factory
.
insertElement
(
GeometryType
(
GeometryType
::
simplex
,
dim
),
v
);
const
std
::
auto_ptr
<
GridType
>
grid
(
factory
.
createGrid
());
// //////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////
// Test whether the energy is invariant under isometries
// Test whether the energy is invariant under isometries
...
@@ -239,26 +249,8 @@ void testEnergyGradient()
...
@@ -239,26 +249,8 @@ void testEnergyGradient()
// ////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////
typedef
UGGrid
<
domainDim
>
GridType
;
typedef
UGGrid
<
domainDim
>
GridType
;
const
std
::
auto_ptr
<
GridType
>
grid
=
makeSingleSimplexGrid
<
GridType
>
();
GridFactory
<
GridType
>
factory
;
FieldVector
<
double
,
dim
>
pos
(
0
);
factory
.
insertVertex
(
pos
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
{
pos
=
0
;
pos
[
i
]
=
1
;
factory
.
insertVertex
(
pos
);
}
std
::
vector
<
unsigned
int
>
v
(
domainDim
+
1
);
for
(
int
i
=
0
;
i
<
domainDim
+
1
;
i
++
)
v
[
i
]
=
i
;
factory
.
insertElement
(
GeometryType
(
GeometryType
::
simplex
,
dim
),
v
);
const
std
::
auto_ptr
<
GridType
>
grid
(
factory
.
createGrid
());
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Create a local assembler object
// Create a local assembler object
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
...
...
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