-// Copyright (C) 2017-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCouplingFieldOverTime.hxx"
#include "MEDCouplingDefinitionTime.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
+#include "MEDCouplingFieldDiscretizationOnNodesFE.hxx"
#include "MEDCouplingCartesianAMRMesh.hxx"
#include "MEDCouplingAMRAttribute.hxx"
#include "MEDCouplingMatrix.hxx"
typedef int mcIdType;
typedef DataArrayInt32 DataArrayIdType;
%template(ivec) std::vector<int>;
-%template(i64vec) std::vector<long>;
+%template(i64vec) std::vector<int64_t>;
#else
//typedef std::int64_t mcIdType;
typedef DataArrayInt64 DataArrayIdType;
#endif
%template(i32vec) std::vector<int>;
#endif
-
+#ifdef WIN32
+typedef long long mcPyPtrType;
+#else
+typedef long mcPyPtrType;
+#endif
////////////////////
%typemap(out) MEDCoupling::MEDCouplingMesh*
%feature("autodoc", "1");
%feature("docstring");
+%newobject MEDCoupling::MEDCouplingFieldDiscretizationOnNodesFE::getCooInRefElement;
%newobject MEDCoupling::MEDCouplingField::buildMeasureField;
%newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
%newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
%newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
%newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
%newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
+%newobject MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass;
%newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
%newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
%newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
%newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
%newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
%newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
+%newobject MEDCoupling::MEDCouplingUMesh::findNodesToDuplicate;
%newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
%newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
%newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::computeTriangleHeight;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
%newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
%newobject MEDCoupling::DenseMatrix::__mul__;
%newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
%newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
+%newobject MEDCoupling::MEDCouplingGaussLocalization::getShapeFunctionValues;
+%newobject MEDCoupling::MEDCouplingGaussLocalization::getDerivativeOfShapeFunctionValues;
+%newobject MEDCoupling::MEDCouplingGaussLocalization::GetDefaultReferenceCoordinatesOf;
%newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
%newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
%newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
%feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
%feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
%feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
+%feature("unref") MEDCouplingFieldDiscretizationOnNodesFE "$this->decrRef();"
%feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
%feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
%feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
ON_NODES = 1,
ON_GAUSS_PT = 2,
ON_GAUSS_NE = 3,
- ON_NODES_KR = 4
+ ON_NODES_KR = 4,
+ ON_NODES_FE = 5
} TypeOfField;
typedef enum
std::ostringstream oss; oss << "C++ Pointer address is : " << self;
return oss.str();
}
+
+ // Hack to allow retrieving of underlying C++ pointer whatever the situation
+ // This allows for example to mix different types of Python binding (SWIG and PyBind for example)
+ long long getHiddenCppPointerAsLongLong() const
+ {
+ return (long long) self;
+ }
+
}
%extend MEDCouplingGaussLocalization
{
return self->simpleRepr();
}
+
+ DataArrayDouble *computeMeshCenterOfMass() const
+ {
+ MCAuto<DataArrayDouble> ret(self->computeMeshCenterOfMass());
+ return ret.retn();
+ }
PyObject *getTime()
{
const std::vector<double>& getGaussCoords() const;
double getGaussCoord(int gaussPtIdInCell, int comp) const;
const std::vector<double>& getWeights() const;
- double getWeight(int gaussPtIdInCell, double newVal) const;
+ double getWeight(int gaussPtIdInCell) const;
void setRefCoord(int ptIdInCell, int comp, double newVal);
void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
void setWeight(int gaussPtIdInCell, double newVal);
MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
return ret.retn();
}
+
+ DataArrayDouble *getShapeFunctionValues() const
+ {
+ MCAuto<DataArrayDouble> ret(self->getShapeFunctionValues());
+ return ret.retn();
+ }
+
+ DataArrayDouble *getDerivativeOfShapeFunctionValues() const
+ {
+ MCAuto<DataArrayDouble> ret(self->getDerivativeOfShapeFunctionValues());
+ return ret.retn();
+ }
+
+ static DataArrayDouble *GetDefaultReferenceCoordinatesOf(INTERP_KERNEL::NormalizedCellType type)
+ {
+ MCAuto<DataArrayDouble> ret(MEDCouplingGaussLocalization::GetDefaultReferenceCoordinatesOf(type));
+ return ret.retn();
+ }
}
};
DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
void changeOrientationOfCells();
+ void orientCorrectly2DCells(const MEDCouplingUMesh *refFaces);
DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
return ret;
}
- PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
+ DataArrayIdType *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
{
- DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
- self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
- PyObject *ret=PyTuple_New(3);
+ DataArrayIdType *ret=self->findNodesToDuplicate(otherDimM1OnSameCoords);
+ return ret;
+ }
+
+ PyObject *findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnSameCoords, const DataArrayIdType *dupNodes) const
+ {
+ DataArrayIdType *tmp0=0,*tmp1=0;
+ self->findCellsToRenumber(otherDimM1OnSameCoords,dupNodes->begin(), dupNodes->end(), tmp0,tmp1);
+ PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
return ret;
}
+ PyObject *explodeMeshTo(int targetDeltaLevel) const
+ {
+ MCAuto<DataArrayIdType> desc,descIndx,revDesc,revDescIndx;
+ MCAuto<MEDCouplingUMesh> m=self->explodeMeshTo(targetDeltaLevel,desc,descIndx,revDesc,revDescIndx);
+ PyObject *ret=PyTuple_New(5);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
PyObject *explodeIntoEdges() const
{
MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
void convertExtrudedPolyhedra();
bool unPolyze();
void simplifyPolyhedra(double eps);
+ void colinearizeEdges(double eps);
MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
};
return ret;
}
+ DataArrayDouble *MEDCoupling1SGTUMesh::computeTriangleHeight() const
+ {
+ MCAuto<DataArrayDouble> ret = self->computeTriangleHeight();
+ return ret.retn();
+ }
+
static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
{
std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;