117
112
self.polys = polys
118
113
self.DIM = len(self.polys)
120
def Quadrature(self, Ns, quadTypes=None,left=None,right=None,end=None, normed=False, warnings=True):
115
def Quadrature(self, Ns, quadTypes=None,left=None,right=None,end=None, norm=True, warnings=True):
122
117
GaussQuadrature(): computes the tensor product of the Guass Points and weights
125
``(x,w) = GaussQuadrature(Ns, [quadTypes=None], [normed=False],[warnings=True])``
120
``(x,w) = GaussQuadrature(Ns, [quadTypes=None], [norm=True],[warnings=True])``
128
123
* ``Ns`` = (list,int) n-dimensional list with the order of approximation of each polynomial
130
125
* ``left``: (list,float) list of left values used by ORTHPOL for Gauss-Lobatto rules (the dimensions where the value is not used can be set to anything)
131
126
* ``right``: (list,float) list of left values used by ORTHPOL for Gauss-Lobatto rules (the dimensions where the value is not used can be set to anything)
132
127
* ``end``: (list,float) list of left values used by ORTHPOL for Gauss-Radau rules (the dimensions where the value is not used can be set to anything)
133
* ``normed`` = (optional,boolean) whether the weights will be normalized or not
128
* ``norm`` = (optional,boolean) whether the weights will be normalized or not
134
129
* ``warnings`` = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
195
x,w = self.polys[0].Quadrature(Ns[0],quadType=quadTypes[0],left=left[0],right=right[0],end=end[0],normed=normed)
190
x,w = self.polys[0].Quadrature(Ns[0],quadType=quadTypes[0],left=left[0],right=right[0],end=end[0],norm=norm)
198
193
for i in range(1,self.DIM):
199
x,w = self.polys[i].Quadrature(Ns[i],quadType=quadTypes[i],left=left[i],right=right[i],end=end[i],normed=normed)
194
x,w = self.polys[i].Quadrature(Ns[i],quadType=quadTypes[i],left=left[i],right=right[i],end=end[i],norm=norm)
200
195
wKron = np.kron(wKron, w)
202
197
xKron = np.asarray(list(itertools.product(*xs)))
204
199
return (xKron, wKron)
206
def GaussQuadrature(self, Ns, normed=False, warnings=True):
201
def GaussQuadrature(self, Ns, norm=True, warnings=True):
208
203
GaussQuadrature(): computes the tensor product of the Guass Points and weights
211
``(x,w) = GaussQuadrature(Ns, [normed=False],[warnings=True])``
206
``(x,w) = GaussQuadrature(Ns, [norm=True],[warnings=True])``
214
209
* ``Ns`` = (list,int) n-dimensional list with the order of approximation of each polynomial
215
* ``normed`` = (optional,boolean) whether the weights will be normalized or not
210
* ``norm`` = (optional,boolean) whether the weights will be normalized or not
216
211
* ``warnings`` = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
260
x,w = self.polys[0].GaussQuadrature(Ns[0],normed=normed)
255
x,w = self.polys[0].GaussQuadrature(Ns[0],norm=norm)
263
258
for i in range(1,self.DIM):
264
x,w = self.polys[i].GaussQuadrature(Ns[i],normed=normed)
259
x,w = self.polys[i].GaussQuadrature(Ns[i],norm=norm)
265
260
wKron = np.kron(wKron, w)
267
262
xKron = np.asarray(list(itertools.product(*xs)))
269
264
return (xKron, wKron)
271
def GaussLobattoQuadrature(self, Ns, normed=False, warnings=True):
266
def GaussLobattoQuadrature(self, Ns, norm=True, warnings=True):
273
268
GaussLobattoQuadrature(): computes the tensor product of the Guass Lobatto Points and weights
276
``(x,w) = GaussLobattoQuadrature(Ns,[normed=False],[warnings=True])``
271
``(x,w) = GaussLobattoQuadrature(Ns,[norm=True],[warnings=True])``
279
274
* ``Ns`` = (list,int) n-dimensional list with the order of approximation of each polynomial
280
* ``normed`` = (optional,boolean) whether the weights will be normalized or not
275
* ``norm`` = (optional,boolean) whether the weights will be normalized or not
281
276
* ``warnings`` = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory