1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay
21 #ifndef __MEDCOUPLINGAMRATTRIBUTE_HXX__
22 #define __MEDCOUPLINGAMRATTRIBUTE_HXX__
24 #include "MEDCoupling.hxx"
25 #include "MEDCouplingCartesianAMRMesh.hxx"
30 class DataArrayDoubleCollection : public RefCountObject, public TimeLabel
33 static DataArrayDoubleCollection *New(const std::vector< std::pair<std::string,int> >& fieldNames);
34 void allocTuples(int nbOfTuples);
36 void spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames);
38 DataArrayDoubleCollection(const std::vector< std::pair<std::string,int> >& fieldNames);
39 std::size_t getHeapMemorySizeWithoutChildren() const;
40 std::vector<const BigMemoryObject *> getDirectChildren() const;
41 void updateTime() const;
42 static void CheckDiscriminantNames(const std::vector<std::string>& names);
44 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > _arrs;
47 class MEDCouplingGridCollection : public RefCountObject, public TimeLabel
50 static MEDCouplingGridCollection *New(const std::vector<const MEDCouplingCartesianAMRMeshGen *>& ms, const std::vector< std::pair<std::string,int> >& fieldNames);
51 void alloc(int ghostLev);
53 void spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames);
55 MEDCouplingGridCollection(const std::vector<const MEDCouplingCartesianAMRMeshGen *>& ms, const std::vector< std::pair<std::string,int> >& fieldNames);
56 std::size_t getHeapMemorySizeWithoutChildren() const;
57 std::vector<const BigMemoryObject *> getDirectChildren() const;
58 void updateTime() const;
60 std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > > _map_of_dadc;
64 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
67 MEDCOUPLING_EXPORT static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair<std::string,int> >& fieldNames);
68 MEDCOUPLING_EXPORT void spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames);
70 MEDCOUPLING_EXPORT void alloc(int ghostLev);
71 MEDCOUPLING_EXPORT void dealloc();
72 MEDCOUPLING_EXPORT bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
74 MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
75 MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
76 MEDCOUPLING_EXPORT void updateTime() const;
78 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair<std::string,int> >& fieldNames);
80 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> > _levs;