Back to index

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

#include <ParaGRID.hxx>

Collaboration diagram for ParaMEDMEM::ParaGRID:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ParaGRID (MEDCouplingCMesh *global_grid, Topology *topology) throw (INTERP_KERNEL::Exception)
BlockTopologygetBlockTopology () const
virtual ~ParaGRID ()
MEDCouplingCMeshgetGrid () const

Private Attributes

MEDCouplingCMesh_grid
ParaMEDMEM::BlockTopology_block_topology
std::vector< std::vector
< double > > 
_global_axis
int _my_domain_id

Detailed Description

Definition at line 33 of file ParaGRID.hxx.


Constructor & Destructor Documentation

ParaMEDMEM::ParaGRID::ParaGRID ( MEDCouplingCMesh global_grid,
Topology topology 
) throw (INTERP_KERNEL::Exception)

Definition at line 34 of file ParaGRID.cxx.

  {
  
    _block_topology = dynamic_cast<BlockTopology*>(topology);
    if(_block_topology==0)
      throw INTERP_KERNEL::Exception(LOCALIZED("ParaGRID::ParaGRID topology must be block topology"));
    
    if (!_block_topology->getProcGroup()->containsMyRank())
      return;
    
    int dimension=_block_topology->getDimension() ;
    if (dimension != global_grid->getSpaceDimension())
      throw INTERP_KERNEL::Exception(LOCALIZED("ParaGrid::ParaGrid incompatible topology"));
    _grid=global_grid;
    _grid->incrRef();
    /*vector<vector<double> > xyz_array(dimension);
      vector<pair<int,int> > local_indices = _block_topology->getLocalArrayMinMax();
      vector <string> coordinates_names;
      vector <string> coordinates_units;
      for (int idim=0; idim<dimension ; idim++)
      {
      DataArrayDouble *array=global_grid->getCoordsAt(idim);
      double *arrayC=array->getPointer();
      cout << " Indices "<< local_indices[idim].first <<" "<<local_indices[idim].second<<endl;
      for (int i=(local_indices)[idim].first; i<(local_indices)[idim].second; i++)
      xyz_array[idim].push_back(arrayC[i]);
      coordinates_names.push_back(array->getName());
      coordinates_units.push_back(array->getInfoOnComponentAt(0));
      }
      _grid=MEDCouplingCMesh::New();
      _grid->set(xyz_array, coordinates_names,coordinates_units);
      _grid->setName(global_grid->getName());
      _grid->setDescription(global_grid->getDescription());*/
  }

Definition at line 69 of file ParaGRID.cxx.

  {
    if(_grid)
      _grid->decrRef();
  }

Member Function Documentation

Definition at line 37 of file ParaGRID.hxx.

{ return _block_topology; }

Definition at line 39 of file ParaGRID.hxx.

{ return _grid; }

Member Data Documentation

Definition at line 43 of file ParaGRID.hxx.

std::vector<std::vector<double> > ParaMEDMEM::ParaGRID::_global_axis [private]

Definition at line 45 of file ParaGRID.hxx.

Definition at line 41 of file ParaGRID.hxx.

Definition at line 47 of file ParaGRID.hxx.


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