--- /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/
+
+// 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-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
-//
-
-// 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-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 _ICoCoField_included_
+#define _ICoCoField_included_
+
+#include <string>
+
+namespace ICoCo {
+
+ 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
// 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>
namespace ICoCo
{
+ MEDField::MEDField() : _field(0) {}
+
+
/*! Constructor directly attaching a MEDCouplingFieldDouble
the object does not take the control the objects pointed by
\a field.
return *this;
}
+ MEDCoupling::MEDCouplingFieldDouble *MEDField::getMCField() const
+ {
+ return _field;
+ }
+
void MEDField::setMCField(MEDCoupling::MEDCouplingFieldDouble * f)
{
if(_field)
--- /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 _ICoCoMEDField_included_
+#define _ICoCoMEDField_included_
+
+#include "ICoCoField.h"
+
+namespace MEDCoupling
+{
+ class MEDCouplingFieldDouble;
+}
+
+namespace ICoCo
+{
+ class MEDField : public ICoCo::Field
+ {
+ public:
+ MEDField();
+ MEDField(MEDCoupling::MEDCouplingFieldDouble* field);
+ MEDField(const MEDField& field);
+ MEDField& operator=(const MEDField& field);
+ virtual ~MEDField();
+ MEDCoupling::MEDCouplingFieldDouble *getMCField() const;
+ void setMCField(MEDCoupling::MEDCouplingFieldDouble * f);
+
+ private:
+ MEDCoupling::MEDCouplingFieldDouble *_field;
+ };
+}
+
+#endif
// 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 *getMCField() const { return _field; }
- void setMCField(MEDCoupling::MEDCouplingFieldDouble * f);
-
- private:
- MEDCoupling::MEDCouplingFieldDouble *_field;
- };
-}
+// 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/
-#endif
+#include <ICoCoMEDField.h>
Linked into target 'medcoupling' library.
+
+The files below are part of the official ICoCo API and should NOT be modified:
+ - ICoCoField.h
+ - ICoCoField.cxx
+ - ICoCoMEDField.h
+
+Their official version can be found in the TRUST repository:
+
+ https://sourceforge.net/projects/trust/
//
// Author : Adrien Bruneton (CEA)
-
%{
-#include "ICoCoMEDField.hxx"
-
-using namespace MEDCoupling;
+#include "ICoCoMEDField.h"
%}
-namespace ICoCo
-{
- class MEDField
- {
- public:
- MEDField();
- MEDField(MEDCoupling::MEDCouplingFieldDouble* field);
- MEDField(const MEDField& field);
- MEDField& operator=(const MEDField& field);
- MEDCoupling::MEDCouplingFieldDouble *getMCField() const;
- void setMCField(MEDCoupling::MEDCouplingFieldDouble * f);
- };
-}
-
-
+%include "std_string.i"
+%include "ICoCoField.h"
+%include "ICoCoMEDField.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/ICoCoField.cpp # [ABN] Yes, .cpp, this is imposed by ICoCo.
../ICoCo/ICoCoMEDField.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" "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.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})
class ICoCoMEDFieldTest(unittest.TestCase):
def generate_fields(self):
## Dummy MCFieldDouble
- msh = MEDCouplingCMesh()
+ msh = MEDCouplingCMesh("toto")
msh.setCoords(DataArrayDouble([0.,1.,2.]))
msh = msh.buildUnstructured()
f1 = MEDCouplingFieldDouble(ON_CELLS, ONE_TIME)
def test1(self):
f1, f2 = self.generate_fields()
mf = MEDField()
+ mf.setName("titi")
+ self.assertEqual(mf.getName(), "titi")
mfd = mf.getMCField()
self.assertTrue(mfd is None)
mf.setMCField(f1)
return ;
if(!field)
throw INTERP_KERNEL::Exception("DisjointDEC::attachLocalField : ICoCo::MEDField pointer is NULL !");
- attachLocalField(field->getField());
+ attachLocalField(field->getMCField());
}
/*!
void OverlapDEC::attachSourceLocalField(ICoCo::MEDField *field)
{
- attachSourceLocalField(field->getField());
+ attachSourceLocalField(field->getMCField());
}
void OverlapDEC::attachTargetLocalField(ICoCo::MEDField *field)
{
- attachTargetLocalField(field->getField());
+ attachTargetLocalField(field->getMCField());
}
bool OverlapDEC::isInGroup() const