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
fc05d1b4
Commit
fc05d1b4
authored
13 years ago
by
Bastien Gorissen
Browse files
Options
Downloads
Patches
Plain Diff
Added Legendre polynomials (preparation for Bergot basis for pyramids)
parent
8f9c9ae0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Numeric/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Numeric/CMakeLists.txt
Numeric/legendrePolynomials.cpp
+34
-0
34 additions, 0 deletions
Numeric/legendrePolynomials.cpp
Numeric/legendrePolynomials.h
+21
-0
21 additions, 0 deletions
Numeric/legendrePolynomials.h
with
56 additions
and
0 deletions
Numeric/CMakeLists.txt
+
1
−
0
View file @
fc05d1b4
...
@@ -9,6 +9,7 @@ set(SRC
...
@@ -9,6 +9,7 @@ set(SRC
polynomialBasis.cpp
polynomialBasis.cpp
JacobianBasis.cpp
JacobianBasis.cpp
jacobiPolynomials.cpp
jacobiPolynomials.cpp
legendrePolynomials.cpp
GaussIntegration.cpp
GaussIntegration.cpp
GaussQuadratureLin.cpp
GaussQuadratureLin.cpp
GaussQuadratureTri.cpp
GaussQuadratureTri.cpp
...
...
This diff is collapsed.
Click to expand it.
Numeric/legendrePolynomials.cpp
0 → 100644
+
34
−
0
View file @
fc05d1b4
#include
"legendrePolynomials.h"
LegendrePolynomials
::
LegendrePolynomials
(
int
o
)
:
n
(
o
)
{}
LegendrePolynomials
::~
LegendrePolynomials
()
{;}
void
LegendrePolynomials
::
f
(
double
u
,
double
*
val
)
const
{
val
[
0
]
=
1
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
double
a1i
=
i
+
1
;
double
a3i
=
2.
*
i
+
1
;
double
a4i
=
i
;
val
[
i
+
1
]
=
a3i
*
u
*
val
[
i
];
if
(
i
>
0
)
val
[
i
+
1
]
-=
a4i
*
val
[
i
-
1
];
val
[
i
+
1
]
/=
a1i
;
}
}
void
LegendrePolynomials
::
df
(
double
u
,
double
*
val
)
const
{
double
tmp
[
n
+
1
];
f
(
u
,
tmp
);
val
[
0
]
=
0
;
double
g2
=
(
1.
-
u
*
u
);
for
(
int
i
=
1
;
i
<=
n
;
i
++
)
{
double
g1
=
-
u
*
i
;
double
g0
=
(
double
)
i
;
val
[
i
]
=
(
g1
*
tmp
[
i
]
+
g0
*
tmp
[
i
-
1
])
/
g2
;
}
}
This diff is collapsed.
Click to expand it.
Numeric/legendrePolynomials.h
0 → 100644
+
21
−
0
View file @
fc05d1b4
#ifndef LEGENDREPOLYNOMIALS_H
#define LEGENDREPOLYNOMIALS_H
#include
"fullMatrix.h"
class
LegendrePolynomials
{
public:
LegendrePolynomials
(
int
o
);
~
LegendrePolynomials
();
void
f
(
double
u
,
double
*
val
)
const
;
void
df
(
double
u
,
double
*
val
)
const
;
private:
int
n
;
};
#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