--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+// ICoCo file common to several codes
+// ICoCoField.cxx
+// version 1.2 10/05/2010
+
+#include "ICoCoField.hxx"
+
+#include <string>
+
+using namespace ICoCo;
+using std::string;
+
+Field::Field() {
+ _name=new string;
+}
+
+Field::~Field() {
+ delete _name;
+}
+
+void Field::setName(const string& name) {
+ *_name=name;
+}
+
+const string& Field::getName() const {
+ return *_name;
+}
+
+const char* Field::getCharName() const {
+ return _name->c_str();
+}
+++ /dev/null
-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// ICoCo file common to several codes
-// ICoCoField.cxx
-// version 1.2 10/05/2010
-
-#include "ICoCoField.hxx"
-
-#include <string>
-
-using namespace ICoCo;
-using std::string;
-
-Field::Field() {
- _name=new string;
-}
-
-Field::~Field() {
- delete _name;
-}
-
-void Field::setName(const string& name) {
- *_name=name;
-}
-
-const string& Field::getName() const {
- return *_name;
-}
-
-const char* Field::getCharName() const {
- return _name->c_str();
-}
--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+#ifndef _ICoCoField_included_
+#define _ICoCoField_included_
+#include <string>
+
+namespace ICoCo {
+
+ /*! @brief Top abstract class defining field objects that can be exchanged via the ICoCo interface.
+ *
+ * The Field class holds the name of the field.
+ */
+ class Field {
+ public:
+ /*! @brief Set the name of the field.
+ * @param name name of the field
+ */
+ void setName(const std::string& name);
+
+ /*! @brief Retrieves the name of the field.
+ * @return name of the field.
+ */
+ const std::string& getName() const;
+
+ /*!
+ * @brief Retrieves the name of the field as a char *
+ * @return name of the field.
+ */
+ const char* getCharName() const;
+
+ protected:
+ Field();
+ virtual ~Field();
+
+ private:
+ std::string* _name;
+ };
+}
+#endif
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// ICoCo file common to several codes
-// ICoCoField.h
-// version 1.2 10/05/2010
-
-#ifndef _ICoCoField_included_
-#define _ICoCoField_included_
-#include <string>
-
-
-namespace ICoCo {
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
- class Field {
- public:
- Field();
- virtual ~Field();
- void setName(const std::string& name);
- const std::string& getName() const;
- const char* getCharName() const;
-
- private:
- std::string* _name;
- };
-}
-#endif
+#include <ICoCoField.h>
--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "ICoCoMEDDoubleField.hxx"
+
+#include "MEDCouplingFieldDouble.hxx"
+
+namespace ICoCo
+{
+ MEDDoubleField::MEDDoubleField() : _field(0) {}
+
+ /*! Constructor directly attaching a MEDCouplingFieldDouble
+ the object does not take the control the objects pointed by
+ \a field.
+ */
+ MEDDoubleField::MEDDoubleField(MEDCoupling::MEDCouplingFieldDouble *field):_field(field)
+ {
+ if(_field)
+ _field->incrRef();
+ }
+
+ MEDDoubleField::MEDDoubleField(const MEDDoubleField& field):_field(field.getMCField())
+ {
+ if(_field)
+ _field->incrRef();
+ }
+
+ MEDDoubleField::~MEDDoubleField()
+ {
+ if(_field)
+ _field->decrRef();
+ }
+
+ MEDDoubleField& MEDDoubleField::operator=(const MEDDoubleField& field)
+ {
+ if (_field)
+ _field->decrRef();
+
+ _field=field.getMCField();
+ if(_field)
+ _field->incrRef();
+ return *this;
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *MEDDoubleField::getMCField() const
+ {
+ return _field;
+ }
+
+ void MEDDoubleField::setMCField(MEDCoupling::MEDCouplingFieldDouble * f)
+ {
+ if(_field)
+ _field->decrRef();
+ _field = f;
+ if(f)
+ _field->incrRef();
+ }
+
+}
--- /dev/null
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+#ifndef _ICoCoMEDDoubleField_included_
+#define _ICoCoMEDDoubleField_included_
+
+#include "ICoCoField.h"
+
+namespace MEDCoupling
+{
+ class MEDCouplingFieldDouble;
+}
+
+namespace ICoCo
+{
+ /*! @brief Field data stored internally as a MEDCoupling object.
+ *
+ * This class is a wrapper around a MEDCoupling::MEDCouplingFieldDouble object, which holds the field data.
+ * In version 2 of ICoCo, MEDCoupling::MEDCouplingFieldDouble objects are not anymore exposed directly into the API
+ * of ICoCo::Problem. The rationale is to make the interface ICoCo::Problem free of external dependencies
+ * (MEDCoupling particularly).
+ *
+ * @sa the MEDCoupling documentation, notably the reference counter mechanism used to manage the lifecycle of
+ * MEDCoupling objects.
+ */
+ class MEDDoubleField : public ICoCo::Field
+ {
+ public:
+ /*! Builds an empty field (internal MEDCoupling object not set).
+ */
+ MEDDoubleField();
+
+ /*! @brief Builds a field and assign its internal MEDCouplingField object.
+ * @param field MEDCoupling field instance to use for field data. The field reference counter is incremented.
+ */
+ MEDDoubleField(MEDCoupling::MEDCouplingFieldDouble* field);
+
+ /*! @brief Copy construcotr.
+ */
+ MEDDoubleField(const MEDDoubleField& field);
+
+ /*! @brief Assignement operator.
+ * @param field another MEDDoubleField instance. The previous internal MEDCoupling field reference (if any) has
+ * its counter decremented.
+ */
+ MEDDoubleField& operator=(const MEDDoubleField& field);
+
+ /*! @brief Destructor.
+ */
+ virtual ~MEDDoubleField();
+
+ /*! @brief Get the internal MEDCoupling field object.
+ * @return a pointer to the MEDCouplingField object detained by this instance. Note that the corresponding
+ * object should not be deleted, or its reference counter should not be decreased! Doing so will result in an
+ * invalid instance of the current MEDField.
+ */
+ MEDCoupling::MEDCouplingFieldDouble *getMCField() const;
+
+ /*! @brief Set the internal MEDCoupling field object.
+ *
+ * Any previously set field is discarded (its reference counter is decreased) and the reference counter of the
+ * field being set is increased.
+ *
+ * @param field MEDCouplingFieldDouble object to be used.
+ */
+ void setMCField(MEDCoupling::MEDCouplingFieldDouble * field);
+
+ private:
+ MEDCoupling::MEDCouplingFieldDouble *_field;
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+#include "ICoCoMEDDoubleField.h"
+++ /dev/null
-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "ICoCoMEDField.hxx"
-//#include "ProcessorGroup.hxx"
-#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingFieldDouble.hxx"
-#include "NormalizedUnstructuredMesh.hxx"
-
-namespace ICoCo
-{
-
- /*! Constructor directly attaching a MEDCouplingFieldDouble
- the object does not take the control the objects pointed by
- \a field.
- */
-
- MEDField::MEDField(MEDCoupling::MEDCouplingFieldDouble *field):_field(field)
- {
- if(_field)
- _field->incrRef();
- }
- MEDField::MEDField(const MEDField& field):_field(field.getField())
- {
- if(_field)
- _field->incrRef();
- }
-
- MEDField::~MEDField()
- {
- if(_field)
- _field->decrRef();
- }
-
-
- MEDField& MEDField::operator=(const MEDField& field)
- {
- if (_field)
- _field->decrRef();
-
- _field=field.getField();
- if(_field)
- _field->incrRef();
- return *this;
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef __ICOCOMEDFIELD_HXX__
-#define __ICOCOMEDFIELD_HXX__
-
-#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingFieldDouble.hxx"
-
-#include <vector>
-#include "ICoCoField.hxx"
-
-namespace ICoCo
-{
- class MEDField : public ICoCo::Field
- {
- public:
- MEDField():_field(0) { }
- MEDField(MEDCoupling::MEDCouplingFieldDouble* field);
- MEDField(const MEDField& field);
- MEDField& operator=(const MEDField& field);
- virtual ~MEDField();
- MEDCoupling::MEDCouplingFieldDouble *getField() const { return _field; }
- const MEDCoupling::MEDCouplingMesh *getMesh() const { return _field->getMesh(); }
- private:
- MEDCoupling::MEDCouplingFieldDouble *_field;
- };
-}
-
-#endif
--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "ICoCoMEDIntField.h"
+#include "MEDCouplingFieldInt.hxx"
+
+namespace ICoCo
+{
+
+ MEDIntField::MEDIntField() : _field(0) {}
+
+ /*! Constructor directly attaching a MEDCouplingFieldInt
+ the object does not take the control the objects pointed by
+ \a field.
+ */
+ MEDIntField::MEDIntField(MEDCoupling::MEDCouplingFieldInt *field):_field(field)
+ {
+ if(_field)
+ _field->incrRef();
+ }
+
+ MEDIntField::MEDIntField(const MEDIntField& field):_field(field.getMCField())
+ {
+ if(_field)
+ _field->incrRef();
+ }
+
+ MEDIntField::~MEDIntField()
+ {
+ if(_field)
+ _field->decrRef();
+ }
+
+
+ MEDIntField& MEDIntField::operator=(const MEDIntField& field)
+ {
+ if (_field)
+ _field->decrRef();
+
+ _field=field.getMCField();
+ if(_field)
+ _field->incrRef();
+ return *this;
+ }
+
+ MEDCoupling::MEDCouplingFieldInt *MEDIntField::getMCField() const
+ {
+ return _field;
+ }
+
+ void MEDIntField::setMCField(MEDCoupling::MEDCouplingFieldInt * f)
+ {
+ if(_field)
+ _field->decrRef();
+ _field = f;
+ if(f)
+ _field->incrRef();
+ }
+
+}
--- /dev/null
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+#ifndef _ICoCoMEDIntField_included_
+#define _ICoCoMEDIntField_included_
+
+#include "ICoCoField.h"
+
+namespace MEDCoupling
+{
+ class MEDCouplingFieldInt32;
+ using MEDCouplingFieldInt = MEDCouplingFieldInt32;
+}
+
+namespace ICoCo
+{
+ class MEDIntField : public ICoCo::Field
+ {
+ public:
+ MEDIntField();
+ MEDIntField(MEDCoupling::MEDCouplingFieldInt* field);
+ MEDIntField(const MEDIntField& field);
+ MEDIntField& operator=(const MEDIntField& field);
+ virtual ~MEDIntField();
+ MEDCoupling::MEDCouplingFieldInt *getMCField() const;
+ void setMCField(MEDCoupling::MEDCouplingFieldInt * f);
+
+ private:
+ MEDCoupling::MEDCouplingFieldInt *_field;
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// WARNING: this file is part of the official ICoCo API and should not be modified.
+// The official version can be found in the TRUST repository:
+//
+// https://sourceforge.net/projects/trust/
+
+#include "ICoCoMEDIntField.h"
-Linked into target 'medcoupling' library.
+Linked into target 'paramedmem' library.
+
+The files below are part of the official ICoCo API and should NOT be modified:
+ - ICoCoField.h
+ - ICoCoField.hxx
+ - ICoCoField.cxx
+ - ICoCoMEDDoubleField.h
+ - ICoCoMEDDoubleField.hxx
+ - ICoCoMEDIntField.h
+ - ICoCoMEDIntField.hxx
+
+Their official version can be found in the TRUST repository:
+
+ https://sourceforge.net/projects/trust/
--- /dev/null
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Adrien Bruneton (CEA)
+
+%{
+#include "ICoCoMEDDoubleField.h"
+#include "ICoCoMEDIntField.h"
+%}
+
+%include "std_string.i"
+%include "ICoCoField.h"
+
+// %rename has to be before %include ... !!
+%rename (ICoCoMEDDoubleField) ICoCo::MEDDoubleField;
+%rename (ICoCoMEDIntField) ICoCo::MEDIntField;
+
+%include "ICoCoMEDDoubleField.h"
+%include "ICoCoMEDIntField.h"
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
)
SET(medcoupling_SOURCES
MEDCouplingPartDefinition.cxx
MEDCouplingSkyLineArray.cxx
MEDCouplingVoronoi.cxx
- ../ICoCo/ICoCoField.cxx
- ../ICoCo/ICoCoMEDField.cxx
- )
+ ../ICoCo/ICoCoField.cpp # [ABN] Yes, .cpp, this is imposed by ICoCo.
+ ../ICoCo/ICoCoMEDDoubleField.cxx
+ ../ICoCo/ICoCoMEDIntField.cxx
+)
SET(medcouplingremapper_SOURCES
MEDCouplingRemapper.cxx
TARGET_LINK_LIBRARIES(medcouplingremapper medcouplingcpp)
INSTALL(TARGETS medcouplingremapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
-FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
+FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.hxx"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.h")
FILE(GLOB medcoupling_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
FILE(GLOB icoco_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.hxx")
INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} ${icoco_HEADERS_HXX} MEDCouplingNatureOfFieldEnum DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
DataArrayInt.i
MEDCouplingFieldDiscretization.i
MEDCouplingFinalize.i
- MEDCouplingTypemaps.i)
+ MEDCouplingTypemaps.i
+ ../ICoCo/Swig/ICoCoMEDField.i
+)
SET (MC_pyTestFiles
${ALL_TESTS}
MEDCouplingTypemaps.i
MEDCouplingDataArrayTypemaps.i
MEDCouplingDataArrayTraits.hxx
+ ../ICoCo/Swig/ICoCoMEDField.i
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/Swig
${PROJECT_BINARY_DIR}/doc
)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from medcoupling import *
+
+import unittest
+
+class ICoCoICoCoMEDDoubleFieldTest(unittest.TestCase):
+ def generate_fields(self):
+ ## Dummy MCFieldDouble
+ msh = MEDCouplingCMesh("toto")
+ msh.setCoords(DataArrayDouble([0.,1.,2.]))
+ msh = msh.buildUnstructured()
+ f1 = MEDCouplingFieldDouble(ON_CELLS, ONE_TIME)
+ f1.setMesh(msh)
+ f1.setArray(DataArrayDouble([0.,1.,2.,3.]))
+
+ f2 = f1.deepCopy()
+ da = f2.getArray()
+ da += 3.0
+ da2 = f2.getArray()
+ return f1, f2
+
+ def test1(self):
+ f1, f2 = self.generate_fields()
+ mf = ICoCoMEDDoubleField()
+ mf.setName("titi")
+ self.assertEqual(mf.getName(), "titi")
+ mfd = mf.getMCField()
+ self.assertTrue(mfd is None)
+ mf.setMCField(f1)
+ f11 = mf.getMCField()
+ self.assertEqual(f1.getHiddenCppPointer(), f11.getHiddenCppPointer()) # strictly the same
+ mf.setMCField(f2)
+ f22 = mf.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+ mf = ICoCoMEDDoubleField(f1) # ctor with MC object
+ mfd = mf.getMCField()
+ self.assertEqual(mfd.getHiddenCppPointer(), f1.getHiddenCppPointer()) # strictly the same
+
+ mf.setMCField(None)
+ mfd = mf.getMCField()
+ self.assertTrue(mfd is None)
+
+ mf.setMCField(f2)
+ f22 = mf.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+ mf2 = ICoCoMEDDoubleField(mf) # copy ctor
+ f22 = mf2.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+ mf2 = mf # assignement op
+ f22 = mf2.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+if __name__ == '__main__':
+ unittest.main()
#endif
%include "MEDCouplingCommon.i"
+%include "ICoCoMEDField.i"
%pythoncode %{
def MEDCouplingDataArrayDoubleIadd(self,*args):
MEDCouplingExamplesTest.py
MEDCouplingRemapperTest.py
UsersGuideExamplesTest.py
+ ICoCoMEDFieldTest.py
)
# if numpy is used
#include "ParaMESH.hxx"
#include "DEC.hxx"
#include "ICoCoField.hxx"
-#include "ICoCoMEDField.hxx"
#include "MPIProcessorGroup.hxx"
#include <cmath>
+#include "../ICoCo/ICoCoMEDDoubleField.hxx"
namespace MEDCoupling
{
#include "ParaFIELD.hxx"
#include "ParaMESH.hxx"
#include "ICoCoField.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
#include "MPIProcessorGroup.hxx"
#include <cmath>
will be updated by a recvData() call.
Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side.
The field type is a generic ICoCo Field, so that the DEC can couple a number of different fields :
- - a ICoCo::MEDField, that is created from a MEDCoupling structure
+ - a ICoCo::MEDDoubleField, that is created from a MEDCoupling structure
*/
- void DisjointDEC::attachLocalField(const ICoCo::MEDField *field)
+ void DisjointDEC::attachLocalField(const ICoCo::MEDDoubleField *field)
{
if(!isInUnion())
return ;
if(!field)
- throw INTERP_KERNEL::Exception("DisjointDEC::attachLocalField : ICoCo::MEDField pointer is NULL !");
- attachLocalField(field->getField());
+ throw INTERP_KERNEL::Exception("DisjointDEC::attachLocalField : ICoCo::MEDDoubleField pointer is NULL !");
+ attachLocalField(field->getMCField());
}
/*!
namespace ICoCo
{
- class MEDField;
+ class MEDDoubleField;
}
namespace MEDCoupling
void setNature(NatureOfField nature);
void attachLocalField( MEDCouplingFieldDouble *field);
void attachLocalField(const ParaFIELD *field, bool ownPt=false);
- void attachLocalField(const ICoCo::MEDField *field);
-
+ void attachLocalField(const ICoCo::MEDDoubleField *field);
+
virtual void prepareSourceDE() = 0;
virtual void prepareTargetDE() = 0;
virtual void recvData() = 0;
#include "MPIProcessorGroup.hxx"
#include "OverlapElementLocator.hxx"
#include "OverlapInterpolationMatrix.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
namespace MEDCoupling
{
attachTargetLocalField(tmpField,true);
}
- void OverlapDEC::attachSourceLocalField(ICoCo::MEDField *field)
+ void OverlapDEC::attachSourceLocalField(ICoCo::MEDDoubleField *field)
{
- attachSourceLocalField(field->getField());
+ attachSourceLocalField(field->getMCField());
}
- void OverlapDEC::attachTargetLocalField(ICoCo::MEDField *field)
+ void OverlapDEC::attachTargetLocalField(ICoCo::MEDDoubleField *field)
{
- attachTargetLocalField(field->getField());
+ attachTargetLocalField(field->getMCField());
}
bool OverlapDEC::isInGroup() const
#include <string>
namespace ICoCo {
- class MEDField;
+ class MEDDoubleField;
}
namespace MEDCoupling
void attachTargetLocalField(ParaFIELD *field, bool ownPt=false);
void attachSourceLocalField(MEDCouplingFieldDouble *field);
void attachTargetLocalField(MEDCouplingFieldDouble *field);
- void attachSourceLocalField(ICoCo::MEDField *field);
- void attachTargetLocalField(ICoCo::MEDField *field);
+ void attachSourceLocalField(ICoCo::MEDDoubleField *field);
+ void attachTargetLocalField(ICoCo::MEDDoubleField *field);
ProcessorGroup *getGroup() { return _group; }
bool isInGroup() const;
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "ComponentTopology.hxx"
-#include "ICoCoMEDField.hxx"
#include "ParaMEDLoader.hxx"
+#include "ICoCoMEDDoubleField.hxx"
#include "MEDLoader.hxx"
+#include "MEDCouplingUMesh.hxx"
#include "TestInterpKernelUtils.hxx"
MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
MEDCoupling::ParaMESH* paramesh = nullptr;
MEDCoupling::ParaFIELD* parafield = nullptr;
- ICoCo::MEDField* icocofield = nullptr;
+ ICoCo::MEDDoubleField* icocofield = nullptr;
string filename_xml1 = "square1_split";
string filename_xml2 = "square2_split";
value[ielem]=1.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.setMethod(srcMeth);
dec.attachLocalField(icocofield);
}
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.setMethod(targetMeth);
dec.attachLocalField(icocofield);
}
MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
MEDCoupling::ParaMESH* paramesh = nullptr;
MEDCoupling::ParaFIELD* parafield = nullptr;
- ICoCo::MEDField* icocofield = nullptr;
+ ICoCo::MEDDoubleField* icocofield = nullptr;
char * tmp_dir_c = getenv("TMP");
string tmp_dir;
value[ielem]=1.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.setMethod(srcMeth);
dec.attachLocalField(icocofield);
}
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.setMethod(targetMeth);
dec.attachLocalField(icocofield);
}
MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
MEDCoupling::ParaMESH* paramesh = nullptr;
MEDCoupling::ParaFIELD* parafield = nullptr;
- ICoCo::MEDField* icocofield = nullptr;
+ ICoCo::MEDDoubleField* icocofield = nullptr;
char * tmp_dir_c = getenv("TMP");
string tmp_dir;
value[ielem]=0.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.attachLocalField(icocofield);
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;
// ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.attachLocalField(icocofield);
}
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "ComponentTopology.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
#include "MEDLoader.hxx"
+#include "MEDCouplingUMesh.hxx"
#include "TestInterpKernelUtils.hxx"
#include <string>
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "ComponentTopology.hxx"
-#include "ICoCoMEDField.hxx"
#include "MEDLoader.hxx"
+#include "ICoCoMEDDoubleField.hxx"
+#include "MEDCouplingUMesh.hxx"
#include <string>
#include <cstring>
+
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
MEDCoupling::ParaMESH* paramesh = nullptr;
MEDCoupling::ParaFIELD* parafield = nullptr;
- ICoCo::MEDField* icocofield = nullptr;
+ ICoCo::MEDDoubleField* icocofield = nullptr;
// To remove tmp files from disk
ParaMEDMEMTest_TmpFilesRemover aRemover;
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=1.0;
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.attachLocalField(icocofield);
}
double *value=parafield->getField()->getArray()->getPointer();
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;
- icocofield=new ICoCo::MEDField(parafield->getField());
+ icocofield=new ICoCo::MEDDoubleField(parafield->getField());
dec.attachLocalField(icocofield);
}
${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM
${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM/MPIAccess
${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/Swig
${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling_Swig
${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
#define INTERPKERNEL_EXPORT
%include "MEDCouplingCommon.i"
+%include "ICoCoMEDField.i"
%include "ParaMEDMEMCommon.i"
#include "OverlapDEC.hxx"
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
+#include "ICoCoMEDIntField.hxx"
#include "ComponentTopology.hxx"
#include "ParaUMesh.hxx"
#include "ParaSkyLineArray.hxx"
%include "StructuredCoincidentDEC.hxx"
%include "OverlapDEC.hxx"
-%include "ICoCoField.hxx"
-%rename(ICoCoMEDField) ICoCo::MEDField;
-%include "ICoCoMEDField.hxx"
-
%newobject MEDCoupling::ParaUMesh::New;
%newobject MEDCoupling::ParaUMesh::getMesh;
%newobject MEDCoupling::ParaUMesh::getGlobalCellIds;
nb_local=mesh.getNumberOfCells()
value = [1.0]*nb_local
parafield.getField().setValues(value)
- icocofield = ICoCoMEDField(parafield.getField())
+ icocofield = ICoCoMEDDoubleField(parafield.getField())
dec.attachLocalField(icocofield)
pass
else:
nb_local=mesh.getNumberOfCells()
value = [0.0]*nb_local
parafield.getField().setValues(value)
- icocofield = ICoCoMEDField(parafield.getField())
+ icocofield = ICoCoMEDDoubleField(parafield.getField())
dec.attachLocalField(icocofield)
pass
value = [1.0]*nb_local
parafield.getField().setValue(value)
- icocofield = ICoCo_MEDField(paramesh,parafield)
+ icocofield = ICoCoMEDDoubleField(paramesh,parafield)
dec.attachLocalField(icocofield,'P0')
pass
value = [0.0]*nb_local
parafield.getField().setValue(value)
- icocofield = ICoCo_MEDField(paramesh,parafield)
+ icocofield = ICoCoMEDDoubleField(paramesh,parafield)
dec.attachLocalField(icocofield, 'P0')
pass
for icomp in range(6):
value.append(global_numbering[ielem]*6.0+icomp);
parafield.getField().setValues(value)
- icocofield = ICoCoMEDField(parafield.getField())
+ icocofield = ICoCoMEDDoubleField(parafield.getField())
dec.setMethod("P0")
dec.attachLocalField(parafield)
dec.synchronize()
nb_local=mesh.getNumberOfCells()
value = [0.0]*(nb_local*comptopo.nbLocalComponents())
parafield.getField().setValues(value)
- icocofield = ICoCoMEDField(parafield.getField())
+ icocofield = ICoCoMEDDoubleField(parafield.getField())
dec.setMethod("P0")
dec.attachLocalField(parafield)
dec.synchronize()
${CMAKE_CURRENT_SOURCE_DIR}/../MEDPartitioner
${CMAKE_CURRENT_SOURCE_DIR}/../MEDPartitioner_Swig
${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/Swig
${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM
${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM/MPIAccess
${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM_Swig
%include "MEDCouplingRemapperCommon.i"
+%include "ICoCoMEDField.i"
+
#ifdef WITH_MED_FILE
%include "MEDLoaderCommon.i"
#endif