13
13
import tempfile
14
14
from abc import ABC
15
15
from .ceed_vector import Vector
16
- from .ceed_basis import BasisTensorH1 , BasisTensorH1Lagrange , BasisH1
16
+ from .ceed_basis import BasisTensorH1 , BasisTensorH1Lagrange , BasisH1 , BasisHdiv , BasisHcurl
17
17
from .ceed_elemrestriction import ElemRestriction , StridedElemRestriction , BlockedElemRestriction , BlockedStridedElemRestriction
18
18
from .ceed_qfunction import QFunction , QFunctionByName , IdentityQFunction
19
19
from .ceed_qfunctioncontext import QFunctionContext
@@ -356,7 +356,7 @@ def BasisH1(self, topo, ncomp, nnodes, nqpts, interp, grad, qref, qweight):
356
356
*interp: Numpy array holding the row-major (nqpts * nnodes) matrix
357
357
expressing the values of nodal basis functions at
358
358
quadrature points
359
- *grad: Numpy array holding the row-major (nqpts * dim * nnodes)
359
+ *grad: Numpy array holding the row-major (dim * nqpts * nnodes)
360
360
matrix expressing the derivatives of nodal basis functions
361
361
at quadrature points
362
362
*qref: Numpy array of length (nqpts * dim) holding the locations of
@@ -370,6 +370,59 @@ def BasisH1(self, topo, ncomp, nnodes, nqpts, interp, grad, qref, qweight):
370
370
return BasisH1 (self , topo , ncomp , nnodes , nqpts ,
371
371
interp , grad , qref , qweight )
372
372
373
+ def BasisHdiv (self , topo , ncomp , nnodes , nqpts , interp , div , qref , qweight ):
374
+ """Ceed Hdiv Basis: finite element non tensor-product basis for H(div)
375
+ discretizations.
376
+
377
+ Args:
378
+ topo: topology of the element, e.g. hypercube, simplex, etc
379
+ ncomp: number of field components (1 for scalar fields)
380
+ nnodes: total number of nodes
381
+ nqpts: total number of quadrature points
382
+ *interp: Numpy array holding the row-major (dim * nqpts * nnodes)
383
+ matrix expressing the values of basis functions at
384
+ quadrature points
385
+ *div: Numpy array holding the row-major (nqpts * nnodes) matrix
386
+ expressing the divergence of basis functions at
387
+ quadrature points
388
+ *qref: Numpy array of length (nqpts * dim) holding the locations of
389
+ quadrature points on the reference element [-1, 1]
390
+ *qweight: Numpy array of length nnodes holding the quadrature
391
+ weights on the reference element
392
+
393
+ Returns:
394
+ basis: Ceed Basis"""
395
+
396
+ return BasisHdiv (self , topo , ncomp , nnodes , nqpts ,
397
+ interp , div , qref , qweight )
398
+
399
+ def BasisHcurl (self , topo , ncomp , nnodes , nqpts ,
400
+ interp , curl , qref , qweight ):
401
+ """Ceed Hcurl Basis: finite element non tensor-product basis for H(curl)
402
+ discretizations.
403
+
404
+ Args:
405
+ topo: topology of the element, e.g. hypercube, simplex, etc
406
+ ncomp: number of field components (1 for scalar fields)
407
+ nnodes: total number of nodes
408
+ nqpts: total number of quadrature points
409
+ *interp: Numpy array holding the row-major (dim * nqpts * nnodes)
410
+ matrix expressing the values of basis functions at
411
+ quadrature points
412
+ *curl: Numpy array holding the row-major (curlcomp * nqpts * nnodes),
413
+ curlcomp = 1 if dim < 3 else dim, matrix expressing the curl
414
+ of basis functions at quadrature points
415
+ *qref: Numpy array of length (nqpts * dim) holding the locations of
416
+ quadrature points on the reference element [-1, 1]
417
+ *qweight: Numpy array of length nnodes holding the quadrature
418
+ weights on the reference element
419
+
420
+ Returns:
421
+ basis: Ceed Basis"""
422
+
423
+ return BasisHcurl (self , topo , ncomp , nnodes , nqpts ,
424
+ interp , curl , qref , qweight )
425
+
373
426
# CeedQFunction
374
427
def QFunction (self , vlength , f , source ):
375
428
"""Ceed QFunction: point-wise operation at quadrature points for
0 commit comments