Back to index

salome-med  6.5.0
Public Member Functions | Protected Attributes
MEDMEM::CONNECTIVITYClient Class Reference

#include <CONNECTIVITYClient.hxx>

List of all members.

Public Member Functions

 CONNECTIVITYClient (const SALOME_MED::MESH_ptr m, medEntityMesh Entity=MED_CELL)
 Constructeur.
virtual ~CONNECTIVITYClient ()
 Destructeur.
void fillCopy ()
void blankCopy ()
 Remplit les informations nécessaires 1 seul appel Corba.
int getNumberOf (medEntityMesh Entity, medGeometryElement Type) const
const int * getConnectivity (medConnectivity ConnectivityType, medEntityMesh Entity, medGeometryElement Type) const
int getConnectivityLength (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
const int * getConnectivityIndex (medConnectivity ConnectivityType, medEntityMesh Entity) const
void calculateConnectivity (medConnectivity connectivityType, medEntityMesh Entity)
void updateFamily (vector< FAMILY * > myFamilies)
const int * getGlobalNumberingIndex (medEntityMesh Entity) const throw (MEDEXCEPTION)
bool existConnectivity (medConnectivity ConnectivityType, medEntityMesh Entity) const
const int * getReverseConnectivity (medConnectivity ConnectivityType, medEntityMesh Entity=MED_CELL) const throw (MEDEXCEPTION)
const int * getReverseConnectivityIndex (medConnectivity ConnectivityType, medEntityMesh Entity=MED_CELL) const throw (MEDEXCEPTION)
const int * getValue (medConnectivity TypeConnectivity, medGeometryElement Type) const
const int * getValueIndex (medConnectivity TypeConnectivity) const
const int * getNeighbourhood () const

Protected Attributes

long * _numberOfElements_client
long _totalNumberOfElements_client
bool _complete
SALOME_MED::MESH_var IOR_Mesh

Detailed Description

Definition at line 31 of file CONNECTIVITYClient.hxx.


Constructor & Destructor Documentation

CONNECTIVITYClient::CONNECTIVITYClient ( const SALOME_MED::MESH_ptr  m,
medEntityMesh  Entity = MED_CELL 
)

Constructeur.

Definition at line 36 of file CONNECTIVITYClient.cxx.

                                                             :
  CONNECTIVITY(m->getNumberOfTypes(Entity), Entity),
  _numberOfElements_client(0),
  _complete(false),
  IOR_Mesh(SALOME_MED::MESH::_duplicate(m))
{
  ASSERT(m);

  blankCopy();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Destructeur.

Definition at line 53 of file CONNECTIVITYClient.cxx.


Member Function Documentation

Remplit les informations nécessaires 1 seul appel Corba.

Definition at line 65 of file CONNECTIVITYClient.cxx.

{
   SALOME_MED::MESH::connectivityInfos_var all;
   medEntityMesh Entity = getEntity();
   try
   {
        all= IOR_Mesh->getConnectGlobal(Entity);
   }
   catch (const exception & ex)
   {
        MESSAGE("Unable to acces Global information");
        THROW_SALOME_CORBA_EXCEPTION(ex.what() ,SALOME::INTERNAL_ERROR);
   }

  _numberOfNodes = all->numberOfNodes;
  _entityDimension = all->entityDimension;
  medGeometryElement * Types;

  long iT, nT;
  convertCorbaArray<MED_EN::medGeometryElement,SALOME_MED::medGeometryElement_array *, long>
    (Types, nT, &all->meshTypes);

  ASSERT(nT == (int) getNumberOfTypes(Entity));
  SCRUTE(nT);
  
  setGeometricTypes(Types, Entity);

  _totalNumberOfElements_client = 0L;
  if (_numberOfElements_client)
    delete [] _numberOfElements_client;
  _numberOfElements_client = new long[nT];
  for (iT=0; iT<nT; iT++) 
   {
    _numberOfElements_client[iT] =  all->numberOfElements[iT];
    _totalNumberOfElements_client += _numberOfElements_client[iT];
    SCRUTE(iT);
    SCRUTE(_numberOfElements_client[iT]);
  }

  if(Types)
    delete [] Types;

  // create a constituent (PAL10556)
// The consequence is that, if the remote server
// has not calculated nodal connectivity of dimension d-1, heavy method
// (CPU and memory) calculateDecsendingConnectivity is called on this
// server for a potentially useless information for client side . (by Anthony GEAY)
   if ( Entity == MED_CELL ) {
     Entity = ( IOR_Mesh->getMeshDimension() == 3 ? MED_FACE : MED_EDGE );
     if(_constituent)
       delete _constituent;
     _constituent = new CONNECTIVITYClient( IOR_Mesh, Entity );
   }

  _complete = false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 274 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    fillCopy();

  CONNECTIVITY::calculateConnectivity(connectivityType, Entity);
}

Here is the call graph for this function:

bool CONNECTIVITYClient::existConnectivity ( medConnectivity  ConnectivityType,
medEntityMesh  Entity 
) const

Definition at line 314 of file CONNECTIVITYClient.cxx.

{ 
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  bool b = CONNECTIVITY::existConnectivity(ConnectivityType, Entity);

  return b;
}

Definition at line 137 of file CONNECTIVITYClient.cxx.

{
  if (!_complete) {

    int *pC;
    long nC;
    
    medEntityMesh Entity = getEntity();
    int iT, nT = getNumberOfTypes(Entity);
    SCRUTE(nT);
    const medGeometryElement * T = getGeometricTypes(Entity);
    
    int * Count = new int[nT+1] ;
    Count[0]=1 ;
    SCRUTE(Count[0]);
    for (iT=0; iT<nT; iT++) {
      Count[iT+1]=Count[iT] + _numberOfElements_client[iT];
      SCRUTE(Count[iT+1]);
    }
    setCount(Count, Entity) ;
    
    for (iT=0; iT<nT; iT++) {
      
      SCRUTE(iT);
      SCRUTE(Count[iT+1]-Count[iT]);
      
      SALOME::SenderInt_var senderForConnectivity=IOR_Mesh->getSenderForConnectivity(MED_NODAL, Entity, T[iT]);
      pC=ReceiverFactory::getValue(senderForConnectivity,nC);
      SCRUTE(nC);
      ASSERT(nC == (T[iT]%100) * (Count[iT+1]-Count[iT]));

      int *index = 0;
      if ( T[iT] == MED_EN::MED_POLYGON || T[iT] == MED_EN::MED_POLYHEDRA )
      {
        SALOME::SenderInt_var senderForIndex=IOR_Mesh->getSenderForConnectivityIndex(MED_NODAL, Entity, T[iT]);
        index=ReceiverFactory::getValue(senderForIndex,nC);
        ASSERT(nC == (Count[iT+1]-Count[iT]+1));
      }

      setNodal(pC, Entity, T[iT], index);
      delete [] pC;
      delete [] index;
    }

    delete[] Count;
    if (_constituent)
      ((CONNECTIVITYClient *)_constituent)->fillCopy();
    _complete = true;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const int * CONNECTIVITYClient::getConnectivity ( medConnectivity  ConnectivityType,
medEntityMesh  Entity,
medGeometryElement  Type 
) const

Definition at line 230 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int * c = CONNECTIVITY::getConnectivity (ConnectivityType, Entity, Type);

  return c;
}
const int * CONNECTIVITYClient::getConnectivityIndex ( medConnectivity  ConnectivityType,
medEntityMesh  Entity 
) const

Definition at line 258 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int *c = CONNECTIVITY::getConnectivityIndex
    (ConnectivityType, Entity);

  return c;
}

Definition at line 242 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int l = CONNECTIVITY::getConnectivityLength (ConnectivityType, Entity, Type);

  return l;
}
const int * CONNECTIVITYClient::getGlobalNumberingIndex ( medEntityMesh  Entity) const throw (MEDEXCEPTION)

Definition at line 299 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int * index = CONNECTIVITY::getGlobalNumberingIndex(Entity);

  return index;
}
const int * CONNECTIVITYClient::getNeighbourhood ( ) const

