You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I have been trying to implement a PWMatrixCoefficient but I am having trouble with the interface (also couldn't find an example for this). The goal is to assign a MatrixConstantCoefficient per mesh attribute.
In normal MFEM (C++) this is done by creating an Array Array<MatrixCoefficient *> coefs(0); and then assigning the matrix coefficients. I thought that PyMFEM can interpret normal lists of tuples as list-equivalents, i.e., I tried something like this:
sigma_all_coefs= []
sigma_attr=mfem.intArray(max_attr)
forti,tensorinenumerate(sigma_all):
# just for testingtemp=mfem.DenseMatrix(dim)
temp.Assign(0.0)
# add matrix coefficient to listsigma_all_coefs.append(mfem.MatrixConstantCoefficient(temp) )
sigma_attr[ti] =ti+1# Create PW Matrix CoefficientsigmaCoef=mfem.PWMatrixCoefficient(dim, sigma_attr, sigma_all_coefs, False)
which fails when calling the mfem.PWMatrixCoefficient constructor. Also tried another approach:
Hi all,
I have been trying to implement a
PWMatrixCoefficient
but I am having trouble with the interface (also couldn't find an example for this). The goal is to assign aMatrixConstantCoefficient
per mesh attribute.In normal MFEM (C++) this is done by creating an Array
Array<MatrixCoefficient *> coefs(0);
and then assigning the matrix coefficients. I thought that PyMFEM can interpret normal lists of tuples as list-equivalents, i.e., I tried something like this:which fails when calling the
mfem.PWMatrixCoefficient
constructor. Also tried another approach:which fails when attempting to assemble a bilinear operator, that utilizes the
PWMatrixCoefficient
.Any thoughts on how this could be achieved?
Big thanks and warm regards,
Mathias
The text was updated successfully, but these errors were encountered: