1 // Copyright (C) 2007-2012 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.
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 #ifndef MEDSPLITTER_MESHCOLLECTIONMEDASCIIDRIVER_H
20 #define MEDSPLITTER_MESHCOLLECTIONMEDASCIIDRIVER_H
23 #include <libxml/tree.h>
24 #include <libxml/parser.h>
25 #include <libxml/xpath.h>
26 #include <libxml/xpathInternals.h>
28 /*!reads a distributed field
30 * \param fields vector of fields (one field per subdomain)
31 * \param fieldname name of the field
32 * \param itnumber number of iteration
33 * \param ordernumber internal number inside the iteration
36 void MESHCollectionMedAsciiDriver::_readFields(vector<MEDMEM::FIELD<T>* >& fields,char* fieldname, int itnumber, int ordernumber)
38 for (unsigned i=0; i<_collection->getMesh().size(); i++)
41 strcpy(filename,_filename[i].c_str());
42 cout << "maillage : " << filename << " champ : " << fieldname << endl;
43 // MEDMEM::FIELD<T>* field = new MEDMEM::FIELD<T>(MEDMEM::MED_DRIVER,filename,fieldname,itnumber,ordernumber);
44 fields.push_back (new MEDMEM::FIELD<T>(MEDMEM::MED_DRIVER,filename,fieldname,itnumber,ordernumber));
49 /*!writes a distributed field
51 * \param fields vector of fields (one field per subdomain)
52 * \param fieldname name of the field
55 void MESHCollectionMedAsciiDriver::_writeFields(vector<MEDMEM::FIELD<T>* >& fields,char* fieldname)
57 for (unsigned i=0; i<_collection->getMesh().size(); i++)
60 strcpy(filename,_filename[i].c_str());
61 int driverid = fields[i]->addDriver(MEDMEM::MED_DRIVER, filename, fieldname);
62 fields[i]->write(driverid);