Skip to content

Commit

Permalink
fixed mfem._par build due to compile error with pgridfunc_wrap and li…
Browse files Browse the repository at this point in the history
…ninteg_wrap
  • Loading branch information
sshiraiwa committed Feb 5, 2024
1 parent 2d54589 commit 0912cb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mfem/_par/lininteg.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#include "numpy/arrayobject.h"
%}

%include "../common/mfem_config.i"
#ifdef MFEM_USE_MPI
%include mpi4py/mpi4py.i
%mpi4py_typemap(Comm, MPI_Comm);
#endif

%init %{
import_array();
%}
Expand All @@ -39,4 +45,3 @@ import_array();
%include "../common/pylininteg.hpp"



18 changes: 18 additions & 0 deletions mfem/_par/pgridfunc.i
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ LIST_TO_MFEMOBJ_POINTERARRAY_IN(mfem::IntegrationRule const *irs[], mfem::Integ
%}

%exception; /* undo default director exception */

/*
note on SWIG 4.2
MakeRef expands to
1) mfem::ParGridFunction::MakeRef(FiniteElementSpace *f, double *v);
2) mfem::ParGridFunction::MakeRef(FiniteElementSpace *f, mfem::Vector &v, int v_offset);
3) mfem::ParGridFunction::MakeRef(mfem::FiniteElementSpace *f, double *v);
4) mfem::ParGridFunction::MakeRef(mfem::FiniteElementSpace *f, mfem::Vector &v, int v_offset);
among which 1) and 2) does not exsist. The following is to cherry-pick what should
be wrapped explicitly.
*/
%ignore mfem::ParGridFunction::MakeRef;
%rename("") mfem::ParGridFunction::MakeRef(FiniteElementSpace *f, double *v);
%rename("") mfem::ParGridFunction::MakeRef(FiniteElementSpace *f, Vector &v, int v_offset);
%rename("") mfem::ParGridFunction::MakeRef(ParFiniteElementSpace *f, double *v);
%rename("") mfem::ParGridFunction::MakeRef(ParFiniteElementSpace *f, Vector &v, int v_offset);

%include "fem/pgridfunc.hpp"

namespace mfem{
Expand Down

0 comments on commit 0912cb4

Please sign in to comment.