Binding PyMOR and NGSolve for non-homogeneous Dirichlet data with complex number #2251
Unanswered
CheLamVien
asked this question in
Q&A
Replies: 1 comment 1 reply
-
in the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to build a fom in PyMOR from my model in NGSolve.
I solve the problem at different frequencies, so the only parameter is the frequency.
For the Laplace equation, Linear form has to be zero, so I have to homogenize the problem for non-homogeneous (non-zero) Dirichlet data as described in the https://docu.ngsolve.org/latest/i-tutorials/unit-1.3-dirichlet/dirichlet.html. Moreover, I would like to use the iterative solver in NGSolve.
Therefore, I have modified
_prepare_apply
and_real_apply_inverse_one_vector
from https://github.com/pymor/pymor/blob/main/src/pymor/bindings/ngsolve.py as:and
The binding between NGSolve and PyMOR is as follow:
However, the results from NGSolve models and FOM-PyMOR model were not the same.
gfu = fom.solve([freq]).vectors[0].real_part.impl
the right method to convert PyMOR solution to GridFunction in NGSolve, as I want to do more calculations based on the solutions.F.vectors[0].real_part.impl.vec.data = rhs
. Do I need to modify this line of code when working with the complex numbers. (Note:F.vectors[0].imag_part.
is None)Any helps are highly appreciated.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions