Back to index

salome-med  6.5.0
Functions
dumpInterpolation.cxx File Reference
#include <MEDMEM_MedFileBrowser.hxx>
#include <MEDMEM_Remapper.hxx>

Go to the source code of this file.

Functions

static string getMeshName (const char *file, int mesh_index)
int main (int argc, char **argv)
 Perform interpolation of two meshes and dumps result.

Function Documentation

static string getMeshName ( const char *  file,
int  mesh_index 
) [static]

Definition at line 34 of file dumpInterpolation.cxx.

{
  MEDFILEBROWSER med(file);
  if ( mesh_index >= med.getNumberOfMeshes() )
    {
      cout << "Invalid index of mesh, it must be less than " << med.getNumberOfMeshes() << endl;
      return "Invalid mesh index";
    }
  vector<string> mesh_names = med.getMeshNames();
  return mesh_names[mesh_index];
}

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Perform interpolation of two meshes and dumps result.

For format of output, see comment to operator<<() in InterpKernelMatrix.hxx

Definition at line 53 of file dumpInterpolation.cxx.

{
  if( argc < 3 )
    {
      cout << "Dumps result of interpolation of two meshes" << endl
           << "For format of output, see comment to operator<<() in InterpKernelMatrix.hxx" <<endl;
      cout << "Usage: "<<argv[0]<<" med_file1 med_file2 [mesh_index1=0 mesh_index2=0]" << endl;
      return -1;
    }
  string mesh_name1 = getMeshName( argv[1], (argc > 3) ? atoi(argv[3]) : 0 );
  string mesh_name2 = getMeshName( argv[2], (argc > 4) ? atoi(argv[4]) : 0 );

  MESH *mesh1=new MESH(MED_DRIVER, argv[1], mesh_name1.data());
  MESH *mesh2=new MESH(MED_DRIVER, argv[2], mesh_name2.data());

  MEDMEM_REMAPPER aREMAPPER;
  aREMAPPER.prepare( *mesh1, *mesh2, "P0P0" );
  aREMAPPER.printMatrixInfo();
  mesh1->removeReference();
  mesh2->removeReference();
  return 0;
}

Here is the call graph for this function: