Back to index

salome-med  6.5.0
Public Member Functions | Private Attributes
ParaMEDMEM::ExplicitTopology Class Reference

#include <ExplicitTopology.hxx>

Inheritance diagram for ParaMEDMEM::ExplicitTopology:
Inheritance graph
[legend]
Collaboration diagram for ParaMEDMEM::ExplicitTopology:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ExplicitTopology ()
 ExplicitTopology (const ExplicitTopology &topo, int nbcomponents)
 ExplicitTopology (const ParaMESH &mesh)
virtual ~ExplicitTopology ()
int getNbElements () const
 Retrieves the number of elements for a given topology.
int getNbLocalElements () const
const ProcessorGroupgetProcGroup () const
int localToGlobal (const std::pair< int, int > local) const
int localToGlobal (int) const
 converts local number to a global number
int globalToLocal (int) const
 converts a pair <subdomainid,local> to a global number
void serialize (int *&serializer, int &size) const
 Serializes the data contained in the Explicit Topology for communication purposes.
void unserialize (const int *serializer, const CommInterface &comm_interface)
 Unserializes the data contained in the Explicit Topology after communication.
int getNbComponents () const

Private Attributes

const ProcessorGroup_proc_group
int _nb_elems
int _nb_components
int * _loc2glob
INTERP_KERNEL::HashMap< int, int > _glob2loc

Detailed Description

Definition at line 36 of file ExplicitTopology.hxx.


Constructor & Destructor Documentation

Definition at line 39 of file ExplicitTopology.hxx.

{ }
ParaMEDMEM::ExplicitTopology::ExplicitTopology ( const ExplicitTopology topo,
int  nbcomponents 
)

Definition at line 51 of file ExplicitTopology.cxx.

{
  _proc_group = topo._proc_group;
  _nb_elems = topo._nb_elems;
  _nb_components = nb_components;
  _loc2glob=new int[_nb_elems];
  for (int i=0; i<_nb_elems; i++)
    {
      _loc2glob[i]=topo._loc2glob[i];
    }
  _glob2loc=topo._glob2loc;
}

Definition at line 36 of file ExplicitTopology.cxx.

                                                           :
_proc_group(paramesh.getBlockTopology()->getProcGroup()),
_nb_components(1)
{
  _nb_elems=paramesh.getCellMesh()->getNumberOfCells();
  const int* global=paramesh.getGlobalNumberingCell();
  _loc2glob=new int[_nb_elems]; 
  
    for (int i=0; i<_nb_elems; i++)
    {
      _loc2glob[i]=global[i];
      _glob2loc[global[i]]=i;
    }
}

Here is the call graph for this function:

Definition at line 65 of file ExplicitTopology.cxx.

{
  if (_loc2glob != 0) delete[] _loc2glob;
}

Member Function Documentation

Definition at line 52 of file ExplicitTopology.hxx.

{ return _nb_components; }

Here is the caller graph for this function:

int ParaMEDMEM::ExplicitTopology::getNbElements ( ) const [inline, virtual]

Retrieves the number of elements for a given topology.

Implements ParaMEDMEM::Topology.

Definition at line 79 of file ExplicitTopology.hxx.

  {
    return _nb_elems;
  }
int ParaMEDMEM::ExplicitTopology::getNbLocalElements ( ) const [inline, virtual]

Implements ParaMEDMEM::Topology.

Definition at line 85 of file ExplicitTopology.hxx.

  {
    return _glob2loc.size();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const ProcessorGroup* ParaMEDMEM::ExplicitTopology::getProcGroup ( ) const [inline, virtual]

Implements ParaMEDMEM::Topology.

Definition at line 46 of file ExplicitTopology.hxx.

{ return _proc_group; }

Here is the caller graph for this function:

int ParaMEDMEM::ExplicitTopology::globalToLocal ( int  global) const [inline]

converts a pair <subdomainid,local> to a global number

Definition at line 67 of file ExplicitTopology.hxx.

  {
    return (_glob2loc.find(global))->second;;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::ExplicitTopology::localToGlobal ( const std::pair< int, int >  local) const [inline]

Definition at line 47 of file ExplicitTopology.hxx.

{ return localToGlobal(local.second); }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::ExplicitTopology::localToGlobal ( int  local) const [inline]

converts local number to a global number

Definition at line 73 of file ExplicitTopology.hxx.

  {
    return _loc2glob[local];
  }
void ParaMEDMEM::ExplicitTopology::serialize ( int *&  serializer,
int &  size 
) const

Serializes the data contained in the Explicit Topology for communication purposes.

Definition at line 73 of file ExplicitTopology.cxx.

{
  vector <int> buffer;
  
  buffer.push_back(_nb_elems);
  for (int i=0; i<_nb_elems; i++)
  {
    buffer.push_back(_loc2glob[i]);
  }
    
  serializer=new int[buffer.size()];
  size=  buffer.size();
  copy(buffer.begin(), buffer.end(), serializer);
  
}

Here is the caller graph for this function:

void ParaMEDMEM::ExplicitTopology::unserialize ( const int *  serializer,
const CommInterface comm_interface 
)

Unserializes the data contained in the Explicit Topology after communication.

Uses the same structure as the one used for serialize()

Definition at line 92 of file ExplicitTopology.cxx.

{
  const int* ptr_serializer=serializer;
  cout << "unserialize..."<<endl;
  _nb_elems=*ptr_serializer++;
  cout << "nbelems "<<_nb_elems<<endl;
  _loc2glob=new int[_nb_elems];
  for (int i=0; i<_nb_elems; i++)
  {
    _loc2glob[i]=*ptr_serializer;
    _glob2loc[*ptr_serializer]=i;
    ptr_serializer++;
    
  }

}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 63 of file ExplicitTopology.hxx.

Definition at line 61 of file ExplicitTopology.hxx.

Definition at line 59 of file ExplicitTopology.hxx.

Definition at line 57 of file ExplicitTopology.hxx.

Definition at line 55 of file ExplicitTopology.hxx.


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