Back to index

salome-med  6.5.0
Enumerations | Functions
ParaMEDMEMTest_ICocoTrio.cxx File Reference
#include "ParaMEDMEMTest.hxx"
#include <string>
#include "CommInterface.hxx"
#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
#include "DEC.hxx"
#include "InterpKernelDEC.hxx"
#include <set>
#include <time.h>
#include "ICoCoTrioField.hxx"
#include <iostream>
#include <assert.h>

Go to the source code of this file.

Enumerations

enum  synctype { sync_and, sync_or }

Functions

void synchronize_bool (bool &stop, synctype s)
void synchronize_dt (double &dt)
void affiche (const TrioField &field)
void remplit_coord (double *coords)
void init_quad (TrioField &champ_quad)
void init_triangle (TrioField &champ_triangle)

Enumeration Type Documentation

enum synctype
Enumerator:
sync_and 
sync_or 

Definition at line 37 of file ParaMEDMEMTest_ICocoTrio.cxx.


Function Documentation

void affiche ( const TrioField field)

Definition at line 56 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
  cout <<field.getName()<<endl;
  for (int ele=0;ele<field._nb_elems;ele++)
    cout <<ele <<": "<<field._field[ele]<<endl;;
  
}

Here is the call graph for this function:

Here is the caller graph for this function:

void init_quad ( TrioField champ_quad)

Definition at line 92 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
  
  champ_quad.setName("champ_quad");
  champ_quad._space_dim=3;
  champ_quad._mesh_dim=2;
  champ_quad._nbnodes=8;
  champ_quad._nodes_per_elem=4;
  champ_quad._nb_elems=2;
  champ_quad._itnumber=0;
  champ_quad._time1=0;
  champ_quad._time2=1;
  champ_quad._nb_field_components=1;
  
  champ_quad._coords=new double[champ_quad._nbnodes*champ_quad._space_dim];
  //memcpy(afield._coords,sommets.addr(),champ_quad._nbnodes*champ_quad._space_dim*sizeof(double));
  
  remplit_coord(champ_quad._coords);
  
  
  champ_quad._connectivity=new int[champ_quad._nb_elems*champ_quad._nodes_per_elem];
  champ_quad._connectivity[0*champ_quad._nodes_per_elem+0]=0;
  champ_quad._connectivity[0*champ_quad._nodes_per_elem+1]=1;
  champ_quad._connectivity[0*champ_quad._nodes_per_elem+2]=3;
  champ_quad._connectivity[0*champ_quad._nodes_per_elem+3]=2;
  champ_quad._connectivity[1*champ_quad._nodes_per_elem+0]=4;
  champ_quad._connectivity[1*champ_quad._nodes_per_elem+1]=5;
  champ_quad._connectivity[1*champ_quad._nodes_per_elem+2]=7;
  champ_quad._connectivity[1*champ_quad._nodes_per_elem+3]=6;
  
  
  champ_quad._has_field_ownership=false;
  champ_quad._field=0;
  //champ_quad._field=new double[champ_quad._nb_elems];
  //  assert(champ_quad._nb_field_components==1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void init_triangle ( TrioField champ_triangle)

Definition at line 128 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
   
  champ_triangle.setName("champ_triangle");
  champ_triangle._space_dim=3;
  champ_triangle._mesh_dim=2;
  champ_triangle._nbnodes=8;
  champ_triangle._nodes_per_elem=3;
  champ_triangle._nb_elems=4;
  champ_triangle._itnumber=0;
  champ_triangle._time1=0;
  champ_triangle._time2=1;
  champ_triangle._nb_field_components=1;
    
  champ_triangle._coords=new double[champ_triangle._nbnodes*champ_triangle._space_dim];
  //memcpy(afield._coords,sommets.addr(),champ_triangle._nbnodes*champ_triangle._space_dim*sizeof(double));
  remplit_coord(champ_triangle._coords);

  champ_triangle._connectivity=new int[champ_triangle._nb_elems*champ_triangle._nodes_per_elem];
  champ_triangle._connectivity[0*champ_triangle._nodes_per_elem+0]=0;
  champ_triangle._connectivity[0*champ_triangle._nodes_per_elem+1]=1;
  champ_triangle._connectivity[0*champ_triangle._nodes_per_elem+2]=2;
  champ_triangle._connectivity[1*champ_triangle._nodes_per_elem+0]=1;
  champ_triangle._connectivity[1*champ_triangle._nodes_per_elem+1]=3;
  champ_triangle._connectivity[1*champ_triangle._nodes_per_elem+2]=2;
  
  champ_triangle._connectivity[2*champ_triangle._nodes_per_elem+0]=4;
  champ_triangle._connectivity[2*champ_triangle._nodes_per_elem+1]=5;
  champ_triangle._connectivity[2*champ_triangle._nodes_per_elem+2]=7;
  champ_triangle._connectivity[3*champ_triangle._nodes_per_elem+0]=4;
  champ_triangle._connectivity[3*champ_triangle._nodes_per_elem+1]=7;
  champ_triangle._connectivity[3*champ_triangle._nodes_per_elem+2]=6;
  
  champ_triangle._has_field_ownership=false;
  // champ_triangle._field=new double[champ_triangle._nb_elems];
  champ_triangle._field=0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void remplit_coord ( double *  coords)

Definition at line 64 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
  coords[0*3+0]=0.;
  coords[0*3+1]=0.;
  coords[0*3+2]=0.;
  
  coords[1*3+0]=1.;
  coords[1*3+1]=0.;
  coords[1*3+2]=0.;
  
    
  coords[2*3+0]=0.;
  coords[2*3+1]=0.;
  coords[2*3+2]=1.;
  
  coords[3*3+0]=1.;
  coords[3*3+1]=0.;
  coords[3*3+2]=1.;
  
  for (int i=4;i<8;i++)
    {
      for (int d=0;d<3;d++)
        coords[i*3+d]=coords[(i-4)*3+d];
      coords[i*3+1]+=1e-5;
    }

}

Here is the caller graph for this function:

void synchronize_bool ( bool &  stop,
synctype  s 
)

Definition at line 38 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
  int my_stop;
  int my_stop_temp = stop?1:0;
  if (s==sync_and)
    MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD);
  else if (s==sync_or)
    MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD);
  stop =(my_stop==1);
}
void synchronize_dt ( double &  dt)

Definition at line 49 of file ParaMEDMEMTest_ICocoTrio.cxx.

{
  double dttemp=dt;
  MPI_Allreduce(&dttemp,&dt,1,MPI_DOUBLE,MPI_MIN,MPI_COMM_WORLD);
}