43 int main(
int argc,
char **argv) {
47 std::cout <<
"Usage: " << argv[0] <<
" br, bc, gr, gc" << std::endl;
52 const int comm_rank=0;
53 const int comm_size=1;
55 const int b_row=atoi(argv[1]), b_col=atoi(argv[2]);
56 const int g_row=atoi(argv[3]), g_col=atoi(argv[4]);
58 const double g_row_max=double(g_row-1.)/2., g_col_max=double(g_col-1.)/2.;
59 const double b_row_max=double(b_row-1.)/2., b_col_max=double(b_col-1.)/2.;
61 vector<Point_3> g_pnts(g_row*g_col);
62 vector<Four_tuple<int> > g_elems((g_row-1)*(g_col-1));
64 vector<Point_3> b_pnts(b_row*b_col);
65 vector<Four_tuple<int> > b_elems((b_row-1)*(b_col-1));
67 const double pi_by_2 =
asin(1.);
68 for (
int i=0;
i<g_row; ++
i)
69 for (
int j=0;
j<g_col; ++
j) {
70 double sin_1 =
sin((
i+g_row_max)/(g_row-1)*pi_by_2);
71 double sin_2 =
sin((
j+g_col_max)/(g_col-1)*pi_by_2);
72 double cos_1 =
cos((
i+g_row_max)/(g_row-1)*pi_by_2);
73 double cos_2 =
cos((
j+g_col_max)/(g_col-1)*pi_by_2);
75 g_pnts[
i*g_col+
j] =
Point_3( cos_1*sin_2, cos_2, sin_1*sin_2);
78 for (
int i=0;
i<g_row-1; ++
i)
79 for (
int j=0;
j<g_col-1; ++
j)
81 (
i+1)*g_col+j+2,
i*g_col+j+2);
83 for (
int i=0;
i<b_row; ++
i)
84 for (
int j=0; j<b_col; ++
j) {
85 double sin_1 =
sin((
i+b_row_max)/(b_row-1)*pi_by_2);
86 double sin_2 =
sin((j+b_col_max)/(b_col-1)*pi_by_2);
87 double cos_1 =
cos((
i+b_row_max)/(b_row-1)*pi_by_2);
88 double cos_2 =
cos((j+b_col_max)/(b_col-1)*pi_by_2);
91 b_pnts[
i*b_col+
j] =
Point_3( cos_1*sin_2, cos_2, sin_1*sin_2);
94 for (
int i=0;
i<b_row-1; ++
i)
95 for (
int j=0; j<b_col-1; ++
j)
97 (
i+1)*b_col+j+2,
i*b_col+j+2);
99 vector<Point_3> g_coor = g_pnts, b_coor = b_pnts;
133 const char *format=
"HDF";
140 "quad1",
"quad2", format);
146 "quad1",
"quad2", format);
149 char prefix1[100], prefix2[100];
151 std::sprintf(prefix1,
"quad1_coor%d", comm_rank);
152 std::sprintf(prefix2,
"quad2_coor%d", comm_rank);
A structure used to represent element faces.
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
void COM_delete_window(const char *wname)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
This file contains the prototypes for Roccom API.
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
CImg< _cimg_Tfloat > asin(const CImg< T > &instance)
void COM_print_profile(const char *fname, const char *header)
void COM_window_init_done(const char *w_str, int pane_changed=true)
#define USE_RFC_NAME_SPACE
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
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.
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
SURF::Point_3< Real > Point_3
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)