Functions | |
| MEDMEM::FIELD.FIELD (const SUPPORT *Support, driverTypes driverType, const string &fileName="", const string &fieldName="", const int iterationNumber=-1, const int orderNumber=-1) throw (MEDEXCEPTION) | |
| MEDMEM::FIELD.FIELD (driverTypes driverType, const string &fileName, const string &fieldDriverName, const int iterationNumber=-1, const int orderNumber=-1, GMESH *mesh=0) throw (MEDEXCEPTION) | |
Fields can be read or written to/from MED files.
For reading a field a typical use consists in :
As an example :
//reading mesh from file MESH mesh(MED_DRIVER, "file.med", "my_Mesh"); //reading the field from the file FIELD<double> field(group,MED_DRIVER,"file.med","my_Field",1,1,&mesh);
It is also possible to read a field without specifying its support. In this case, the field constructor creates a support with no link to the initial mesh:
FIELD<double> field(MED_DRIVER, "file.med", "myField",1,1); SUPPORT* support= field->getSupport();
See also FIELD<T> constructors
When it comes to write fields, it is enough to call write() method. A typical use will be :
mesh.write(MED_DRIVER, "myResultFile.med"); field.write(MED_DRIVER, "myResultFile.med");
| MEDMEM.FIELD< T, INTERLACING_TAG >::FIELD | ( | const SUPPORT * | Support, |
| driverTypes | driverType, | ||
| const string & | fileName = "", |
||
| const string & | fieldDriverName = "", |
||
| const int | iterationNumber = -1, |
||
| const int | orderNumber = -1 |
||
| ) | throw (MEDEXCEPTION) [inherited] |
Constructor with parameters; the object is set via a file and its associated driver. For the moment only the MED_DRIVER is considered and if the last two argument (iterationNumber and orderNumber) are not set; their default value is -1. If the field fieldDriverName with the iteration number iterationNumber and the order number orderNumber does not exist in the file fieldDriverName; the constructor raises an exception.
References MEDMEM.FIELD_._interlacingType, MEDMEM.FIELD_._valueType, ASSERT_MED, BEGIN_OF_MED, END_OF_MED, init, test_profil_MedFieldDriver.iterationNumber, MED_EN.MED_UNDEFINED_INTERLACE, MED_EN.MED_UNDEFINED_TYPE, test_profil_MedFieldDriver.orderNumber, and MED_EN.RDONLY.
| MEDMEM.FIELD< T, INTERLACING_TAG >::FIELD | ( | driverTypes | driverType, |
| const string & | fileName, | ||
| const string & | fieldDriverName, | ||
| const int | iterationNumber = -1, |
||
| const int | orderNumber = -1, |
||
| GMESH * | mesh = 0 |
||
| ) | throw (MEDEXCEPTION) [inherited] |
If the mesh argument is not initialized or passed NULL, this constructor, at least, allows to create a FIELD without creating any SUPPORT then without having to load a MESH object, a support is created. It provides the meshName related mesh but doesn't not set a mesh in the created support. If the passed mesh contains corresponding support, this support will be used for the field. This support will be found in mesh by name of one of profiles, on which the FIELD lays in MED-file. This has sense for the case, then MED-file was created by MEDMEM, and so name of profile contains name of corresponding support.
References MEDMEM.FIELD_._interlacingType, MEDMEM.FIELD_._valueType, ASSERT_MED, BEGIN_OF_MED, END_OF_MED, init, test_profil_MedFieldDriver.iterationNumber, MED_EN.MED_UNDEFINED_INTERLACE, MED_EN.MED_UNDEFINED_TYPE, MED_test2.mesh, test_profil_MedFieldDriver.orderNumber, and MED_EN.RDONLY.