From 903f8789ce1d4607c8eb6195cb5969361cfb7524 Mon Sep 17 00:00:00 2001 From: Syun'ichi Shiraiwa Date: Fri, 19 Apr 2024 21:56:39 -0400 Subject: [PATCH 1/4] addded attribute_sets and arrays_by_name wrapper --- mfem/_par/arrays_by_name.i | 31 +++++++++++++++++++++++++++++++ mfem/_par/attribute_sets.i | 29 +++++++++++++++++++++++++++++ mfem/_par/mesh.i | 21 +++++++++++++-------- mfem/_par/setup.py | 4 ++-- mfem/_ser/arrays_by_name.i | 31 +++++++++++++++++++++++++++++++ mfem/_ser/attribute_sets.i | 29 +++++++++++++++++++++++++++++ mfem/_ser/mesh.i | 21 +++++++++++++-------- mfem/_ser/setup.py | 3 ++- 8 files changed, 150 insertions(+), 19 deletions(-) create mode 100644 mfem/_par/arrays_by_name.i create mode 100644 mfem/_par/attribute_sets.i create mode 100644 mfem/_ser/arrays_by_name.i create mode 100644 mfem/_ser/attribute_sets.i diff --git a/mfem/_par/arrays_by_name.i b/mfem/_par/arrays_by_name.i new file mode 100644 index 00000000..a2c7b9b9 --- /dev/null +++ b/mfem/_par/arrays_by_name.i @@ -0,0 +1,31 @@ +%module(package="mfem._par") arrays_by_name +%{ +#include "mfem.hpp" +#include "numpy/arrayobject.h" +#include "../common/io_stream.hpp" +#include "../common/pyoperator.hpp" +#include "../common/pycoefficient.hpp" +#include "../common/pyintrules.hpp" +%} + +%include "../common/existing_mfem_headers.i" + +#ifdef FILE_EXISTS_GENERAL_ARRAYS_BY_NAME +%init %{ +import_array(); +%} + +%include "exception.i" +%include "../common/exception.i" + +%import "array.i" +%import "../common/io_stream_typemap.i" +OSTREAM_TYPEMAP(std::ostream&) +ISTREAM_TYPEMAP(std::istream&) + +%include "general/arrays_by_name.hpp" +%ignore mfem::ArraysByName::begin; +%ignore mfem::ArraysByName::end; + +%template(intArraysByName) mfem::ArraysByName; +#endif diff --git a/mfem/_par/attribute_sets.i b/mfem/_par/attribute_sets.i new file mode 100644 index 00000000..c151dc3a --- /dev/null +++ b/mfem/_par/attribute_sets.i @@ -0,0 +1,29 @@ +%module(package="mfem._par") attribute_sets +%{ +#include "mfem.hpp" +#include "numpy/arrayobject.h" +#include "../common/io_stream.hpp" +#include "../common/pyoperator.hpp" +#include "../common/pycoefficient.hpp" +#include "../common/pyintrules.hpp" +%} + +%include "../common/existing_mfem_headers.i" +#ifdef FILE_EXISTS_MESH_ATTRIBUTE_SETS + +%init %{ +import_array(); +%} + +%include "exception.i" +%include "../common/exception.i" + +%import "array.i" +%import "arrays_by_name.i" +%import "../common/io_stream_typemap.i" +OSTREAM_TYPEMAP(std::ostream&) +ISTREAM_TYPEMAP(std::istream&) + +%include "mesh/attribute_sets.hpp" + +#endif diff --git a/mfem/_par/mesh.i b/mfem/_par/mesh.i index 9abaead7..564a6aef 100644 --- a/mfem/_par/mesh.i +++ b/mfem/_par/mesh.i @@ -39,6 +39,7 @@ import_array(); %import "matrix.i" %import "array.i" +%import "attribute_sets.i" %import "sort_pairs.i" %import "ncmesh.i" %import "vector.i" @@ -217,30 +218,34 @@ def GetFaceElements(self, Face): return Elem1.value(), Elem2.value() %} %feature("shadow") mfem::Mesh::GetElementTransformation %{ -def GetElementTransformation(self, i): +def GetElementTransformation(self, i, Tr=None): from mfem.par import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetBdrElementTransformation %{ -def GetBdrElementTransformation(self, i): +def GetBdrElementTransformation(self, i, Tr=None): from mfem.par import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetFaceTransformation %{ -def GetFaceTransformation(self, i): +def GetFaceTransformation(self, i, Tr=None): from mfem.par import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetEdgeTransformation %{ -def GetEdgeTransformation(self, i): +def GetEdgeTransformation(self, i, Tr=None): from mfem.par import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} diff --git a/mfem/_par/setup.py b/mfem/_par/setup.py index 4e241d5c..f79bb32b 100644 --- a/mfem/_par/setup.py +++ b/mfem/_par/setup.py @@ -121,8 +121,8 @@ def get_extensions(): "tmop", "tmop_amr", "tmop_tools", "qspace", "qfunction", "quadinterpolator", "quadinterpolator_face", "submesh", "transfermap", "staticcond","sidredatacollection", - "psubmesh", "ptransfermap", "enzyme"] - + "psubmesh", "ptransfermap", "enzyme", + "attribute_sets", "arrays_by_name"] if add_pumi == '1': from setup_local import puminc, pumilib modules.append("pumi") diff --git a/mfem/_ser/arrays_by_name.i b/mfem/_ser/arrays_by_name.i new file mode 100644 index 00000000..0ba9c95d --- /dev/null +++ b/mfem/_ser/arrays_by_name.i @@ -0,0 +1,31 @@ +%module(package="mfem._ser") arrays_by_name +%{ +#include "mfem.hpp" +#include "numpy/arrayobject.h" +#include "../common/io_stream.hpp" +#include "../common/pyoperator.hpp" +#include "../common/pycoefficient.hpp" +#include "../common/pyintrules.hpp" +%} + +%include "../common/existing_mfem_headers.i" + +#ifdef FILE_EXISTS_GENERAL_ARRAYS_BY_NAME +%init %{ +import_array(); +%} + +%include "exception.i" +%include "../common/exception.i" + +%import "array.i" +%import "../common/io_stream_typemap.i" +OSTREAM_TYPEMAP(std::ostream&) +ISTREAM_TYPEMAP(std::istream&) + +%include "general/arrays_by_name.hpp" +%ignore mfem::ArraysByName::begin; +%ignore mfem::ArraysByName::end; + +%template(intArraysByName) mfem::ArraysByName; +#endif diff --git a/mfem/_ser/attribute_sets.i b/mfem/_ser/attribute_sets.i new file mode 100644 index 00000000..6729597b --- /dev/null +++ b/mfem/_ser/attribute_sets.i @@ -0,0 +1,29 @@ +%module(package="mfem._ser") attribute_sets +%{ +#include "mfem.hpp" +#include "numpy/arrayobject.h" +#include "../common/io_stream.hpp" +#include "../common/pyoperator.hpp" +#include "../common/pycoefficient.hpp" +#include "../common/pyintrules.hpp" +%} + +%include "../common/existing_mfem_headers.i" +#ifdef FILE_EXISTS_MESH_ATTRIBUTE_SETS + +%init %{ +import_array(); +%} + +%include "exception.i" +%include "../common/exception.i" + +%import "array.i" +%import "arrays_by_name.i" +%import "../common/io_stream_typemap.i" +OSTREAM_TYPEMAP(std::ostream&) +ISTREAM_TYPEMAP(std::istream&) + +%include "mesh/attribute_sets.hpp" + +#endif diff --git a/mfem/_ser/mesh.i b/mfem/_ser/mesh.i index 8c2759cd..6d2c52db 100644 --- a/mfem/_ser/mesh.i +++ b/mfem/_ser/mesh.i @@ -31,6 +31,7 @@ import_array(); %import "matrix.i" %import "mem_manager.i" %import "array.i" +%import "attribute_sets.i" %import "sort_pairs.i" %import "ncmesh.i" %import "vector.i" @@ -222,30 +223,34 @@ def GetFaceElements(self, Face): return Elem1.value(), Elem2.value() %} %feature("shadow") mfem::Mesh::GetElementTransformation %{ -def GetElementTransformation(self, i): +def GetElementTransformation(self, i, Tr=None): from mfem.ser import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetBdrElementTransformation %{ -def GetBdrElementTransformation(self, i): +def GetBdrElementTransformation(self, i, Tr=None): from mfem.ser import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetFaceTransformation %{ -def GetFaceTransformation(self, i): +def GetFaceTransformation(self, i, Tr=None): from mfem.ser import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} %feature("shadow") mfem::Mesh::GetEdgeTransformation %{ -def GetEdgeTransformation(self, i): +def GetEdgeTransformation(self, i, Tr=None): from mfem.ser import IsoparametricTransformation - Tr = IsoparametricTransformation() + if Tr is None: + Tr = IsoparametricTransformation() $action(self, i, Tr) return Tr %} diff --git a/mfem/_ser/setup.py b/mfem/_ser/setup.py index 72c676e8..3bf2954c 100644 --- a/mfem/_ser/setup.py +++ b/mfem/_ser/setup.py @@ -103,7 +103,8 @@ def get_extensions(): "tmop", "tmop_amr", "tmop_tools", "qspace", "qfunction", "quadinterpolator", "quadinterpolator_face", "submesh", "transfermap", "staticcond", - "sidredatacollection", "enzyme"] + "sidredatacollection", "enzyme", + "attribute_sets", "arrays_by_name"] if add_cuda == '1': from setup_local import cudainc From 1e19fee0398b609ff5c3202c58c2e42e6b2b4dfa Mon Sep 17 00:00:00 2001 From: Syun'ichi Shiraiwa Date: Fri, 19 Apr 2024 22:09:32 -0400 Subject: [PATCH 2/4] fixed error metioned in #213 --- examples/ex5p.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ex5p.py b/examples/ex5p.py index 2ed895a2..51481f26 100644 --- a/examples/ex5p.py +++ b/examples/ex5p.py @@ -306,7 +306,7 @@ def EvalValue(self, x): u_sock << "parallel " << num_procs << " " << myid << "\n" u_sock.precision(8) u_sock << "solution\n" << pmesh << u << "window_title 'Velocity'\n" - MPI.Barrier() + MPI.COMM_WORLD.Barrier() p_sock = mfem.socketstream("localhost", 19916) p_sock << "parallel " << num_procs << " " << myid << "\n" p_sock.precision(8) From a63b24eda529db8b09db91441495bbe5a47bb98d Mon Sep 17 00:00:00 2001 From: Syun'ichi Shiraiwa Date: Fri, 19 Apr 2024 22:13:44 -0400 Subject: [PATCH 3/4] removded bilininteg_ext.i and lininteg_ext.i from git tracking --- .gitignore | 2 + mfem/common/bilininteg_ext.i | 305 ----------------------------------- mfem/common/lininteg_ext.i | 68 -------- 3 files changed, 2 insertions(+), 373 deletions(-) delete mode 100644 mfem/common/bilininteg_ext.i delete mode 100644 mfem/common/lininteg_ext.i diff --git a/.gitignore b/.gitignore index 0c6a51db..284e9fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ test/* !test/issues/data_3960/VisIt_volume *.egg-info *.py# +mfem/common/bilininteg_ext.i +mfem/common/lininteg_ext.i \ No newline at end of file diff --git a/mfem/common/bilininteg_ext.i b/mfem/common/bilininteg_ext.i deleted file mode 100644 index b22c7f79..00000000 --- a/mfem/common/bilininteg_ext.i +++ /dev/null @@ -1,305 +0,0 @@ -namespace mfem { -%pythonappend BilinearFormIntegrator::BilinearFormIntegrator %{ - self._coeff = args -%} - -%pythonappend TransposeIntegrator::TransposeIntegrator %{ - if own_bfi_ == 1: bfi_.thisown = 0 -%} - -%pythonappend LumpedIntegrator::LumpedIntegrator %{ - if own_bfi_ == 1: bfi_.thisown = 0 -%} - -%pythonappend InverseIntegrator::InverseIntegrator %{ - if own_integ == 1: integ.thisown = 0 -%} - -%pythonappend SumIntegrator::SumIntegrator %{ - self.own_integs = own_integs -%} - -%pythonappend MixedScalarIntegrator::MixedScalarIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorIntegrator::MixedVectorIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarVectorIntegrator::MixedScalarVectorIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarMassIntegrator::MixedScalarMassIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorProductIntegrator::MixedVectorProductIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarDerivativeIntegrator::MixedScalarDerivativeIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarWeakDerivativeIntegrator::MixedScalarWeakDerivativeIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarDivergenceIntegrator::MixedScalarDivergenceIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorDivergenceIntegrator::MixedVectorDivergenceIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarWeakGradientIntegrator::MixedScalarWeakGradientIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarCurlIntegrator::MixedScalarCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedScalarWeakCurlIntegrator::MixedScalarWeakCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorMassIntegrator::MixedVectorMassIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedCrossProductIntegrator::MixedCrossProductIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedDotProductIntegrator::MixedDotProductIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedWeakGradDotIntegrator::MixedWeakGradDotIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedWeakDivCrossIntegrator::MixedWeakDivCrossIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedGradGradIntegrator::MixedGradGradIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedCrossGradGradIntegrator::MixedCrossGradGradIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedCurlCurlIntegrator::MixedCurlCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedCrossCurlCurlIntegrator::MixedCrossCurlCurlIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedCrossCurlGradIntegrator::MixedCrossCurlGradIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedCrossGradCurlIntegrator::MixedCrossGradCurlIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedWeakCurlCrossIntegrator::MixedWeakCurlCrossIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarWeakCurlCrossIntegrator::MixedScalarWeakCurlCrossIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedCrossGradIntegrator::MixedCrossGradIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedCrossCurlIntegrator::MixedCrossCurlIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarCrossCurlIntegrator::MixedScalarCrossCurlIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarCrossGradIntegrator::MixedScalarCrossGradIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarCrossProductIntegrator::MixedScalarCrossProductIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarWeakCrossProductIntegrator::MixedScalarWeakCrossProductIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedDirectionalDerivativeIntegrator::MixedDirectionalDerivativeIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedGradDivIntegrator::MixedGradDivIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedDivGradIntegrator::MixedDivGradIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedScalarWeakDivergenceIntegrator::MixedScalarWeakDivergenceIntegrator %{ - self._coeff = vq -%} - -%pythonappend MixedVectorGradientIntegrator::MixedVectorGradientIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorCurlIntegrator::MixedVectorCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorWeakCurlIntegrator::MixedVectorWeakCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedVectorWeakDivergenceIntegrator::MixedVectorWeakDivergenceIntegrator %{ - self._coeff = args -%} - -%pythonappend GradientIntegrator::GradientIntegrator %{ - self._coeff = args -%} - -%pythonappend DiffusionIntegrator::DiffusionIntegrator %{ - self._coeff = args -%} - -%pythonappend MassIntegrator::MassIntegrator %{ - self._coeff = args -%} - -%pythonappend BoundaryMassIntegrator::BoundaryMassIntegrator %{ - self._coeff = q -%} - -%pythonappend ConvectionIntegrator::ConvectionIntegrator %{ - self._coeff = q -%} - -%pythonappend ConservativeConvectionIntegrator::ConservativeConvectionIntegrator %{ - self._coeff = q -%} - -%pythonappend GroupConvectionIntegrator::GroupConvectionIntegrator %{ - self._coeff = q -%} - -%pythonappend VectorMassIntegrator::VectorMassIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorFEDivergenceIntegrator::VectorFEDivergenceIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorFEWeakDivergenceIntegrator::VectorFEWeakDivergenceIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorFECurlIntegrator::VectorFECurlIntegrator %{ - self._coeff = args -%} - -%pythonappend DerivativeIntegrator::DerivativeIntegrator %{ - self._coeff = q -%} - -%pythonappend CurlCurlIntegrator::CurlCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorCurlCurlIntegrator::VectorCurlCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend MixedCurlIntegrator::MixedCurlIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorFEMassIntegrator::VectorFEMassIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorDivergenceIntegrator::VectorDivergenceIntegrator %{ - self._coeff = args -%} - -%pythonappend DivDivIntegrator::DivDivIntegrator %{ - self._coeff = args -%} - -%pythonappend VectorDiffusionIntegrator::VectorDiffusionIntegrator %{ - self._coeff = args -%} - -%pythonappend ElasticityIntegrator::ElasticityIntegrator %{ - self._coeff = args -%} - -%pythonappend DGTraceIntegrator::DGTraceIntegrator %{ - self._coeff = args -%} - -%pythonappend NonconservativeDGTraceIntegrator::NonconservativeDGTraceIntegrator %{ - self._coeff = args -%} - -%pythonappend DGDiffusionIntegrator::DGDiffusionIntegrator %{ - self._coeff = args -%} - -%pythonappend DGDiffusionBR2Integrator::DGDiffusionBR2Integrator %{ - self._coeff = args -%} - -%pythonappend DGElasticityIntegrator::DGElasticityIntegrator %{ - self._coeff = args -%} - -%pythonappend ScalarProductInterpolator::ScalarProductInterpolator %{ - self._coeff = sc -%} - -%pythonappend ScalarVectorProductInterpolator::ScalarVectorProductInterpolator %{ - self._coeff = sc -%} - -%pythonappend VectorScalarProductInterpolator::VectorScalarProductInterpolator %{ - self._coeff = vc -%} - -%pythonappend ScalarCrossProductInterpolator::ScalarCrossProductInterpolator %{ - self._coeff = vc -%} - -%pythonappend VectorCrossProductInterpolator::VectorCrossProductInterpolator %{ - self._coeff = vc -%} - -%pythonappend VectorInnerProductInterpolator::VectorInnerProductInterpolator %{ - self._coeff = vc -%} - -%pythonappend SumIntegrator::AddIntegrator %{ - if self.own_integs == 1: integ.thisown = 0 -%} -} diff --git a/mfem/common/lininteg_ext.i b/mfem/common/lininteg_ext.i deleted file mode 100644 index 4c3643fc..00000000 --- a/mfem/common/lininteg_ext.i +++ /dev/null @@ -1,68 +0,0 @@ -namespace mfem { -%pythonappend LinearFormIntegrator::LinearFormIntegrator %{ - self._coeff = args -%} -%pythonappend DeltaLFIntegrator::DeltaLFIntegrator %{ - self._coeff = args -%} -%pythonappend DomainLFIntegrator::DomainLFIntegrator %{ - self._coeff = args -%} -%pythonappend DomainLFGradIntegrator::DomainLFGradIntegrator %{ - self._coeff = QF -%} -%pythonappend BoundaryLFIntegrator::BoundaryLFIntegrator %{ - self._coeff = QG -%} -%pythonappend BoundaryNormalLFIntegrator::BoundaryNormalLFIntegrator %{ - self._coeff = QG -%} -%pythonappend BoundaryTangentialLFIntegrator::BoundaryTangentialLFIntegrator %{ - self._coeff = QG -%} -%pythonappend VectorDomainLFIntegrator::VectorDomainLFIntegrator %{ - self._coeff = QF -%} -%pythonappend VectorDomainLFGradIntegrator::VectorDomainLFGradIntegrator %{ - self._coeff = QF -%} -%pythonappend VectorBoundaryLFIntegrator::VectorBoundaryLFIntegrator %{ - self._coeff = QG -%} -%pythonappend VectorFEDomainLFIntegrator::VectorFEDomainLFIntegrator %{ - self._coeff = F -%} -%pythonappend VectorFEDomainLFCurlIntegrator::VectorFEDomainLFCurlIntegrator %{ - self._coeff = F -%} -%pythonappend VectorFEDomainLFDivIntegrator::VectorFEDomainLFDivIntegrator %{ - self._coeff = QF -%} -%pythonappend VectorBoundaryFluxLFIntegrator::VectorBoundaryFluxLFIntegrator %{ - self._coeff = (f, ir) -%} -%pythonappend VectorFEBoundaryFluxLFIntegrator::VectorFEBoundaryFluxLFIntegrator %{ - self._coeff = args -%} -%pythonappend VectorFEBoundaryTangentLFIntegrator::VectorFEBoundaryTangentLFIntegrator %{ - self._coeff = QG -%} -%pythonappend BoundaryFlowIntegrator::BoundaryFlowIntegrator %{ - self._coeff = args -%} -%pythonappend DGDirichletLFIntegrator::DGDirichletLFIntegrator %{ - self._coeff = args -%} -%pythonappend DGElasticityDirichletLFIntegrator::DGElasticityDirichletLFIntegrator %{ - self._coeff = uD_ -%} -%pythonappend WhiteGaussianNoiseDomainLFIntegrator::WhiteGaussianNoiseDomainLFIntegrator %{ - self._coeff = QG -%} -%pythonappend VectorQuadratureLFIntegrator::VectorQuadratureLFIntegrator %{ - self._coeff = (vqfc, ir) -%} -%pythonappend QuadratureLFIntegrator::QuadratureLFIntegrator %{ - self._coeff = (qfc, ir) -%} -} \ No newline at end of file From 93c8fa890955aa87acb021792e6be24acdd5a43e Mon Sep 17 00:00:00 2001 From: Syun'ichi Shiraiwa Date: Fri, 19 Apr 2024 22:55:11 -0400 Subject: [PATCH 4/4] rolled back bilininteg_ext.i and lininteg_ext.i --- .gitignore | 2 - mfem/common/bilininteg_ext.i | 309 +++++++++++++++++++++++++++++++++++ mfem/common/lininteg_ext.i | 68 ++++++++ 3 files changed, 377 insertions(+), 2 deletions(-) create mode 100644 mfem/common/bilininteg_ext.i create mode 100644 mfem/common/lininteg_ext.i diff --git a/.gitignore b/.gitignore index 284e9fe8..0c6a51db 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,3 @@ test/* !test/issues/data_3960/VisIt_volume *.egg-info *.py# -mfem/common/bilininteg_ext.i -mfem/common/lininteg_ext.i \ No newline at end of file diff --git a/mfem/common/bilininteg_ext.i b/mfem/common/bilininteg_ext.i new file mode 100644 index 00000000..99821135 --- /dev/null +++ b/mfem/common/bilininteg_ext.i @@ -0,0 +1,309 @@ +namespace mfem { +%pythonappend BilinearFormIntegrator::BilinearFormIntegrator %{ + self._coeff = args +%} + +%pythonappend TransposeIntegrator::TransposeIntegrator %{ + if own_bfi_ == 1: bfi_.thisown = 0 +%} + +%pythonappend LumpedIntegrator::LumpedIntegrator %{ + if own_bfi_ == 1: bfi_.thisown = 0 +%} + +%pythonappend InverseIntegrator::InverseIntegrator %{ + if own_integ == 1: integ.thisown = 0 +%} + +%pythonappend SumIntegrator::SumIntegrator %{ + self.own_integs = own_integs +%} + +%pythonappend MixedScalarIntegrator::MixedScalarIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorIntegrator::MixedVectorIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarVectorIntegrator::MixedScalarVectorIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarMassIntegrator::MixedScalarMassIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorProductIntegrator::MixedVectorProductIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarDerivativeIntegrator::MixedScalarDerivativeIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarWeakDerivativeIntegrator::MixedScalarWeakDerivativeIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarDivergenceIntegrator::MixedScalarDivergenceIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorDivergenceIntegrator::MixedVectorDivergenceIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarWeakGradientIntegrator::MixedScalarWeakGradientIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarCurlIntegrator::MixedScalarCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedScalarWeakCurlIntegrator::MixedScalarWeakCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorMassIntegrator::MixedVectorMassIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedCrossProductIntegrator::MixedCrossProductIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedDotProductIntegrator::MixedDotProductIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedWeakGradDotIntegrator::MixedWeakGradDotIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedWeakDivCrossIntegrator::MixedWeakDivCrossIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedGradGradIntegrator::MixedGradGradIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedCrossGradGradIntegrator::MixedCrossGradGradIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedCurlCurlIntegrator::MixedCurlCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedCrossCurlCurlIntegrator::MixedCrossCurlCurlIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedCrossCurlGradIntegrator::MixedCrossCurlGradIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedCrossGradCurlIntegrator::MixedCrossGradCurlIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedWeakCurlCrossIntegrator::MixedWeakCurlCrossIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarWeakCurlCrossIntegrator::MixedScalarWeakCurlCrossIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedCrossGradIntegrator::MixedCrossGradIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedCrossCurlIntegrator::MixedCrossCurlIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarCrossCurlIntegrator::MixedScalarCrossCurlIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarCrossGradIntegrator::MixedScalarCrossGradIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarCrossProductIntegrator::MixedScalarCrossProductIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarWeakCrossProductIntegrator::MixedScalarWeakCrossProductIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedDirectionalDerivativeIntegrator::MixedDirectionalDerivativeIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedGradDivIntegrator::MixedGradDivIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedDivGradIntegrator::MixedDivGradIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedScalarWeakDivergenceIntegrator::MixedScalarWeakDivergenceIntegrator %{ + self._coeff = vq +%} + +%pythonappend MixedVectorGradientIntegrator::MixedVectorGradientIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorCurlIntegrator::MixedVectorCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorWeakCurlIntegrator::MixedVectorWeakCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedVectorWeakDivergenceIntegrator::MixedVectorWeakDivergenceIntegrator %{ + self._coeff = args +%} + +%pythonappend GradientIntegrator::GradientIntegrator %{ + self._coeff = args +%} + +%pythonappend DiffusionIntegrator::DiffusionIntegrator %{ + self._coeff = args +%} + +%pythonappend MassIntegrator::MassIntegrator %{ + self._coeff = args +%} + +%pythonappend BoundaryMassIntegrator::BoundaryMassIntegrator %{ + self._coeff = q +%} + +%pythonappend ConvectionIntegrator::ConvectionIntegrator %{ + self._coeff = q +%} + +%pythonappend ConservativeConvectionIntegrator::ConservativeConvectionIntegrator %{ + self._coeff = q +%} + +%pythonappend GroupConvectionIntegrator::GroupConvectionIntegrator %{ + self._coeff = q +%} + +%pythonappend VectorMassIntegrator::VectorMassIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorFEDivergenceIntegrator::VectorFEDivergenceIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorFEWeakDivergenceIntegrator::VectorFEWeakDivergenceIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorFECurlIntegrator::VectorFECurlIntegrator %{ + self._coeff = args +%} + +%pythonappend DerivativeIntegrator::DerivativeIntegrator %{ + self._coeff = q +%} + +%pythonappend CurlCurlIntegrator::CurlCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorCurlCurlIntegrator::VectorCurlCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend MixedCurlIntegrator::MixedCurlIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorFEMassIntegrator::VectorFEMassIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorDivergenceIntegrator::VectorDivergenceIntegrator %{ + self._coeff = args +%} + +%pythonappend DivDivIntegrator::DivDivIntegrator %{ + self._coeff = args +%} + +%pythonappend VectorDiffusionIntegrator::VectorDiffusionIntegrator %{ + self._coeff = args +%} + +%pythonappend ElasticityIntegrator::ElasticityIntegrator %{ + self._coeff = args +%} + +%pythonappend ElasticityComponentIntegrator::ElasticityComponentIntegrator %{ + self._coeff = parent_ +%} + +%pythonappend DGTraceIntegrator::DGTraceIntegrator %{ + self._coeff = args +%} + +%pythonappend NonconservativeDGTraceIntegrator::NonconservativeDGTraceIntegrator %{ + self._coeff = args +%} + +%pythonappend DGDiffusionIntegrator::DGDiffusionIntegrator %{ + self._coeff = args +%} + +%pythonappend DGDiffusionBR2Integrator::DGDiffusionBR2Integrator %{ + self._coeff = args +%} + +%pythonappend DGElasticityIntegrator::DGElasticityIntegrator %{ + self._coeff = args +%} + +%pythonappend ScalarProductInterpolator::ScalarProductInterpolator %{ + self._coeff = sc +%} + +%pythonappend ScalarVectorProductInterpolator::ScalarVectorProductInterpolator %{ + self._coeff = sc +%} + +%pythonappend VectorScalarProductInterpolator::VectorScalarProductInterpolator %{ + self._coeff = vc +%} + +%pythonappend ScalarCrossProductInterpolator::ScalarCrossProductInterpolator %{ + self._coeff = vc +%} + +%pythonappend VectorCrossProductInterpolator::VectorCrossProductInterpolator %{ + self._coeff = vc +%} + +%pythonappend VectorInnerProductInterpolator::VectorInnerProductInterpolator %{ + self._coeff = vc +%} + +%pythonappend SumIntegrator::AddIntegrator %{ + if self.own_integs == 1: integ.thisown = 0 +%} +} diff --git a/mfem/common/lininteg_ext.i b/mfem/common/lininteg_ext.i new file mode 100644 index 00000000..4c3643fc --- /dev/null +++ b/mfem/common/lininteg_ext.i @@ -0,0 +1,68 @@ +namespace mfem { +%pythonappend LinearFormIntegrator::LinearFormIntegrator %{ + self._coeff = args +%} +%pythonappend DeltaLFIntegrator::DeltaLFIntegrator %{ + self._coeff = args +%} +%pythonappend DomainLFIntegrator::DomainLFIntegrator %{ + self._coeff = args +%} +%pythonappend DomainLFGradIntegrator::DomainLFGradIntegrator %{ + self._coeff = QF +%} +%pythonappend BoundaryLFIntegrator::BoundaryLFIntegrator %{ + self._coeff = QG +%} +%pythonappend BoundaryNormalLFIntegrator::BoundaryNormalLFIntegrator %{ + self._coeff = QG +%} +%pythonappend BoundaryTangentialLFIntegrator::BoundaryTangentialLFIntegrator %{ + self._coeff = QG +%} +%pythonappend VectorDomainLFIntegrator::VectorDomainLFIntegrator %{ + self._coeff = QF +%} +%pythonappend VectorDomainLFGradIntegrator::VectorDomainLFGradIntegrator %{ + self._coeff = QF +%} +%pythonappend VectorBoundaryLFIntegrator::VectorBoundaryLFIntegrator %{ + self._coeff = QG +%} +%pythonappend VectorFEDomainLFIntegrator::VectorFEDomainLFIntegrator %{ + self._coeff = F +%} +%pythonappend VectorFEDomainLFCurlIntegrator::VectorFEDomainLFCurlIntegrator %{ + self._coeff = F +%} +%pythonappend VectorFEDomainLFDivIntegrator::VectorFEDomainLFDivIntegrator %{ + self._coeff = QF +%} +%pythonappend VectorBoundaryFluxLFIntegrator::VectorBoundaryFluxLFIntegrator %{ + self._coeff = (f, ir) +%} +%pythonappend VectorFEBoundaryFluxLFIntegrator::VectorFEBoundaryFluxLFIntegrator %{ + self._coeff = args +%} +%pythonappend VectorFEBoundaryTangentLFIntegrator::VectorFEBoundaryTangentLFIntegrator %{ + self._coeff = QG +%} +%pythonappend BoundaryFlowIntegrator::BoundaryFlowIntegrator %{ + self._coeff = args +%} +%pythonappend DGDirichletLFIntegrator::DGDirichletLFIntegrator %{ + self._coeff = args +%} +%pythonappend DGElasticityDirichletLFIntegrator::DGElasticityDirichletLFIntegrator %{ + self._coeff = uD_ +%} +%pythonappend WhiteGaussianNoiseDomainLFIntegrator::WhiteGaussianNoiseDomainLFIntegrator %{ + self._coeff = QG +%} +%pythonappend VectorQuadratureLFIntegrator::VectorQuadratureLFIntegrator %{ + self._coeff = (vqfc, ir) +%} +%pythonappend QuadratureLFIntegrator::QuadratureLFIntegrator %{ + self._coeff = (qfc, ir) +%} +} \ No newline at end of file