Back to index

salome-med  6.5.0
Static Public Member Functions | Private Member Functions
ParaMEDLoader Class Reference

#include <ParaMEDLoader.hxx>

List of all members.

Static Public Member Functions

static void WriteParaMesh (const char *fileName, ParaMEDMEM::ParaMESH *mesh)
static void WriteMasterFile (const char *fileName, const std::vector< std::string > &fileNames, const char *meshName)
 This method builds the master file 'fileName' of a parallel MED file defined in 'fileNames'.

Private Member Functions

 ParaMEDLoader ()

Detailed Description

Definition at line 32 of file ParaMEDLoader.hxx.


Constructor & Destructor Documentation

Definition at line 30 of file ParaMEDLoader.cxx.

{
}

Member Function Documentation

void ParaMEDLoader::WriteMasterFile ( const char *  fileName,
const std::vector< std::string > &  fileNames,
const char *  meshName 
) [static]

This method builds the master file 'fileName' of a parallel MED file defined in 'fileNames'.

Definition at line 55 of file ParaMEDLoader.cxx.

{
  int nbOfDom=fileNames.size();
  std::ofstream fs(fileName);
  fs << "#MED Fichier V 2.3" << " " << std::endl;
  fs << "#"<<" " << std::endl;
  fs << nbOfDom <<" " << std::endl;
  for(int i=0;i<nbOfDom;i++)
    fs << meshName << " " << i+1 << " " << meshName << "_" << i+1 << " localhost " << fileNames[i] << " " << std::endl;
}
void ParaMEDLoader::WriteParaMesh ( const char *  fileName,
ParaMEDMEM::ParaMESH mesh 
) [static]

Definition at line 34 of file ParaMEDLoader.cxx.

{
  if(!mesh->getBlockTopology()->getProcGroup()->containsMyRank())
    return ;
  int myRank=mesh->getBlockTopology()->getProcGroup()->myRank();
  int nbDomains=mesh->getBlockTopology()->getProcGroup()->size();
  std::vector<std::string> fileNames(nbDomains);
  for(int i=0;i<nbDomains;i++)
    {
      std::ostringstream sstr;
      sstr << fileName << i+1 << ".med";
      fileNames[i]=sstr.str();
    }
  if(myRank==0)
    WriteMasterFile(fileName,fileNames,mesh->getCellMesh()->getName());
  MEDLoader::WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
}

Here is the call graph for this function:

Here is the caller graph for this function:


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