14#include "arcane/utils/ArcanePrecomp.h"
15#include "arcane/utils/Iostream.h"
16#include "arcane/utils/StdHeader.h"
17#include "arcane/utils/HashTableMap.h"
18#include "arcane/utils/ValueConvert.h"
19#include "arcane/utils/ScopedPtr.h"
20#include "arcane/utils/ITraceMng.h"
21#include "arcane/utils/String.h"
22#include "arcane/utils/IOException.h"
23#include "arcane/utils/Collection.h"
24#include "arcane/utils/Enumerator.h"
25#include "arcane/utils/NotImplementedException.h"
26#include "arcane/utils/Real3.h"
28#include "arcane/FactoryService.h"
29#include "arcane/IMainFactory.h"
30#include "arcane/IMeshReader.h"
31#include "arcane/ISubDomain.h"
32#include "arcane/IMesh.h"
33#include "arcane/IMeshSubMeshTransition.h"
34#include "arcane/IItemFamily.h"
35#include "arcane/Item.h"
36#include "arcane/ItemEnumerator.h"
37#include "arcane/VariableTypes.h"
38#include "arcane/IVariableAccessor.h"
39#include "arcane/IParallelMng.h"
40#include "arcane/IIOMng.h"
41#include "arcane/IXmlDocumentHolder.h"
42#include "arcane/XmlNodeList.h"
43#include "arcane/XmlNode.h"
44#include "arcane/IMeshUtilities.h"
45#include "arcane/IMeshWriter.h"
46#include "arcane/BasicService.h"
47#include "arcane/utils/PlatformUtils.h"
49#include "arcane/AbstractService.h"
51#include <vtkXMLUnstructuredGridReader.h>
52#include <vtkIdTypeArray.h>
53#include "vtkXMLUnstructuredGridWriter.h"
54#include <vtkUnstructuredGrid.h>
57#include <vtkDataObject.h>
58#include <vtkDataSet.h>
59#include <vtkCellData.h>
60#include <vtkPointData.h>
61#include <vtkDataArray.h>
62#include <vtkLongArray.h>
63#include <vtkIntArray.h>
64#include <vtkFieldData.h>
97 ServiceProperty(
"VtuNewMeshWriter",ST_SubDomain),
109_writeFieldGroupsFromData(vtkFieldData*fieldData,ItemGroup group)
111 vtkLongArray* a = vtkLongArray::New();
112 a->SetName(group.name().localstr());
114 a->InsertNextValue(group.itemKind());
117 a->InsertNextValue(iitem->uniqueId());
120 a->SetNumberOfTuples(a->GetNumberOfTuples());
121 fieldData->AddArray(a);
145 <<
" all=" << mesh->
allNodes().size() <<
", own=" << mesh->
ownNodes().size();
152 points->SetDataTypeToDouble();
164 info() <<
"[writeMeshToFile] Creating array of CELLS Unique IDs";
178 info() <<
"[writeMeshToFile] Creating array of NODES Unique IDs";
189 points->InsertNextPoint(Convert::toDouble(
coord.x),
190 Convert::toDouble(
coord.y),
191 Convert::toDouble(
coord.z));
206 info() <<
"[writeMeshToFile] Now setting point into grid";
212 info() <<
"[writeMeshToFile] Now scanning cells' nodes to create connectivity";
223 ARCANE_FATAL(
"InternalError: no index for uid '{0}'",node_uid);
230 case(IT_Tetraedron4):
241 case(IT_Octaedron12):
244 case(IT_Heptaedron10):
249 case(IT_Pentaedron6):
255 info() <<
"VTK_POLY_VERTEX";
259 info() <<
"VTK_POLY_VERTEX";
263 info() <<
"VTK_POLY_VERTEX";
266 case(IT_AntiWedgeLeft6):
267 info() <<
"VTK_POLY_VERTEX";
270 case(IT_AntiWedgeRight6):
271 info() <<
"VTK_POLY_VERTEX";
275 info() <<
"VTK_POLY_VERTEX";
280 info() <<
"[writeMeshToFile] Cell type not suported (" << cell.
type() <<
")";
292 info() <<
"[writeMeshToFile] ## Now Fetching Groups ##";
298 info() <<
"[writeMeshToFile] Found a " <<
igroup->itemKind() <<
"-group " <<
igroup->name();
310 String isAscii = platform::getEnvironmentVariable(
"ARCANE_VTU_DATA_MODE_TO_ASCII");
323 info() <<
"[writeMeshToFile] Done";
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro pour déclarer une interface lors de l'enregistrement d'un service.
Classe de base d'un service.
virtual NodeGroup ownNodes()=0
Groupe de tous les noeuds propres au domaine.
virtual Integer nbCell()=0
Nombre de mailles du maillage.
virtual Integer nbNode()=0
Nombre de noeuds du maillage.
virtual NodeGroup allNodes()=0
Groupe de tous les noeuds.
virtual CellGroup allCells()=0
Groupe de toutes les mailles.
Interface d'un service d'écriture d'un maillage.
virtual ItemGroupCollection groups()=0
Liste des groupes.
Groupe d'entités de maillage.
Node node(Int32 i) const
i-ème noeud de l'entité
Int32 nbNode() const
Nombre de noeuds de l'entité
Int32 owner() const
Numéro du sous-domaine propriétaire de l'entité
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
Int16 type() const
Type de l'entité
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Classe gérant un vecteur de réel de dimension 3.
Structure contenant les informations pour créer un service.
Ecriture des fichiers de maillage au format VTU (de VTK).
virtual void build()
Construction de niveau build du service.
Exception lorsqu'une opération n'est pas supportée.
Chaîne de caractères unicode.
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property,...)
Macro pour enregistrer un service.