Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
ab9d7155
Commit
ab9d7155
authored
10 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
added missing files
parent
e364cc21
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Numeric/approximationError.cpp
+26
-0
26 additions, 0 deletions
Numeric/approximationError.cpp
Numeric/approximationError.h
+10
-0
10 additions, 0 deletions
Numeric/approximationError.h
with
36 additions
and
0 deletions
Numeric/approximationError.cpp
0 → 100644
+
26
−
0
View file @
ab9d7155
#include
"approximationError.h"
#include
"MElement.h"
double
approximationError
(
simpleFunction
<
double
>
&
f
,
MElement
*
e
)
{
double
VALS
[
e
->
getNumVertices
()];
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
){
MVertex
*
v
=
e
->
getVertex
(
i
);
VALS
[
i
]
=
f
(
v
->
x
(),
v
->
y
(),
v
->
z
());
}
int
npts
;
IntPt
*
pts
;
e
->
getIntegrationPoints
(
2
*
e
->
getPolynomialOrder
()
+
2
,
&
npts
,
&
pts
);
double
errSqr
=
0.0
;
for
(
int
k
=
0
;
k
<
npts
;
k
++
){
const
double
u
=
pts
[
k
].
pt
[
0
];
const
double
v
=
pts
[
k
].
pt
[
1
];
const
double
w
=
pts
[
k
].
pt
[
2
];
SPoint3
p
;
e
->
pnt
(
u
,
v
,
w
,
p
);
const
double
Jac
=
e
->
getJacobianDeterminant
(
u
,
v
,
w
);
const
double
C
=
e
->
interpolate
(
VALS
,
u
,
v
,
w
);
const
double
F
=
f
(
p
.
x
(),
p
.
y
(),
p
.
z
());
const
double
DIFF
=
C
-
F
;
errSqr
+=
pts
[
k
].
weight
*
Jac
*
(
DIFF
*
DIFF
);
}
return
sqrt
(
errSqr
);
}
This diff is collapsed.
Click to expand it.
Numeric/approximationError.h
0 → 100644
+
10
−
0
View file @
ab9d7155
#ifndef _APPROXIMATION_ERROR_
#define _APPROXIMATION_ERROR_
#include
<map>
#include
"simpleFunction.h"
class
MElement
;
// computes E such as
// E^2 = \int_e [C_e(f) - f]^2 de
// where C_e(f) is clement's interpolation operator of f on e
double
approximationError
(
simpleFunction
<
double
>
&
f
,
MElement
*
e
)
;
#endif
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