14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/ScopedPtr.h"
17#include "arcane/core/IMeshReader.h"
18#include "arcane/core/ISubDomain.h"
19#include "arcane/core/XmlNode.h"
20#include "arcane/core/Service.h"
21#include "arcane/core/IParallelMng.h"
22#include "arcane/core/IPrimaryMesh.h"
23#include "arcane/core/MeshVariable.h"
24#include "arcane/core/ItemPrinter.h"
25#include "arcane/core/FactoryService.h"
26#include "arcane/core/AbstractService.h"
28#include "arcane/std/SodMeshGenerator.h"
29#include "arcane/std/SimpleMeshGenerator.h"
30#include "arcane/std/CartesianMeshGenerator.h"
44class MeshGeneratorService
66 bool use_internal_partition);
73MeshGeneratorService(
const ServiceBuildInfo& sbi)
86 bool use_internal_partition)
88 ARCANE_UNUSED(filename);
89 ARCANE_UNUSED(dirname);
90 ARCANE_UNUSED(use_internal_partition);
93 String meshgen_ustr(
"meshgenerator");
98 if (!meshclass.
null()) {
100 info() <<
"Using ARCANE_MESHGENERATOR";
103 gen_node = mesh_node.
child(meshgen_ustr);
110 node = gen_node.
child(
"cartesian");
116 node = gen_node.
child(
"sod");
122 node = gen_node.
child(
"simple");
126 if (!generator.
get()) {
127 warning() <<
"Unknown mesh generator type.";
130 if (generator->readOptions(node))
132 if (generator->generateMesh())
#define ARCANE_REGISTER_SUB_DOMAIN_FACTORY(aclass, ainterface, aname)
Registers a factory service for the class aclass.
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
Interface of the service managing the reading of a mesh.
eReturnType
Types of return codes for a read or write operation.
@ RTIrrelevant
Not relevant to the operation. This means that the file format does not match this reader or that the...
@ RTError
Error during the operation.
@ RTOk
Operation successfully performed.
virtual eReturnType readMeshFromFile(IPrimaryMesh *mesh, const XmlNode &mesh_node, const String &file_name, const String &dirname, bool use_internal_partition)
Reads a mesh from a file.
virtual void build()
Build-level construction of the service.
virtual bool allowExtension(const String &str)
Checks if the service supports files with the extension str.
T * get() const
Returns the object referenced by the instance.
Encapsulation of an automatically destructing pointer.
Structure containing the information to create a service.
Simple generator for each type of mesh entity.
Mesh generator for a shock tube.
Unicode character string.
bool null() const
Returns true if the string is null.
TraceMessage info() const
Flow for an information message.
TraceMessage warning() const
Flow for a warning message.
XmlNode attr(const String &name, bool throw_exception=false) const
Returns the attribute of name name.
XmlNode childWithNameAttr(const String &elem_name, const String &attr_value) const
Returns the child of this node having the name elem_name and an attribute of name "name" with value a...
XmlNode child(const String &name) const
Child node of this node with name name.
bool null() const
True if the node is null.
bool valueAsBoolean(bool throw_exception=false) const
Node value converted to boolean.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --