Back to index

salome-med  6.5.0
Functions
ParaFIELD

This class encapsulates parallel fields.
More...

Functions

 ParaMEDMEM::ParaFIELD::ParaFIELD (TypeOfField type, TypeOfTimeDiscretization td, ParaMESH *mesh, const ComponentTopology &component_topology)
 Constructing a ParaFIELD from a ParaSUPPORT and a ComponentTopology.
 ParaMEDMEM::ParaFIELD::ParaFIELD (MEDCouplingFieldDouble *field, ParaMESH *sup, const ProcessorGroup &group)
 Constructor creating the ParaFIELD from a given FIELD and a processor group.
virtual ParaMEDMEM::ParaFIELD::~ParaFIELD ()
void ParaMEDMEM::ParaFIELD::synchronizeTarget (ParaMEDMEM::ParaFIELD *source_field)
void ParaMEDMEM::ParaFIELD::synchronizeSource (ParaMEDMEM::ParaFIELD *target_field)
DataArrayInt * ParaMEDMEM::ParaFIELD::returnCumulativeGlobalNumbering () const
 This method returns, if it exists, an array with only one component and as many as tuples as _field has.
DataArrayInt * ParaMEDMEM::ParaFIELD::returnGlobalNumbering () const
int ParaMEDMEM::ParaFIELD::nbComponents () const
double ParaMEDMEM::ParaFIELD::getVolumeIntegral (int icomp, bool isWAbs) const
 This method retrieves the integral of component icomp over the all domain.

Detailed Description

This class encapsulates parallel fields.

It basically encapsulates a MEDCouplingField with extra information related to parallel topology. It is most conveniently created by giving a pointer to a MEDCouplingField object and a ProcessorGroup. By default, a ParaFIELD object will be constructed with all field components located on the same processors. In some specific cases, it might be necessary to scatter components over several processors. In this case, the constructor using a ComponentTopology is required.


Function Documentation

double ParaMEDMEM::ParaFIELD::getVolumeIntegral ( int  icomp,
bool  isWAbs 
) const

This method retrieves the integral of component icomp over the all domain.

