00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef __PARAFIELD_HXX__ 00021 #define __PARAFIELD_HXX__ 00022 00023 #include "MEDCouplingRefCountObject.hxx" 00024 #include "ComponentTopology.hxx" 00025 00026 namespace ParaMEDMEM 00027 { 00028 class DataArrayInt; 00029 class ParaMESH; 00030 class ProcessorGroup; 00031 class MEDCouplingFieldDouble; 00032 class ComponentTopology; 00033 class Topology; 00034 00035 class ParaFIELD 00036 { 00037 public: 00038 00039 ParaFIELD(TypeOfField type, TypeOfTimeDiscretization td, ParaMESH* mesh, const ComponentTopology& component_topology); 00040 00041 00042 ParaFIELD(MEDCouplingFieldDouble* field, ParaMESH *sup, const ProcessorGroup& group); 00043 00044 virtual ~ParaFIELD(); 00045 void synchronizeTarget( ParaMEDMEM::ParaFIELD* source_field); 00046 void synchronizeSource( ParaMEDMEM::ParaFIELD* target_field); 00047 MEDCouplingFieldDouble* getField() const { return _field; } 00048 void setOwnSupport(bool v) const { _own_support=v; } 00049 DataArrayInt* returnCumulativeGlobalNumbering() const; 00050 DataArrayInt* returnGlobalNumbering() const; 00051 Topology* getTopology() const { return _topology; } 00052 ParaMESH* getSupport() const { return _support; } 00053 int nbComponents() const; 00054 double getVolumeIntegral(int icomp, bool isWAbs) const; 00055 double getL2Norm()const { return -1; } 00056 private: 00057 MEDCouplingFieldDouble* _field; 00058 ParaMEDMEM::ComponentTopology _component_topology; 00059 Topology* _topology; 00060 mutable bool _own_support; 00061 ParaMESH* _support; 00062 }; 00063 00064 } 00065 00066 #endif