Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
XmfMeshWriter.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* XmfMeshWriter.cc (C) 2000-2025 */
9/* */
10/* Writing a file in Xmf format. */
11/*****************************************************************************
12/* TODO: - Work on Precision (="4"), which could be adjusted.
13 - Test for new output file
14*/
15/*****************************************************************************
16 * [Topology]
17 *****************************************************************************
18 XML Element : Topology
19 XML Attribute : Name = Any String
20 XML Attribute : TopologyType = Polyvertex | Polyline | Polygon |
21 Triangle | Quadrilateral | Tetrahedron | Pyramid| Wedge | Hexahedron |
22 Edge_3 | Triagle_6 | Quadrilateral_8 | Tetrahedron_10 | Pyramid_13 |
23 Wedge_15 | Hexahedron_20 |
24 Mixed |
25 2DSMesh | 2DRectMesh | 2DCoRectMesh |
26 3DSMesh | 3DRectMesh | 3DCoRectMesh
27 XML Attribute : NumberOfElements = Number of Cells
28 XML Attribute : NodesPerElement = # (Only Important for Polyvertex, Polygon and Polyline)
29 XML Attribute : Order = Order of Nodes if not Default
30 XML BaseOffset: Offset if not 0
31******************************************************************************
32XdmfTopology has the general class (XDMF_STRUCTURED | XDMF_UNSTRUCTURED)
33and the specific BASE type (TETRAHEDRON | 3DSMESH etc.).
34******************************************************************************
35For unstructured meshes, XdmfTopology also contains the connectivity array.
36For structured meshes, connectivity is implicit (i.e. X[i] is connected to X[i+1])
37*****************************************************************************/
38
39/*****************************************************************************
40 * [Geometry]
41 *****************************************************************************
42 XdmfGeometry is a required part of an XdmfGrid. Geometry can be specified in several different ways :
43
44 XDMF_GEOMETRY_XYZ : X0,Y0,Z0,X1,Y1,Z1 ..... XN,YN,ZN for every point
45 XDMF_GEOMETRY_X_Y_Z : X0,X1 ... XN,Y0,Y1 ... YN,Z0,Z1 ... ZN for every point
46 XDMF_GEOMETRY_VXVYVZ : X0,X1 ... XN,Y0,Y1 ... YN,Z0,Z1 ... ZN for XAxis, YAxis, ZAxis
47 XDMF_GEOMETRY_ORIGIN_DXDYDZ : Xorigin, Yorigin, Zorigin, Dx, Dy, Dz
48 ******************************************************************************
49 XML Element : Grid
50 XML Attribute : Name = Any String
51 XML Attribute : GeometryType = XYZ* | XY | X_Y_Z | X_Y | VXVYVZ | ORIGIN_DXDYDZ
52 ******************************************************************************
53 Example :
54 <Grid Name="Mesh" GridType="Uniform">
55 <Topology ...
56 <Geometry ...
57 <Attribute ...
58 </Grid>
59*****************************************************************************/
60
61/***************************************************************************** \
62* [DataItem] *
63******************************************************************************
64An XdmfDataItem is a container for data. It is of one of these types :
65
66 Uniform ...... A single DataStructure
67 HyperSlab .... A DataTransform that Subsamples some DataStructure
68 Coordinates .. A DataTransform that Subsamples via Parametric Coordinates
69 Function ..... A DataTransform described by some function
70 Collection ... Contains an Array of 1 or more DataStructures or DataTransforms
71 Tree ......... A Hierarchical group of other DataItems
72
73If not specified in the "ItemType" a Uniform item is assumed.
74A Uniform DataItem is a XdmfDataStructure or an XdmfDataTransform.
75Both XdmfDataStructure and XdmfDataTransform are maintained for backwards compatibility.
76******************************************************************************
77 XML Attribute : Name = Any String, DataItems have an optional name.
78 XML Attribute : ItemType = Uniform* | Collection | Tree | HyperSlab | Coordinates | Function
79 XML Attribute : Dimensions = K J I
80 Dimensions are listed with the slowest varying dimension first.
81 (i.e. KDim JDim IDim).
82 XML Attribute : NumberType = Float* | Int | UInt | Char | UChar
83 Type is "Char | Float | Int | Compound" with the default being Float.
84 XML Attribute : Precision = 1 | 4 | 8
85 Precision is BytesPerElement and defaults to 4 for Ints and Floats.
86 XML Attribute : Format = XML* | HDF
87 Format is any supported XDMF format but usually XML | HDF.
88\*****************************************************************************/
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93#include "arcane/utils/Iostream.h"
94#include "arcane/utils/StdHeader.h"
95#include "arcane/utils/HashTableMap.h"
96#include "arcane/utils/ValueConvert.h"
97#include "arcane/utils/ScopedPtr.h"
98#include "arcane/utils/ITraceMng.h"
99#include "arcane/utils/String.h"
100#include "arcane/utils/IOException.h"
101#include "arcane/utils/PlatformUtils.h"
102#include "arcane/utils/Collection.h"
103#include "arcane/utils/Enumerator.h"
104#include "arcane/utils/NotImplementedException.h"
105#include "arcane/utils/Real3.h"
106
107#include "arcane/core/FactoryService.h"
108#include "arcane/core/IMainFactory.h"
109#include "arcane/core/IMeshReader.h"
110#include "arcane/core/ISubDomain.h"
111#include "arcane/core/IMesh.h"
112#include "arcane/core/IItemFamily.h"
113#include "arcane/core/Item.h"
115#include "arcane/core/VariableTypes.h"
116#include "arcane/core/IVariableAccessor.h"
117#include "arcane/core/IParallelMng.h"
118#include "arcane/core/IIOMng.h"
119#include "arcane/core/IXmlDocumentHolder.h"
120#include "arcane/core/XmlNodeList.h"
121#include "arcane/core/XmlNode.h"
122#include "arcane/core/IMeshUtilities.h"
123#include "arcane/core/IMeshWriter.h"
124#include "arcane/core/BasicService.h"
125
126#define XDMF_USE_ANSI_STDLIB
127#include <vtkxdmf2/Xdmf.h>
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132namespace Arcane
133{
134
135using namespace xdmf2;
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
143class XmfMeshWriter
144: public AbstractService
145, public IMeshWriter
146{
147 public:
148
149 explicit XmfMeshWriter(const ServiceBuildInfo& sbi)
150 : AbstractService(sbi)
151 {
152 this->CurrIndent = 0;
153 }
154
155 virtual void build(void) {}
156 virtual bool writeMeshToFile(IMesh* mesh, const String& file_name);
157
158 bool xmfWriteHead(void);
159 bool xmfWriteTail(void);
160
161 bool xmfWriteDomainHeader(void);
162 bool xmfWriteDomainFooter(void);
163
164 bool xmfWriteGridHeader(char*, char*);
165 bool xmfWriteGridFooter(void);
166
167 bool xmfWriteTopologyHeader(char*, XdmfInt32);
168 bool xmfWriteTopologyFooter(void);
169
170 bool xmfWriteGeometryHeader(char* Name, XdmfInt32 GeometryType);
171 bool xmfWriteGeometryFooter(void);
172
173 bool xmfWriteDataItemHeader(XdmfInt32[3], XdmfInt32, XdmfInt32);
174 bool xmfWriteDataItemFooter(void);
175
176 void Indent(void);
177 void IncrementIndent() { this->CurrIndent++; }
178 void DecrementIndent()
179 {
180 if (this->CurrIndent >= 0)
181 this->CurrIndent--;
182 }
183
184 private:
185
186 ofstream ost;
187 void _switchXmfType(Integer, Array<Integer>&);
188 int CurrIndent;
189 char* HeavyDataSetNameString;
190};
191
192/*---------------------------------------------------------------------------*/
193/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
196/*---------------------------------------------------------------------------*/
197
198/*****************************************************************************\
199* [_switchXmfType] *
200\*****************************************************************************/
201void XmfMeshWriter::
202_switchXmfType(Integer arc_type, Array<Integer>& arcConnectivityArray)
203{
204 if (arc_type > ItemTypeMng::nbBasicItemType()) {
205 arcConnectivityArray.add(XDMF_NOTOPOLOGY);
206 return;
207 }
208
209 switch (arc_type) {
210 case (IT_NullType):
211 arcConnectivityArray.add(XDMF_NOTOPOLOGY);
212 return;
213
214 case (IT_Vertex):
215 arcConnectivityArray.add(XDMF_POLYVERTEX);
216 arcConnectivityArray.add(1ul);
217 return;
218
219 case (IT_Line2):
220 arcConnectivityArray.add(XDMF_POLYLINE);
221 arcConnectivityArray.add(2ul);
222 return;
223
224 case (IT_Triangle3):
225 arcConnectivityArray.add(XDMF_TRI);
226 return;
227 case (IT_Quad4):
228 arcConnectivityArray.add(XDMF_QUAD);
229 return;
230 case (IT_Pentagon5):
231 arcConnectivityArray.add(XDMF_POLYGON);
232 return;
233 case (IT_Hexagon6):
234 arcConnectivityArray.add(XDMF_POLYGON);
235 return;
236 case (IT_Heptagon7):
237 arcConnectivityArray.add(XDMF_POLYGON);
238 return;
239 case (IT_Octogon8):
240 arcConnectivityArray.add(XDMF_POLYGON);
241 return;
242 case (IT_Tetraedron4):
243 arcConnectivityArray.add(XDMF_TET);
244 return;
245 case (IT_Pyramid5):
246 arcConnectivityArray.add(XDMF_PYRAMID);
247 return;
248 case (IT_Pentaedron6):
249 arcConnectivityArray.add(XDMF_WEDGE);
250 return;
251 case (IT_Hexaedron8):
252 arcConnectivityArray.add(XDMF_HEX);
253 return;
254 case (IT_Heptaedron10):
255 arcConnectivityArray.add(XDMF_TET_10);
256 return;
257
258 case (IT_Octaedron12):
259 arcConnectivityArray.add(XDMF_POLYVERTEX);
260 arcConnectivityArray.add(12ul);
261 return;
262 case (IT_Enneedron14):
263 arcConnectivityArray.add(XDMF_POLYVERTEX);
264 arcConnectivityArray.add(14ul);
265 return;
266 case (IT_Decaedron16):
267 arcConnectivityArray.add(XDMF_POLYVERTEX);
268 arcConnectivityArray.add(16ul);
269 return;
270 case (IT_HemiHexa7):
271 arcConnectivityArray.add(XDMF_POLYVERTEX);
272 arcConnectivityArray.add(7ul);
273 return;
274
275 //warning IT_AntiWedgeLeft6 IT_AntiWedgeRight6 and IT_HemiHexa6 are merged
276 case (IT_HemiHexa6):
277 case (IT_AntiWedgeLeft6):
278 case (IT_AntiWedgeRight6):
279 arcConnectivityArray.add(XDMF_POLYVERTEX);
280 arcConnectivityArray.add(6ul);
281 return;
282
283 //warning IT_HemiHexa5 and IT_DiTetra5 are merged
284 case (IT_HemiHexa5):
285 case (IT_DiTetra5):
286 arcConnectivityArray.add(XDMF_POLYVERTEX);
287 arcConnectivityArray.add(5ul);
288 return;
289
290 case (IT_DualNode):
291 case (IT_DualEdge):
292 case (IT_DualFace):
293 case (IT_DualCell):
294 arcConnectivityArray.add(XDMF_NOTOPOLOGY);
295 return;
296
297 default:
298 arcConnectivityArray.add(XDMF_NOTOPOLOGY);
299 return;
300 }
301 arcConnectivityArray.add(XDMF_NOTOPOLOGY);
302}
303
304/**********************************************************************
305 * [writeMeshToFile]
306 **********************************************************************/
308writeMeshToFile(IMesh* mesh, const String& file_name)
309{
310 info() << "[XmfMeshWriter::writeMeshToFile] nNodes=" << mesh->nbNode() << " nCells=" << mesh->nbCell()
311 << " all=" << mesh->allNodes().size() << ", own=" << mesh->ownNodes().size();
312
313 /****************************
314 * XDMF-side initialisation *
315 ****************************/
316 XdmfRoot* xmfRoot = new XdmfRoot(); // represents the Root Element in Xdmf
317 XdmfDOM* xmfDom = new XdmfDOM();
318 String h5_file_name = file_name + ".h5";
319 if (platform::isFileReadable(h5_file_name))
320 if (platform::removeFile(h5_file_name))
321 ARCANE_FATAL("Could not remove .h5 file '{0}'", h5_file_name);
322 String xmfDomFileName(file_name);
323 // Add extension '.xmf' if needed.
324 if (!xmfDomFileName.endsWith(".xmf"))
325 xmfDomFileName = file_name + ".xmf";
326 if (xmfDom->SetWorkingDirectory(".") != XDMF_SUCCESS)
327 throw IOException("writeMeshToFile", "SetOutputFileName");
328 if (xmfDom->SetOutputFileName(xmfDomFileName.localstr()) != XDMF_SUCCESS)
329 throw IOException("writeMeshToFile", "SetOutputFileName");
330 xmfRoot->SetDOM(xmfDom);
331 xmfRoot->Build();
332 info() << "XDMF-side initialisation done filename='" << xmfDomFileName << "'";
333
334 // Domain initialisation
335 XdmfDomain* xmfDomain = new XdmfDomain();
336 xmfDomain->SetName(file_name.localstr());
337 xmfRoot->Insert(xmfDomain);
338 info() << "[XmfMeshWriter] Domain initialisation done";
339
340 // Grid initialisation
341 XdmfGrid* xmfGrid = new XdmfGrid();
342 xmfGrid->SetGridType(XDMF_GRID_UNIFORM);
343 info() << "[XmfMeshWriter] Grid initialisation done";
344
345 /****************************************
346 * XdmfAttribute to save Cells Unique IDs
347 ****************************************/
348 XdmfAttribute* xmfCellAttribute = new XdmfAttribute();
349 xmfCellAttribute->SetName("CellsUniqueIDs");
350 xmfCellAttribute->SetAttributeCenter(XDMF_ATTRIBUTE_CENTER_CELL);
351 xmfCellAttribute->SetAttributeType(XDMF_ATTRIBUTE_TYPE_SCALAR);
352 XdmfArray* xmfCellsUniqueIDs = xmfCellAttribute->GetValues();
353 String heavyDataForCellsUniqueIDs(h5_file_name + ":/CellsUniqueIDs");
354 xmfCellsUniqueIDs->SetHeavyDataSetName(heavyDataForCellsUniqueIDs.localstr());
355 xmfCellsUniqueIDs->SetNumberType(XDMF_INT32_TYPE);
356 xmfCellsUniqueIDs->SetNumberOfElements(mesh->nbCell());
357 XdmfInt64 cellIndex = 0;
358
359 /****************************************
360 * XdmfAttribute to save Nodes Unique IDs
361 ****************************************/
362 XdmfAttribute* xmfNodeAttribute = new XdmfAttribute();
363 xmfNodeAttribute->SetName("NodesUniqueIDs");
364 xmfNodeAttribute->SetAttributeCenter(XDMF_ATTRIBUTE_CENTER_NODE);
365 xmfNodeAttribute->SetAttributeType(XDMF_ATTRIBUTE_TYPE_SCALAR);
366 XdmfArray* xmfNodesUniqueIDs = xmfNodeAttribute->GetValues();
367 String heavyDataForNodesUniqueIDs(h5_file_name + ":/NodesUniqueIDs");
368 xmfNodesUniqueIDs->SetHeavyDataSetName(heavyDataForNodesUniqueIDs.localstr());
369 xmfNodesUniqueIDs->SetNumberType(XDMF_INT32_TYPE);
370 xmfNodesUniqueIDs->SetNumberOfElements(mesh->nbNode());
371 IntegerUniqueArray nodesUniqueIDs; // Unique nodes-IDs array
372
373 /***********************************
374 * XdmfAttribute to save Nodes Owners
375 \***********************************/
376 XdmfAttribute* xmfOwnerAttribute = new XdmfAttribute();
377 xmfOwnerAttribute->SetName("NodesOwner");
378 xmfOwnerAttribute->SetAttributeCenter(XDMF_ATTRIBUTE_CENTER_NODE);
379 xmfOwnerAttribute->SetAttributeType(XDMF_ATTRIBUTE_TYPE_SCALAR);
380 XdmfArray* xmfNodesOwners = xmfOwnerAttribute->GetValues();
381 String heavyDataForOwners(h5_file_name + ":/NodesOwners");
382 xmfNodesOwners->SetHeavyDataSetName(heavyDataForOwners.localstr());
383 xmfNodesOwners->SetNumberType(XDMF_INT32_TYPE);
384 xmfNodesOwners->SetNumberOfElements(mesh->nbNode());
385 XdmfInt64 nodeIndex = 0;
386 ENUMERATE_NODE (iNode, mesh->allNodes()) {
387 nodesUniqueIDs.add(iNode->uniqueId().asInteger());
388 xmfNodesUniqueIDs->SetValue(nodeIndex, iNode->uniqueId().asInteger());
389 xmfNodesOwners->SetValue(nodeIndex++, iNode->owner());
390 }
391
392 // Each Grid contains a Topology,
393 info() << "[XmfMeshWriter] Focussing on the topology";
394 XdmfTopology* xmfTopology = xmfGrid->GetTopology();
395 xmfTopology->SetTopologyType(XDMF_MIXED);
396 xmfTopology->SetNumberOfElements(mesh->nbCell());
397 XdmfArray* xmfConnectivityArray = xmfTopology->GetConnectivity();
398 String heavyDataForConnections(h5_file_name + ":/Connections");
399 xmfConnectivityArray->SetHeavyDataSetName(heavyDataForConnections.localstr());
400 xmfConnectivityArray->SetNumberType(XDMF_INT32_TYPE);
401 UniqueArray<XdmfInt32> arcCellConnectivityArray;
402 ENUMERATE_CELL (iCell, mesh->allCells()) { // Scanning the cells' nodes to get type and connectivity
403 Cell cell = *iCell;
404 Integer nbNodes = cell.nbNode();
405 xmfCellsUniqueIDs->SetValue(cellIndex++, iCell->uniqueId().asInteger());
406 _switchXmfType(cell.type(), arcCellConnectivityArray);
407 Integer meshNbNodes = mesh->nbNode();
408 for (Integer j = 0; j < nbNodes; ++j) {
409 Integer uid = cell.node(j).uniqueId();
410 for (Integer i = 0; i < meshNbNodes; ++i) {
411 // This is used for external viewers to be able to read our output
412 if (nodesUniqueIDs[i] != uid)
413 continue; // xmfNodesUniqueIDs->GetValueAsInt32(i) is just TOO painful to work with!
414 arcCellConnectivityArray.add(i);
415 break;
416 }
417 }
418 }
419 xmfConnectivityArray->SetNumberOfElements(arcCellConnectivityArray.size());
420 info() << "[XmfMeshWriter] arcCellConnectivityArray.size()=" << arcCellConnectivityArray.size();
421 for (XdmfInt32 idx = 0; idx < arcCellConnectivityArray.size(); ++idx)
422 xmfConnectivityArray->SetValue(idx, arcCellConnectivityArray[idx]);
423 info() << "[XmfMeshWriter] Work on grid->topology done";
424
425 // a Geometry,
426 XdmfGeometry* xmfGeometry = xmfGrid->GetGeometry();
427 xmfGeometry->SetGeometryType(XDMF_GEOMETRY_XYZ);
428 //xmfGeometry->SetNumberOfPoints(mesh->nbNode());
429 XdmfArray* xmfNodeGeometryArray = xmfGeometry->GetPoints();
430 String heavyDataForGeometry(h5_file_name + ":/XYZ");
431 xmfNodeGeometryArray->SetHeavyDataSetName(heavyDataForGeometry.localstr());
432 xmfNodeGeometryArray->SetNumberType(XDMF_FLOAT32_TYPE);
433 xmfNodeGeometryArray->SetNumberOfElements(3 * mesh->nbNode()); // Number of points in this geometry
434 VariableItemReal3& nodes_coords = mesh->nodesCoordinates();
435 XdmfInt64 Index = 0;
436 ENUMERATE_NODE (iNode, mesh->allNodes()) {
437 const Node& node = *iNode;
438 xmfNodeGeometryArray->SetValue(Index++, Convert::toDouble(nodes_coords[iNode].x));
439 xmfNodeGeometryArray->SetValue(Index++, Convert::toDouble(nodes_coords[iNode].y));
440 xmfNodeGeometryArray->SetValue(Index++, Convert::toDouble(nodes_coords[iNode].z));
441 //info() << "[writeMeshToFile] Adding node[" << iNode->uniqueId() << "]";
442 }
443 info() << "[XmfMeshWriter] Work on Geometry done";
444 xmfDomain->Insert(xmfGrid);
445
446 /*************************
447 * Fetching Other Groups
448 * XML Attribute : Name
449 * XML Attribute : AttributeType = Scalar* | Vector | Tensor | Tensor6 | Matrix
450 * XML Attribute : Center = Node* | Cell | Grid | Face | Edge
451 ************************/
452 info() << "[XmfMeshWriter] Working on Groups";
453 for (ItemGroupCollection::Enumerator arcGroup(mesh->groups()); ++arcGroup;) {
454 if ((*arcGroup == mesh->cellFamily()->allItems()) || (*arcGroup == mesh->nodeFamily()->allItems()) ||
455 (*arcGroup == mesh->edgeFamily()->allItems()) || (*arcGroup == mesh->faceFamily()->allItems()))
456 continue;
457 info() << "[writeMeshToFile] Found a " << arcGroup->itemKind() << "-group " << arcGroup->name();
458 XdmfAttribute* xmfAttribute = new XdmfAttribute();
459 xmfAttribute->SetName(arcGroup->name().localstr());
460 xmfAttribute->SetAttributeCenter(XDMF_ATTRIBUTE_CENTER_NODE);
461 xmfAttribute->SetAttributeType(XDMF_ATTRIBUTE_TYPE_SCALAR);
462 XdmfArray* xmfGroup = xmfAttribute->GetValues();
463 String heavyDataForGroup(h5_file_name + ":/" + arcGroup->name());
464 xmfGroup->SetHeavyDataSetName(heavyDataForGroup.localstr());
465 xmfGroup->SetNumberType(XDMF_INT32_TYPE);
466 xmfGroup->SetNumberOfElements(1 + arcGroup->size());
467 XdmfInt64 Index = 0;
468 xmfGroup->SetValue(Index++, arcGroup->itemKind());
469 ENUMERATE_ITEM (iItem, *arcGroup) {
470 xmfGroup->SetValue(Index++, iItem->uniqueId().asInteger());
471 }
472 xmfGrid->Insert(xmfAttribute);
473 }
474 xmfGrid->Insert(xmfCellAttribute);
475 xmfGrid->Insert(xmfNodeAttribute);
476 xmfGrid->Insert(xmfOwnerAttribute);
477 xmfGrid->Build();
478
479 /********************
480 * Output & cleanup *
481 ********************/
482 xmfDom->Write();
483
484 delete xmfCellAttribute;
485 delete xmfNodeAttribute;
486 delete xmfOwnerAttribute;
487 delete xmfGrid;
488 delete xmfDomain;
489 delete xmfRoot;
490 delete xmfDom;
491
492 info() << "[XmfMeshWriter] Done";
493 return false;
494}
495
496/*---------------------------------------------------------------------------*/
497/*---------------------------------------------------------------------------*/
498
499} // namespace Arcane
500
501/*---------------------------------------------------------------------------*/
502/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Types and macros for iterating over mesh entities.
#define ENUMERATE_CELL(name, group)
Generic enumerator for a cell group.
#define ENUMERATE_ITEM(name, group)
Generic enumerator for a node group.
#define ENUMERATE_NODE(name, group)
Generic enumerator for a node group.
#define ARCANE_REGISTER_SUB_DOMAIN_FACTORY(aclass, ainterface, aname)
Registers a factory service for the class aclass.
Integer size() const
Number of elements in the vector.
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
Base class for 1D data vectors.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Cell of a mesh.
Definition Item.h:1300
Interface of a mesh writing service.
Definition IMeshWriter.h:38
Exception when an input/output error is detected.
Definition IOException.h:34
static Integer nbBasicItemType()
number of available types
Node node(Int32 i) const
i-th node of the entity
Definition Item.h:840
Int32 nbNode() const
Number of nodes of the entity.
Definition Item.h:837
ItemUniqueId uniqueId() const
Unique identifier across all domains.
Definition Item.h:239
Int16 type() const
Entity type.
Definition Item.h:255
Node of a mesh.
Definition Item.h:598
Structure containing the information to create a service.
const char * localstr() const
Returns the conversion of the instance into UTF-8 encoding.
Definition String.cc:229
bool endsWith(const String &s) const
Indicates if the string ends with the characters of s.
Definition String.cc:1095
TraceMessage info() const
Flow for an information message.
1D data vector with value semantics (STL style).
Writing mesh files in xmf format.
virtual bool writeMeshToFile(IMesh *mesh, const String &file_name)
Writes a mesh to a file.
virtual void build(void)
Build-level construction of the service.
ItemVariableScalarRefT< Real3 > VariableItemReal3
3D coordinate type quantity
double toDouble(Real r)
Converts a Real to double.
bool removeFile(const String &file_name)
Delete the file file_name.
bool isFileReadable(const String &file_name)
Checks if the file file_name is accessible and readable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
UniqueArray< Integer > IntegerUniqueArray
Dynamic 1D array of integers.
Definition UtilsTypes.h:347