Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot3d.C File Reference
#include "roccom.h"
#include <cstdio>
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include "commpi.h"
Include dependency graph for plot3d.C:

Go to the source code of this file.

Classes

class  Point_3< T >
 

Functions

 COM_EXTERN_MODULE (Rocface)
 
void read_plot3d (istream &is, vector< vector< Point_3 > > &coors, vector< pair< int, int > > &dims)
 
int main (int argc, char *argv[])
 

Function Documentation

COM_EXTERN_MODULE ( Rocface  )
int main ( int  argc,
char *  argv[] 
)

Definition at line 77 of file plot3d.C.

References COM_call_function(), COM_finalize(), COM_get_attribute_handle(), COM_get_function_handle(), COM_init(), COM_LOAD_MODULE_STATIC_DYNAMIC, COM_new_window(), COM_print_profile(), COM_set_array(), COM_set_profiling(), COM_set_verbose(), COM_window_init_done(), i, k, MPI_COMM_WORLD, ni, and read_plot3d().

77  {
78  MPI_Init( &argc, &argv);
79  COM_init( &argc, &argv);
80 
81  if ( argc < 3) {
82  std::cout << "Usage: " << argv[0]
83  << " file1 file2 [<out_path>] "
84  << " [<scale_1>] [<scale_2>]" << std::endl;
85  exit(-1);
86  }
87 
88  COM_set_verbose( 1);
90 
91  const string wnames[2] = {string(argv[1], string( argv[1]).find(".")),
92  string(argv[2], string( argv[2]).find("."))};
93 
94  vector< vector<Point_3> > coors[2];
95 
96  COM_LOAD_MODULE_STATIC_DYNAMIC( Rocface, "RFC");
97 
98  for ( int k=0; k<2; ++k) {
99  COM_new_window( wnames[k].c_str());
100 
101  ifstream fi( argv[k+1]);
102  vector<pair< int, int> > dims;
103  read_plot3d( fi, coors[k], dims);
104 
105  for ( int i=0, ni=dims.size(); i<ni; ++i) {
106  COM_set_array( (wnames[k]+".:st2:").c_str(), i+1, &dims[i].first);
107  COM_set_array( (wnames[k]+".nc").c_str(), i+1, &coors[k][i][0]);
108  }
109 
110  COM_window_init_done( wnames[k].c_str());
111  }
112 
113  MPI_Comm comm = MPI_COMM_WORLD;
114 
115  int RFC_overlay = COM_get_function_handle( "RFC.overlay");
116  int RFC_write = COM_get_function_handle( "RFC.write_overlay");
117 
118  int tri1_mesh = COM_get_attribute_handle( (wnames[0]+".mesh").c_str());
119  int tri2_mesh = COM_get_attribute_handle( (wnames[1]+".mesh").c_str());
120 
121  COM_call_function( RFC_overlay, &tri1_mesh, &tri2_mesh, &comm, "./");
122  COM_call_function( RFC_write, &tri1_mesh, &tri2_mesh);
123 
124  COM_print_profile( "", "");
125 
126  COM_finalize();
127  MPI_Finalize();
128 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
j indices k indices k
Definition: Indexing.h:6
void COM_set_verbose(int i)
Definition: roccom_c++.h:543
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
void COM_finalize()
Definition: roccom_c++.h:59
void read_plot3d(istream &is, vector< vector< Point_3 > > &coors, vector< pair< int, int > > &dims)
Definition: plot3d.C:55
void COM_print_profile(const char *fname, const char *header)
Definition: roccom_c++.h:557
blockLoc i
Definition: read.cpp:79
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
Definition: roccom_c++.h:86
void COM_set_profiling(int i)
Definition: roccom_c++.h:550
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
Definition: roccom_c++.h:156
void COM_init(int *argc, char ***argv)
Definition: roccom_c++.h:57
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
Definition: roccom_basic.h:111
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

void read_plot3d ( istream &  is,
vector< vector< Point_3 > > &  coors,
vector< pair< int, int > > &  dims 
)

Definition at line 55 of file plot3d.C.

References i, j, and nj.

Referenced by main().

56  {
57  int ngrid;
58  is >> ngrid;
59 
60  dims.resize(ngrid);
61  for ( int i=0; i<ngrid; ++i) {
62  int t;
63  is >> dims[i].first >> dims[i].second >> t;
64  }
65 
66  coors.resize( ngrid);
67  for ( int i=0; i<ngrid; ++i) {
68  coors[i].resize( dims[i].first*dims[i].second);
69 
70  for ( int l=0; l<3; ++l) {
71  for ( int j=0, nj=coors[i].size(); j<nj; ++j)
72  is >> coors[i][j][l];
73  }
74  }
75 }
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
void int * nj
Definition: read.cpp:74

Here is the caller graph for this function: