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
I'm trying to use FindPointsGSLIB class within PyMFEM. One function I need to use is FindPointsGSLIB::GetCode(), which returns mfem::Array<unsigned int> according to the definition.
In PyMFEM, this function only returns a SwigPyObject that is not associated with any mfem class. For example, I added three lines of code on line 199 of miniapps/gslib/field_interp.py:
The output object does not have any attribute related to mfem::Array<unsigned int>. What is the proper way to use the function FindPointsGSLIB::GetCode()?
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. It tooked (very) long to address this. This is is going to be resolved in PyMFEM4.6 (#204).
- wrappers for Array<char>, Array<long long>, and Array<unsigned char> are added as
uintArray, int8Array, int64Array.
- Since Array<unsigned int> is not explicitly instantiated in Array.cpp, thus some
method such as Print, Sort etc are not avaialbe. As a workaround, GetDataArray is
added to return a numpy array view of underlying memory section.
>>> v = mfem.uintArray(10)
>>> v.GetDataArray()[:] = (1, 105, 20, 3, 50, 4, 2, 15, 8)
>>> v.GetDataArray()[:] = np.sort(a.GetDataArray())
>>> v.ToList()
[1, 2, 3, 4, 8, 15, 20, 50, 105, 300]
Hello,
I'm trying to use
FindPointsGSLIB
class within PyMFEM. One function I need to use isFindPointsGSLIB::GetCode()
, which returnsmfem::Array<unsigned int>
according to the definition.In PyMFEM, this function only returns a
SwigPyObject
that is not associated with any mfem class. For example, I added three lines of code on line 199 ofminiapps/gslib/field_interp.py
:The resulting output is:
The output object does not have any attribute related to
mfem::Array<unsigned int>
. What is the proper way to use the functionFindPointsGSLIB::GetCode()
?The text was updated successfully, but these errors were encountered: