Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MshMeshWriter Class Reference

Writing mesh files in msh format. More...

Inheritance diagram for Arcane::MshMeshWriter:
Collaboration diagram for Arcane::MshMeshWriter:

Classes

class  ArcaneToMshTypeInfo
 Information mapping between MSH type and Arcane type. More...
class  ItemFamilyWriteInfo
struct  PhysicalTagInfo
struct  EntityInfo
class  ItemGroupWriteInfo

Public Member Functions

 MshMeshWriter (IMesh *mesh)
void writeMesh (const String &file_name)
 Writes in MSH V4 format.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Types

using MshPeriodicOneInfo = impl::MshMeshGenerationInfo::MshPeriodicOneInfo

Private Member Functions

bool _writeMeshToFileV4 (IMesh *mesh, const String &file_name)
std::pair< Int64, Int64_getFamilyMinMaxUniqueId (IItemFamily *family)
void _addGroupsToProcess (IItemFamily *family, Array< ItemGroup > &items_groups)
 Determines the list of groups to process for a family.
void _writeEntities (std::ostream &ofile)
 Writes the block containing the entities ($Entities).
void _writeNodes (std::ostream &ofile)
 Writes the block containing the nodes ($Nodes).
void _writeElements (std::ostream &ofile, Int64 total_nb_cell)
 Writes the block containing the elements ($Elements).
void _writePeriodic (std::ostream &ofile)
void _initTypes ()
void _addArcaneTypeInfo (ItemTypeId arcane_type, Int32 msh_type, ConstArrayView< Int16 > reorder_infos={})
const ArcaneToMshTypeInfoarcaneToMshTypeInfo (ItemTypeId arcane_type) const

Private Attributes

IMeshm_mesh = nullptr
ItemTypeMngm_item_type_mng = nullptr
UniqueArray< PhysicalTagInfom_physical_tags
FixedArray< Int32, 4 > m_nb_entities_by_dim
std::vector< std::unique_ptr< ItemGroupWriteInfo > > m_groups_write_info_list
 List of information to write for each group.
impl::MshMeshGenerationInfom_mesh_info = nullptr
bool m_has_periodic_info = false
UniqueArray< ArcaneToMshTypeInfom_arcane_to_msh_type_infos
 Information on conversion between Arcane and MSH types for entities.

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Writing mesh files in msh format.

Definition at line 44 of file MshMeshWriter.cc.

Member Typedef Documentation

◆ MshPeriodicOneInfo

using Arcane::MshMeshWriter::MshPeriodicOneInfo = impl::MshMeshGenerationInfo::MshPeriodicOneInfo
private

Definition at line 47 of file MshMeshWriter.cc.

Constructor & Destructor Documentation

◆ MshMeshWriter()

Arcane::MshMeshWriter::MshMeshWriter ( IMesh * mesh)
explicit

Definition at line 183 of file MshMeshWriter.cc.

Member Function Documentation

◆ _addArcaneTypeInfo()

void Arcane::MshMeshWriter::_addArcaneTypeInfo ( ItemTypeId arcane_type,
Int32 msh_type,
ConstArrayView< Int16 > reorder_infos = {} )
private

Definition at line 738 of file MshMeshWriter.cc.

◆ _addGroupsToProcess()

void Arcane::MshMeshWriter::_addGroupsToProcess ( IItemFamily * family,
Array< ItemGroup > & items_groups )
private

Determines the list of groups to process for a family.

The list of groups to save will be added to items_groups.

Note
For now, we only support that the set of groups forms a partition of the family's entities.

Definition at line 270 of file MshMeshWriter.cc.

References Arcane::Array< T >::add(), Arcane::IItemFamily::allItems(), Arcane::IItemFamily::groups(), Arcane::IK_Cell, Arcane::TraceAccessor::info(), and Arcane::IItemFamily::itemKind().

Referenced by writeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getFamilyMinMaxUniqueId()

std::pair< Int64, Int64 > Arcane::MshMeshWriter::_getFamilyMinMaxUniqueId ( IItemFamily * family)
private

Definition at line 685 of file MshMeshWriter.cc.

◆ _initTypes()

void Arcane::MshMeshWriter::_initTypes ( )
private

Definition at line 704 of file MshMeshWriter.cc.

◆ _writeElements()

void Arcane::MshMeshWriter::_writeElements ( std::ostream & ofile,
Int64 total_nb_cell )
private

Writes the block containing the elements ($Elements).

Definition at line 548 of file MshMeshWriter.cc.

References Arcane::ConstArrayView< T >::empty(), ENUMERATE_, Arcane::TraceAccessor::info(), Arcane::ItemGroup::itemFamily(), m_groups_write_info_list, Arcane::IItemFamily::name(), Arcane::ItemTypeInfo::nbLocalNode(), Arcane::ItemWithNodes::node(), Arcane::ConstArrayView< T >::size(), Arcane::ItemTypeInfo::typeName(), Arcane::Item::uniqueId(), and Arcane::IItemFamily::view().

Referenced by writeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _writeEntities()

void Arcane::MshMeshWriter::_writeEntities ( std::ostream & ofile)
private

Writes the block containing the entities ($Entities).

Definition at line 404 of file MshMeshWriter.cc.

References ENUMERATE_, m_groups_write_info_list, Arcane::math::max(), Arcane::math::min(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.

Referenced by writeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _writeNodes()

void Arcane::MshMeshWriter::_writeNodes ( std::ostream & ofile)
private

Writes the block containing the nodes ($Nodes).

Definition at line 495 of file MshMeshWriter.cc.

References ENUMERATE_, Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.

Referenced by writeMesh().

Here is the caller graph for this function:

◆ _writePeriodic()

void Arcane::MshMeshWriter::_writePeriodic ( std::ostream & ofile)
private

Definition at line 610 of file MshMeshWriter.cc.

◆ arcaneToMshTypeInfo()

const MshMeshWriter::ArcaneToMshTypeInfo & Arcane::MshMeshWriter::arcaneToMshTypeInfo ( ItemTypeId arcane_type) const
private

Definition at line 751 of file MshMeshWriter.cc.

◆ writeMesh()

void Arcane::MshMeshWriter::writeMesh ( const String & file_name)

Writes in MSH V4 format.

Parameters
meshInput mesh
file_nameOutput file name
Return values
trueif any error is detected
falseotherwise

Definition at line 304 of file MshMeshWriter.cc.

References _addGroupsToProcess(), _writeElements(), _writeEntities(), _writeNodes(), ARCANE_THROW, Arcane::String::endsWith(), Arcane::TraceAccessor::info(), Arcane::String::localstr(), and m_groups_write_info_list.

Referenced by Arcane::MshMeshWriterService::writeMeshToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_arcane_to_msh_type_infos

UniqueArray<ArcaneToMshTypeInfo> Arcane::MshMeshWriter::m_arcane_to_msh_type_infos
private

Information on conversion between Arcane and MSH types for entities.

Definition at line 164 of file MshMeshWriter.cc.

◆ m_groups_write_info_list

std::vector<std::unique_ptr<ItemGroupWriteInfo> > Arcane::MshMeshWriter::m_groups_write_info_list
private

List of information to write for each group.

Definition at line 158 of file MshMeshWriter.cc.

Referenced by _writeElements(), _writeEntities(), and writeMesh().

◆ m_has_periodic_info

bool Arcane::MshMeshWriter::m_has_periodic_info = false
private

Definition at line 161 of file MshMeshWriter.cc.

◆ m_item_type_mng

ItemTypeMng* Arcane::MshMeshWriter::m_item_type_mng = nullptr
private

Definition at line 149 of file MshMeshWriter.cc.

◆ m_mesh

IMesh* Arcane::MshMeshWriter::m_mesh = nullptr
private

Definition at line 148 of file MshMeshWriter.cc.

◆ m_mesh_info

impl::MshMeshGenerationInfo* Arcane::MshMeshWriter::m_mesh_info = nullptr
private

Definition at line 160 of file MshMeshWriter.cc.

◆ m_nb_entities_by_dim

FixedArray<Int32, 4> Arcane::MshMeshWriter::m_nb_entities_by_dim
private

Definition at line 155 of file MshMeshWriter.cc.

◆ m_physical_tags

UniqueArray<PhysicalTagInfo> Arcane::MshMeshWriter::m_physical_tags
private

Definition at line 152 of file MshMeshWriter.cc.


The documentation for this class was generated from the following file: