Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMeshReader.h
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/* IMeshReader.h (C) 2000-2025 */
9/* */
10/* Interface of a mesh reading service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMESHREADER_H
13#define ARCANE_CORE_IMESHREADER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \ingroup StandardService
30 * \brief Interface of the service managing the reading of a mesh.
31 */
32class ARCANE_CORE_EXPORT IMeshReader
33{
34 public:
35
36 //! Types of return codes for a read or write operation
38 {
39 RTOk, //!< Operation successfully performed
40 RTError, //!< Error during the operation
41 /*! \brief Not relevant to the operation.
42 * This means that the file format does not match
43 * this reader or that the service does not support
44 * this operation.
45 */
47 };
48
49 public:
50
51 virtual ~IMeshReader() = default; //!< Frees resources
52
53 public:
54
55 //! Checks if the service supports files with the extension \a str
56 virtual bool allowExtension(const String& str) = 0;
57
58 /*! \brief Reads a mesh from a file.
59 *
60 * Reads the geometry of a mesh from the file \a file_name
61 * as well as the corresponding partitioning information
62 * and constructs the corresponding mesh in \a mesh.
63 *
64 * If \a use_internal_partition is true, it means that the partitioning
65 * has not yet been done and will be done by Arcane. In this case,
66 * only one processor can read the mesh. However, the others
67 * must still create all possible groups.
68 * This argument is only useful in parallel.
69
70 * If \a dir_name is not null, this path serves as the base for reading
71 * meshes and partitioning information.
72 */
74 const XmlNode& mesh_element,
75 const String& file_name,
76 const String& dir_name,
77 bool use_internal_partition) = 0;
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88#endif
Declarations of Arcane's general types.
Interface of the service managing the reading of a mesh.
Definition IMeshReader.h:33
virtual bool allowExtension(const String &str)=0
Checks if the service supports files with the extension str.
virtual eReturnType readMeshFromFile(IPrimaryMesh *mesh, const XmlNode &mesh_element, const String &file_name, const String &dir_name, bool use_internal_partition)=0
Reads a mesh from a file.
virtual ~IMeshReader()=default
Frees resources.
eReturnType
Types of return codes for a read or write operation.
Definition IMeshReader.h:38
@ RTIrrelevant
Not relevant to the operation. This means that the file format does not match this reader or that the...
Definition IMeshReader.h:46
@ RTError
Error during the operation.
Definition IMeshReader.h:40
@ RTOk
Operation successfully performed.
Definition IMeshReader.h:39
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --