Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-geometry
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
Service Desk
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
Core Modules
dune-geometry
Commits
be098628
Commit
be098628
authored
10 years ago
by
Ansgar Burchardt
Committed by
Oliver Sander
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
test local() and global() outside the reference element
parent
895d647f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/geometry/test/test-multilineargeometry.cc
+34
-0
34 additions, 0 deletions
dune/geometry/test/test-multilineargeometry.cc
with
34 additions
and
0 deletions
dune/geometry/test/test-multilineargeometry.cc
+
34
−
0
View file @
be098628
...
...
@@ -220,6 +220,23 @@ static bool testNonLinearGeometry()
}
}
/* Test global() outside reference element */
{
Vector
local
;
local
[
0
]
=
-
1
;
local
[
1
]
=
0
;
Vector
global
;
global
[
0
]
=
-
2
;
global
[
1
]
=
0
;
const
Vector
global2
(
geometry
.
global
(
local
));
if
(
global2
!=
global2
)
{
std
::
cerr
<<
"global failed outside reference element: returned NaN: "
<<
global2
<<
std
::
endl
;
pass
=
false
;
}
if
((
global
-
global2
).
two_norm
()
>
epsilon
)
{
std
::
cerr
<<
"global failed outside reference element: got "
<<
global2
<<
", but expected "
<<
global
<<
std
::
endl
;
pass
=
false
;
}
}
/* Test local() */
for
(
std
::
size_t
c
=
0
;
c
<
corners
.
size
();
++
c
)
{
const
Vector
&
local
(
reference
.
position
(
c
,
dim
));
...
...
@@ -236,6 +253,23 @@ static bool testNonLinearGeometry()
}
}
/* Test local() outside reference element */
{
Vector
global
;
global
[
0
]
=
-
2
;
global
[
1
]
=
0
;
Vector
local
;
local
[
0
]
=
-
1
;
local
[
1
]
=
0
;
const
Vector
local2
(
geometry
.
local
(
global
));
if
(
local2
!=
local2
)
{
std
::
cerr
<<
"local failed outside reference element: returned NaN: "
<<
local2
<<
std
::
endl
;
pass
=
false
;
}
if
((
local
-
local2
).
two_norm
()
>
epsilon
)
{
std
::
cerr
<<
"local failed outside reference element: got "
<<
local2
<<
", but expected "
<<
local
<<
std
::
endl
;
pass
=
false
;
}
}
std
::
cout
<<
(
pass
?
"passed"
:
"failed"
)
<<
std
::
endl
;
return
pass
;
}
...
...
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