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,58 @@ 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 , interp , curl , qref , qweight ):
400
+ """Ceed Hcurl Basis: finite element non tensor-product basis for H(curl)
401
+ discretizations.
402
+
403
+ Args:
404
+ topo: topology of the element, e.g. hypercube, simplex, etc
405
+ ncomp: number of field components (1 for scalar fields)
406
+ nnodes: total number of nodes
407
+ nqpts: total number of quadrature points
408
+ *interp: Numpy array holding the row-major (dim * nqpts * nnodes)
409
+ matrix expressing the values of basis functions at
410
+ quadrature points
411
+ *curl: Numpy array holding the row-major (curlcomp * nqpts * nnodes),
412
+ curlcomp = 1 if dim < 3 else dim, matrix expressing the curl
413
+ of basis functions at quadrature points
414
+ *qref: Numpy array of length (nqpts * dim) holding the locations of
415
+ quadrature points on the reference element [-1, 1]
416
+ *qweight: Numpy array of length nnodes holding the quadrature
417
+ weights on the reference element
418
+
419
+ Returns:
420
+ basis: Ceed Basis"""
421
+
422
+ return BasisHcurl (self , topo , ncomp , nnodes , nqpts ,
423
+ interp , curl , qref , qweight )
424
+
373
425
# CeedQFunction
374
426
def QFunction (self , vlength , f , source ):
375
427
"""Ceed QFunction: point-wise operation at quadrature points for
0 commit comments