Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93727903
quadrature_points.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 1, 00:43
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Dec 3, 00:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22694867
Attached To
R6746 RationalROMPy
quadrature_points.py
View Options
# Copyright (C) 2018-2020 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RROMPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
import
numpy
as
np
from
rrompy.utilities.base.types
import
Np1D
from
rrompy.utilities.exception_manager
import
RROMPyException
__all__
=
[
'quadraturePointsGenerate'
]
def
quadraturePointsGenerate
(
n
:
int
,
kind
:
str
)
->
Np1D
:
kind
=
kind
.
upper
()
if
kind
==
"UNIFORM"
:
x
=
np
.
linspace
(
-
1.
,
1.
,
n
)
elif
kind
[
-
9
:]
==
"CHEBYSHEV"
:
x
=
np
.
cos
(
np
.
pi
*
np
.
linspace
(
1.
-
.
5
/
n
,
.
5
/
n
,
n
))
elif
kind
[
-
13
:]
==
"GAUSSLEGENDRE"
:
x
=
np
.
polynomial
.
legendre
.
leggauss
(
n
)[
0
]
elif
kind
==
"CLENSHAWCURTIS"
:
x
=
np
.
cos
(
np
.
pi
*
np
.
linspace
(
1.
,
0.
,
n
))
if
n
>
1
else
np
.
zeros
(
n
)
else
:
raise
RROMPyException
(
"Quadrature kind not recognized."
)
if
n
>
1
and
kind
[:
8
]
==
"EXTENDED"
:
x
/=
x
[
-
1
]
return
x
Event Timeline
Log In to Comment