Skip to content

Commit

Permalink
fixed nonlinearform and bilinearform wrapper addressed some API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sshiraiwa committed Nov 18, 2023
1 parent 700bcf7 commit 60b3654
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 5 additions & 1 deletion mfem/_par/bilinearform.i
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace mfem {
%}
%pythonprepend MixedBilinearForm::AddDomainIntegrator %{
if not hasattr(self, "_integrators"): self._integrators = []
bfi = args[0]
self._integrators.append(bfi)
bfi.thisown=0
%}
Expand All @@ -93,7 +94,8 @@ namespace mfem {
if not hasattr(self, "_integrators"): self._integrators = []
bfi = args[0]
self._integrators.append(bfi)
bfi.thisown=0
self.UseExternalIntegrators()
#bfi.thisown=0
%}
%pythonappend MixedBilinearForm::SpMat %{
if not hasattr(self, "_spmat"): self._spmat = []
Expand All @@ -102,11 +104,13 @@ namespace mfem {
%}
%pythonprepend DiscreteLinearOperator::AddDomainInterpolator %{
if not hasattr(self, "_integrators"): self._integrators = []
di = args[0]
self._integrators.append(di)
di.thisown=0
%}
%pythonprepend DiscreteLinearOperator::AddTraceFaceInterpolator %{
if not hasattr(self, "_integrators"): self._integrators = []
di = args[0]
self._integrators.append(di)
di.thisown=0
%}
Expand Down
8 changes: 5 additions & 3 deletions mfem/_par/nonlinearform.i
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import_array();
namespace mfem {
%pythonprepend NonlinearForm::AddDomainIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi.thisown=0
%}
Expand All @@ -33,13 +34,14 @@ namespace mfem {
%}
%pythonprepend NonlinearForm::AddBdrFaceIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi = args[0]
nlfi.thisown=0
%}
%pythonprepend BlockNonlinearForm::AddDomainIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
# self._integrators.append(nlfi)
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi.thisown=0
%}
%pythonprepend BlockNonlinearForm::AddInteriorFaceIntegrator %{
Expand All @@ -49,8 +51,8 @@ namespace mfem {
%}
%pythonprepend BlockNonlinearForm::AddBdrFaceIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi = args[0]
nlfi.thisown=0
%}
}
Expand Down
3 changes: 3 additions & 0 deletions mfem/_ser/bilinearform.i
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace mfem {
%}
%pythonprepend MixedBilinearForm::AddDomainIntegrator %{
if not hasattr(self, "_integrators"): self._integrators = []
bfi = args[0]
self._integrators.append(bfi)
bfi.thisown=0
%}
Expand Down Expand Up @@ -103,11 +104,13 @@ namespace mfem {
%}
%pythonprepend DiscreteLinearOperator::AddDomainInterpolator %{
if not hasattr(self, "_integrators"): self._integrators = []
di = args[0]
self._integrators.append(di)
di.thisown=0
%}
%pythonprepend DiscreteLinearOperator::AddTraceFaceInterpolator %{
if not hasattr(self, "_integrators"): self._integrators = []
di = args[0]
self._integrators.append(di)
di.thisown=0
%}
Expand Down
8 changes: 5 additions & 3 deletions mfem/_ser/nonlinearform.i
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import_array();
namespace mfem {
%pythonprepend NonlinearForm::AddDomainIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi.thisown=0
%}
Expand All @@ -36,13 +37,14 @@ namespace mfem {
%}
%pythonprepend NonlinearForm::AddBdrFaceIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
# self._integrators.append(nlfi)
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi.thisown=0
%}
%pythonprepend BlockNonlinearForm::AddDomainIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
# self._integrators.append(nlfi)
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi.thisown=0
%}
%pythonprepend BlockNonlinearForm::AddInteriorFaceIntegrator %{
Expand All @@ -52,8 +54,8 @@ namespace mfem {
%}
%pythonprepend BlockNonlinearForm::AddBdrFaceIntegrator %{
# if not hasattr(self, "_integrators"): self._integrators = []
nlfi = args[0]
# self._integrators.append(nlfi)
nlfi = args[0]
nlfi.thisown=0
%}
}
Expand Down

0 comments on commit 60b3654

Please sign in to comment.