Definition at line 392 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int * c =  CONNECTIVITY::getNeighbourhood();

  return c;
}

Definition at line 192 of file CONNECTIVITYClient.cxx.

{
  int n = 0;

  SCRUTE(Type);
  SCRUTE(Entity);
  
  if (!_complete) {
    
    if (Entity == _entity) {
      
      if (Type==MED_ALL_ELEMENTS)
        n = _totalNumberOfElements_client;
      
      for (int i=0; i<_numberOfTypes; i++) {
        SCRUTE(_geometricTypes[i]);
        if (_geometricTypes[i] == Type) {
          n = _numberOfElements_client[i];
          break;
        }
      }
    } 
    else if (_constituent != NULL)
      n = _constituent->getNumberOf(Entity,Type);
    
  }
  else
    n = CONNECTIVITY::getNumberOf(Entity, Type);

  SCRUTE(n);
  return n;
}
const int * CONNECTIVITYClient::getReverseConnectivity ( medConnectivity  ConnectivityType,
medEntityMesh  Entity = MED_CELL 
) const throw (MEDEXCEPTION)

Definition at line 329 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int *c = CONNECTIVITY::getReverseConnectivity
    (ConnectivityType, Entity);

  return c;
}
const int * CONNECTIVITYClient::getReverseConnectivityIndex ( medConnectivity  ConnectivityType,
medEntityMesh  Entity = MED_CELL 
) const throw (MEDEXCEPTION)

Definition at line 346 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int *c =  CONNECTIVITY::getReverseConnectivityIndex
    (ConnectivityType, Entity);

  return c;
}
const int * CONNECTIVITYClient::getValue ( medConnectivity  TypeConnectivity,
medGeometryElement  Type 
) const

Definition at line 363 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int * c =  CONNECTIVITY::getValue(TypeConnectivity, Type);

  return c;
}

Here is the caller graph for this function:

const int * CONNECTIVITYClient::getValueIndex ( medConnectivity  TypeConnectivity) const

Definition at line 378 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    (const_cast<CONNECTIVITYClient *>(this))->fillCopy();

  const int * c =  CONNECTIVITY::getValueIndex(TypeConnectivity);

  return c;
}
void CONNECTIVITYClient::updateFamily ( vector< FAMILY * >  myFamilies)

Definition at line 287 of file CONNECTIVITYClient.cxx.

{
  if (!_complete)
    fillCopy();

  CONNECTIVITY::updateFamily(myFamilies);
}

Here is the call graph for this function:


Member Data Documentation

bool MEDMEM::CONNECTIVITYClient::_complete [mutable, protected]

Definition at line 38 of file CONNECTIVITYClient.hxx.

Definition at line 35 of file CONNECTIVITYClient.hxx.

Definition at line 36 of file CONNECTIVITYClient.hxx.

SALOME_MED::MESH_var MEDMEM::CONNECTIVITYClient::IOR_Mesh [protected]

Definition at line 39 of file CONNECTIVITYClient.hxx.


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