Definition at line 213 of file ParaFIELD.cxx.

  {
    CommInterface comm_interface = _topology->getProcGroup()->getCommInterface();
    double integral=_field->integral(icomp,isWAbs);
    double total=0.;
    const MPI_Comm* comm = (dynamic_cast<const MPIProcessorGroup*>(_topology->getProcGroup()))->getComm();
    comm_interface.allReduce(&integral, &total, 1, MPI_DOUBLE, MPI_SUM, *comm);
  
    return total;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 205 of file ParaFIELD.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

ParaMEDMEM::ParaFIELD::ParaFIELD ( TypeOfField  type,
TypeOfTimeDiscretization  td,
ParaMESH para_support,
const ComponentTopology component_topology 
)

Constructing a ParaFIELD from a ParaSUPPORT and a ComponentTopology.

This constructor creates an empty field based on the ParaSUPPORT description and the partitioning of components described in component_topology. It takes ownership over the _field object that it creates.

Here come the three ComponentTopology constructors :

    ComponentTopology c; // one component in the field
    ComponentTopology c(6); //six components, all of them on the same processor
    ComponentTopology c(6, proc_group); // six components, evenly distributed over the processors of procgroup

Definition at line 66 of file ParaFIELD.cxx.

    :_field(0),
     _component_topology(component_topology),_topology(0),_own_support(false),
     _support(para_support)
  {
    if (para_support->isStructured() || (para_support->getTopology()->getProcGroup()->size()==1 && component_topology.nbBlocks()!=1))
      {
        const BlockTopology* source_topo = dynamic_cast<const BlockTopology*>(para_support->getTopology());
        _topology=new BlockTopology(*source_topo,component_topology);
      }
    else
      {
        if (component_topology.nbBlocks()!=1 &&  para_support->getTopology()->getProcGroup()->size()!=1)
          throw INTERP_KERNEL::Exception(LOCALIZED("ParaFIELD constructor : Unstructured Support not taken into account with component topology yet"));
        else 
          {
            const BlockTopology* source_topo=dynamic_cast<const BlockTopology*> (para_support->getTopology());
            int nb_local_comp=component_topology.nbLocalComponents();
            _topology=new BlockTopology(*source_topo,nb_local_comp);
          }
      }
    int nb_components = component_topology.nbLocalComponents();
    if (nb_components!=0)
      {
        _field=MEDCouplingFieldDouble::New(type,td);
        _field->setMesh(_support->getCellMesh());
        DataArrayDouble *array=DataArrayDouble::New();
        array->alloc(_field->getNumberOfTuples(),nb_components);
        _field->setArray(array);
        array->decrRef();
      }
    else return;
  
    _field->setName("Default ParaFIELD name");
    _field->setDescription("Default ParaFIELD description");
  } 

Here is the call graph for this function:

ParaMEDMEM::ParaFIELD::ParaFIELD ( MEDCouplingFieldDouble subdomain_field,
ParaMESH sup,
const ProcessorGroup proc_group 
)

Constructor creating the ParaFIELD from a given FIELD and a processor group.

This constructor supposes that support underlying subdomain_field has no ParaSUPPORT attached and it therefore recreates one. It therefore takes ownership over _support. The component topology associated with the field is a basic one (all components on the same processor).

Definition at line 109 of file ParaFIELD.cxx.

                                                                                                              :
    _field(subdomain_field),
    _component_topology(ComponentTopology(_field->getNumberOfComponents())),_topology(0),_own_support(false),
    _support(sup)
  {
    if(_field)
      _field->incrRef();
    const BlockTopology* source_topo=dynamic_cast<const BlockTopology*> (_support->getTopology());
    _topology=new BlockTopology(*source_topo,_component_topology.nbLocalComponents());
  }

Here is the call graph for this function:

This method returns, if it exists, an array with only one component and as many as tuples as _field has.

This array gives for every element on which this->_field lies, its global number, if this->_field is nodal. For example if _field is a nodal field : returned array will be the nodal global numbers. The content of this method is used to inform Working side to accumulate data recieved by lazy side.

Definition at line 173 of file ParaFIELD.cxx.

  {
    if(!_field)
      return 0;
    TypeOfField type=_field->getTypeOfField();
    switch(type)
      {
      case ON_CELLS:
        return 0;
      case ON_NODES:
        return _support->getGlobalNumberingNodeDA();
      default:
        return 0;
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 189 of file ParaFIELD.cxx.

  {
    if(!_field)
      return 0;
    TypeOfField type=_field->getTypeOfField();
    switch(type)
      {
      case ON_CELLS:
        return _support->getGlobalNumberingCellDA();
      case ON_NODES:
        return _support->getGlobalNumberingNodeDA();
      default:
        return 0;
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 148 of file ParaFIELD.cxx.

  {
    DisjointDEC* data_channel;
    if (dynamic_cast<BlockTopology*>(_topology)!=0)
      {
        data_channel=new StructuredCoincidentDEC;
      }
    else
      {
        data_channel=new ExplicitCoincidentDEC;
      }
    data_channel->attachLocalField(this);
    data_channel->synchronize();
    data_channel->prepareSourceDE();
    data_channel->sendData();
  
    delete data_channel;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 129 of file ParaFIELD.cxx.

  {
    DisjointDEC* data_channel;
    if (dynamic_cast<BlockTopology*>(_topology)!=0)
      {
        data_channel=new StructuredCoincidentDEC;
      }
    else
      {
        data_channel=new ExplicitCoincidentDEC;
      }
    data_channel->attachLocalField(this);
    data_channel->synchronize();
    data_channel->prepareTargetDE();
    data_channel->recvData();
  
    delete data_channel;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 120 of file ParaFIELD.cxx.

  {
    if(_field)
      _field->decrRef();
    if(_own_support)
      delete _support;
    delete _topology;
  }