From: abn Date: Tue, 14 Jun 2016 13:12:41 +0000 (+0200) Subject: Moved ICoCo interface into a standalone sub-directory. X-Git-Tag: V8_1_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1601954294492db13b626e8ac1d78b16eae7b605;p=tools%2Fmedcoupling.git Moved ICoCo interface into a standalone sub-directory. + Is compiled even when no MPI + Is now linked within medcoupling target instead of paramedmem --- diff --git a/src/ICoCo/ICoCoField.cxx b/src/ICoCo/ICoCoField.cxx new file mode 100644 index 000000000..ed972a69c --- /dev/null +++ b/src/ICoCo/ICoCoField.cxx @@ -0,0 +1,49 @@ +// Copyright (C) 2007-2016 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 + +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(); +} diff --git a/src/ICoCo/ICoCoField.hxx b/src/ICoCo/ICoCoField.hxx new file mode 100644 index 000000000..7181c28b3 --- /dev/null +++ b/src/ICoCo/ICoCoField.hxx @@ -0,0 +1,43 @@ +// Copyright (C) 2007-2016 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.h +// version 1.2 10/05/2010 + +#ifndef _ICoCoField_included_ +#define _ICoCoField_included_ +#include + + +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 diff --git a/src/ICoCo/ICoCoMEDField.cxx b/src/ICoCo/ICoCoMEDField.cxx new file mode 100644 index 000000000..3cd7db973 --- /dev/null +++ b/src/ICoCo/ICoCoMEDField.cxx @@ -0,0 +1,62 @@ +// Copyright (C) 2007-2016 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; + } +} diff --git a/src/ICoCo/ICoCoMEDField.hxx b/src/ICoCo/ICoCoMEDField.hxx new file mode 100644 index 000000000..86e809f34 --- /dev/null +++ b/src/ICoCo/ICoCoMEDField.hxx @@ -0,0 +1,46 @@ +// Copyright (C) 2007-2016 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 +#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 diff --git a/src/ICoCo/Readme.txt b/src/ICoCo/Readme.txt new file mode 100644 index 000000000..5117faae3 --- /dev/null +++ b/src/ICoCo/Readme.txt @@ -0,0 +1 @@ +Linked into target 'medcoupling' library. diff --git a/src/MEDCoupling/CMakeLists.txt b/src/MEDCoupling/CMakeLists.txt index f597d6bee..65be9e5a8 100644 --- a/src/MEDCoupling/CMakeLists.txt +++ b/src/MEDCoupling/CMakeLists.txt @@ -24,6 +24,7 @@ ENDIF(MEDCOUPLING_BUILD_TESTS) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/../.. + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D @@ -60,6 +61,8 @@ SET(medcoupling_SOURCES MEDCouplingMatrix.cxx MEDCouplingPartDefinition.cxx MEDCouplingSkyLineArray.cxx + ../ICoCo/ICoCoField.cxx + ../ICoCo/ICoCoMEDField.cxx ) SET(medcouplingremapper_SOURCES @@ -76,7 +79,8 @@ INSTALL(TARGETS medcouplingremapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATIO FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") FILE(GLOB medcoupling_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx") -INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} MEDCouplingNatureOfFieldEnum DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) +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}) # To allow usage as SWIG dependencies: SET(medcoupling_HEADERS_HXX PARENT_SCOPE) diff --git a/src/ParaMEDMEM/CMakeLists.txt b/src/ParaMEDMEM/CMakeLists.txt index dfa8c13a1..4ba14124d 100644 --- a/src/ParaMEDMEM/CMakeLists.txt +++ b/src/ParaMEDMEM/CMakeLists.txt @@ -24,6 +24,7 @@ INCLUDE_DIRECTORIES( ${MPI_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D @@ -53,8 +54,6 @@ SET(paramedmem_SOURCES ExplicitTopology.cxx MxN_Mapping.cxx OverlapMapping.cxx - ICoCoMEDField.cxx - ICoCoField.cxx ParaFIELD.cxx ParaGRID.cxx BlockTopology.cxx diff --git a/src/ParaMEDMEM/ICoCoField.cxx b/src/ParaMEDMEM/ICoCoField.cxx deleted file mode 100644 index ef53d479b..000000000 --- a/src/ParaMEDMEM/ICoCoField.cxx +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2007-2016 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 -#include - -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(); -} diff --git a/src/ParaMEDMEM/ICoCoField.hxx b/src/ParaMEDMEM/ICoCoField.hxx deleted file mode 100644 index 7181c28b3..000000000 --- a/src/ParaMEDMEM/ICoCoField.hxx +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2007-2016 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.h -// version 1.2 10/05/2010 - -#ifndef _ICoCoField_included_ -#define _ICoCoField_included_ -#include - - -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 diff --git a/src/ParaMEDMEM/ICoCoMEDField.cxx b/src/ParaMEDMEM/ICoCoMEDField.cxx deleted file mode 100644 index b0672549d..000000000 --- a/src/ParaMEDMEM/ICoCoMEDField.cxx +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2007-2016 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; - } -} diff --git a/src/ParaMEDMEM/ICoCoMEDField.hxx b/src/ParaMEDMEM/ICoCoMEDField.hxx deleted file mode 100644 index 322848965..000000000 --- a/src/ParaMEDMEM/ICoCoMEDField.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2007-2016 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 "ICoCoField.hxx" -#include "MEDCouplingUMesh.hxx" -#include "MEDCouplingFieldDouble.hxx" - -#include - -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 diff --git a/src/ParaMEDMEMTest/CMakeLists.txt b/src/ParaMEDMEMTest/CMakeLists.txt index 0376fb2eb..7c376fb6c 100644 --- a/src/ParaMEDMEMTest/CMakeLists.txt +++ b/src/ParaMEDMEMTest/CMakeLists.txt @@ -26,6 +26,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNELTest # for TestIKUtils.hxx diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index 3bba54474..603a63ad3 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES( ${MPI_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM + ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling_Swig ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader