56 for(
int i =0;
i < size; ++
i){
57 cout << data[
i] <<
" ";
63 int main(
int argc,
char *argv[]) {
105 const int unstr_tet_2_num_nodes = 27;
106 const int unstr_tet_2_num_elmts = 48;
107 double unstr_tet_2_coors1[unstr_tet_2_num_nodes*3];
108 double unstr_tet_2_coors2[unstr_tet_2_num_nodes*3];
109 int unstr_tet_2_elmts1[unstr_tet_2_num_elmts*4];
110 int unstr_tet_2_elmts2[unstr_tet_2_num_elmts*4];
111 int unstr_tet_2_pconn1[12] = {1,2,9,3,6,9,12,15,18,21,24,27};
112 int unstr_tet_2_pconn2[12] = {1,1,9,1,4,7,10,13,16,19,22,25};
119 COM_set_size(
"unstr_tet_2.nc", 1, unstr_tet_2_num_nodes);
120 COM_set_array(
"unstr_tet_2.nc", 1, &unstr_tet_2_coors1[0],3);
121 COM_set_size(
"unstr_tet_2.:T4:", 1, unstr_tet_2_num_elmts);
122 COM_set_array(
"unstr_tet_2.:T4:", 1, &unstr_tet_2_elmts1[0],4);
124 COM_set_array(
"unstr_tet_2.pconn", 1, &unstr_tet_2_pconn1[0]);
128 COM_set_size(
"unstr_tet_2.nc", 2, unstr_tet_2_num_nodes);
129 COM_set_array(
"unstr_tet_2.nc", 2, &unstr_tet_2_coors2[0],3);
130 COM_set_size(
"unstr_tet_2.:T4:", 2, unstr_tet_2_num_elmts);
131 COM_set_array(
"unstr_tet_2.:T4:", 2, &unstr_tet_2_elmts2[0],4);
133 COM_set_array(
"unstr_tet_2.pconn", 2, &unstr_tet_2_pconn2[0]);
149 "unstr_tet_2",
"001");
154 for(
int z = 0;
z < 3; ++
z){
155 for(
int y = 0;
y < 3; ++
y){
156 for(
int x = 0;
x < 3; ++
x){
157 int index =
z*9 +
y*3 +
x;
163 crds[index*3] += .33;
171 for(
int i =0;
i < 27; ++
i){
192 int e = a+9, f = b+9, g = c+9, h = d+9;
193 elmt[0] = a; elmt[1] =b; elmt[2] = c; elmt[3] = e;
194 elmt[4] = b; elmt[5] =
d; elmt[6] = c; elmt[7] = e;
195 elmt[8] = c; elmt[9] =e; elmt[10] =
d; elmt[11] = g;
196 elmt[12] = b; elmt[13] =
d; elmt[14] = e; elmt[15] = f;
197 elmt[16] =
d; elmt[17] =e; elmt[18] = f; elmt[19] = g;
198 elmt[20] =
d; elmt[21] =g; elmt[22] = f; elmt[23] = h;
202 void init_hex(
int *elmt,
int a,
int b,
int c,
int d);
212 double crds[num_nodes*3];
213 int elmts[num_elmts*8];
244 elmt[0] = a; elmt[1] = b; elmt[2] = c; elmt[3] =
d;
245 elmt[4] = a+9; elmt[5] = b+9; elmt[6] = c+9; elmt[7] = d+9;
250 for(
int i=0;
i<3;++
i){
251 for(
int j=0;
j<3;++
j){
252 for(
int k=0;
k<3;++
k){
253 coords[3*(9*
k+3*
j+
i)] = (
double)
i;
254 coords[3*(9*
k+3*
j+
i)+1] = 1.0*(
double)
j;
255 coords[3*(9*
k+3*
j+
i)+2] = (
double)
k;
266 void init_pyr(
int *elmt,
int a,
int b,
int c,
int d,
int e);
276 double crds[num_nodes*3];
277 int elmts[num_elmts*5];
307 void init_pyr(
int *elmt,
int a,
int b,
int c,
int d,
int e){
308 elmt[0] = a; elmt[1] = b; elmt[2] = c; elmt[3] =
d; elmt[4] = e;
312 coords[0] = 0.0; coords[1] = 0.0; coords[2] = 0.0;
313 coords[3] = 1.0; coords[4] = 0.0; coords[5] = 0.0;
314 coords[6] = 1.0; coords[7] =1.0; coords[8] = 0.0;
315 coords[9] = 0.0; coords[10] =1.0; coords[11] = 0.0;
316 coords[12] = 0.5; coords[13] = 0.5; coords[14] = 0.7;
317 coords[15] = 0.0; coords[16] = 0.0; coords[17] = 1.0;
318 coords[18] = 1.0; coords[19] = 0.0; coords[20] = 1.0;
319 coords[21] = 1.0; coords[22] = 1.0; coords[23] = 1.0;
320 coords[24] = 0.0; coords[25] = 1.0; coords[26] = 1.0;
324 void init_prism(
int *elmt,
int a,
int b,
int c,
int d,
int e,
int f);
332 double crds[num_nodes*3];
333 int elmts[num_elmts*6];
362 "unstr_prism",
"001");
365 void init_prism(
int *elmt,
int a,
int b,
int c,
int d,
int e,
int f){
366 elmt[0] = a; elmt[1] = b; elmt[2] = c;
367 elmt[3] =
d; elmt[4] = e; elmt[5] = f;
371 coords[0] = 0.0; coords[1] = 0.0; coords[2] = 0.0;
372 coords[3] = 1.0; coords[4] = 0.0; coords[5] = 0.0;
373 coords[6] = 1.0; coords[7] = 1.0; coords[8] = 0.0;
374 coords[9] = 0.0; coords[10] = 1.0; coords[11] = 0.0;
375 coords[12] = 0.5; coords[13] = 0.5; coords[14] = 0.0;
376 coords[15] = 0.0; coords[16] = 0.0; coords[17] = 1.0;
377 coords[18] = 1.0; coords[19] = 0.0; coords[20] = 1.0;
378 coords[21] = 1.0; coords[22] = 1.0; coords[23] = 1.0;
379 coords[24] = 0.0; coords[25] = 1.0; coords[26] = 1.0;
380 coords[27] = 0.34; coords[28] = 0.55; coords[29] = 1.23;
381 coords[30] = 0.0; coords[31] = 0.0; coords[32] = 2.0;
382 coords[33] = 1.0; coords[34] = 0.0; coords[35] = 2.0;
383 coords[36] = 1.0; coords[37] = 1.0; coords[38] = 2.0;
384 coords[39] = 0.0; coords[40] = 1.0; coords[41] = 2.0;
385 coords[42] = 0.5; coords[43] = 0.5; coords[44] = 2.0;
391 void init_tet(
int *elmt,
int a,
int b,
int c,
int d);
396 const int num_prisms = 8;
397 const int num_tets = 4;
398 double crds[num_nodes*3];
399 int prism_conn[num_prisms*6];
400 int tet_conn[num_tets*4];
437 "unstr_prism_tet",
"001");
441 elmt[0] = a; elmt[1] = b; elmt[2] = c; elmt[3] =
d;
445 coords[0] = 0.0; coords[1] = 0.0; coords[2] = 0.0;
446 coords[3] = 1.0; coords[4] = 0.0; coords[5] = 0.0;
447 coords[6] = 1.0; coords[7] = 1.0; coords[8] = 0.0;
448 coords[9] = 0.0; coords[10] = 1.0; coords[11] = 0.0;
449 coords[12] = 0.5; coords[13] = 0.5; coords[14] = 0.0;
451 coords[15] = 0.0; coords[16] = 0.0; coords[17] = 1.0;
452 coords[18] = 1.0; coords[19] = 0.0; coords[20] = 1.0;
453 coords[21] = 1.0; coords[22] = 1.0; coords[23] = 1.0;
454 coords[24] = 0.0; coords[25] = 1.0; coords[26] = 1.0;
455 coords[27] = 0.65; coords[28] = 0.35; coords[29] = 1.0;
457 coords[30] = 0.0; coords[31] = 0.0; coords[32] = 2.0;
458 coords[33] = 1.0; coords[34] = 0.0; coords[35] = 2.0;
459 coords[36] = 1.0; coords[37] = 1.0; coords[38] = 2.0;
460 coords[39] = 0.0; coords[40] = 1.0; coords[41] = 2.0;
461 coords[42] = 0.27; coords[43] = 0.29; coords[44] = 2.24;
463 coords[45] = 0.5; coords[46] = 0.5; coords[47] = 2.5;
467 int n1,
int n2,
int n3,
int n4,
468 int n5,
int n6,
int n7,
int n8,
469 int n9,
int n10,
int n11,
int n12,
470 int n13,
int n14,
int n15,
int n16){
474 init_prism(prism_conn+12, n2,n3,n5,n7,n8,n10);
475 init_prism(prism_conn+18, n3,n4,n5,n8,n9,n10);
476 init_prism(prism_conn+24, n6,n10,n9,n11,n15,n14);
477 init_prism(prism_conn+30, n6,n7,n10,n11,n12,n15);
478 init_prism(prism_conn+36, n7,n8,n10,n12,n13,n15);
479 init_prism(prism_conn+42, n8,n9,n10,n13,n14,n15);
481 init_tet(tet_conn, n11,n12,n15,n16);
482 init_tet(tet_conn+4, n12,n13,n15,n16);
483 init_tet(tet_conn+8, n13,n14,n15,n16);
484 init_tet(tet_conn+12,n14,n11,n15,n16);
488 int n1,
int n2,
int n3,
int n4,
489 int n5,
int n6,
int n7,
int n8,
490 int n9,
int n10,
int n11,
int n12,
491 int n13,
int n14,
int n15,
int n16){
493 coords[3*n1-3] = 0.0+
x; coords[3*n1-2] = 0.0+
y; coords[3*n1-1] = 0.0;
494 coords[3*n2-3] = 1.0+
x; coords[3*n2-2] = 0.0+
y; coords[3*n2-1] = 0.0;
495 coords[3*n3-3] = 1.0+
x; coords[3*n3-2] = 1.0+
y; coords[3*n3-1] = 0.0;
496 coords[3*n4-3] = 0.0+
x; coords[3*n4-2] = 1.0+
y; coords[3*n4-1] = 0.0;
497 coords[3*n5-3] = 0.5+
x; coords[3*n5-2] = 0.5+
y; coords[3*n5-1] = 0.0;
499 coords[3*n6-3] = 0.0+
x; coords[3*n6-2] = 0.0+
y; coords[3*n6-1] = 1.0;
500 coords[3*n7-3] = 1.0+
x; coords[3*n7-2] = 0.0+
y; coords[3*n7-1] = 1.0;
501 coords[3*n8-3] = 1.0+
x; coords[3*n8-2] = 1.0+
y; coords[3*n8-1] = 1.0;
502 coords[3*n9-3] = 0.0+
x; coords[3*n9-2] = 1.0+
y; coords[3*n9-1] = 1.0;
503 coords[3*n10-3] = .65+
x; coords[3*n10-2] = .35+
y; coords[3*n10-1] = 1.0;
505 coords[3*n11-3] = 0.0+
x; coords[3*n11-2] = 0.0+
y; coords[3*n11-1] = 2.0;
506 coords[3*n12-3] = 1.0+
x; coords[3*n12-2] = 0.0+
y; coords[3*n12-1] = 2.0;
507 coords[3*n13-3] = 1.0+
x; coords[3*n13-2] = 1.0+
y; coords[3*n13-1] = 2.0;
508 coords[3*n14-3] = 0.0+
x; coords[3*n14-2] = 1.0+
y; coords[3*n14-1] = 2.0;
509 coords[3*n15-3] = .27+
x; coords[3*n15-2] = .29+
y; coords[3*n15-1] = 2.24;
511 coords[3*n16-3] = 0.5+
x; coords[3*n16-2] = 0.5+
y; coords[3*n16-1] = 2.5;
517 const int num_prisms1 = 32;
518 const int num_prisms2 = 32;
519 const int num_tets1 = 27;
520 const int num_tets2 = 27;
521 double coors1[num_nodes*3];
522 double coors2[num_nodes*3];
523 int prisms1[num_prisms1*6];
524 int prisms2[num_prisms2*6];
525 int tets1[num_tets1*4];
526 int tets2[num_tets2*4];
527 const int pconn_size = 15;
528 int pconn1[pconn_size] = {1,2,12,3,6,9,12,15,18,21,24,27,46,45,43};
529 int pconn2[pconn_size] = {1,1,12,1,4,7,10,13,16,19,22,25,40,44,46};
539 COM_set_size(
"unstr_prism_tet_2.:W6:", 1, num_prisms1);
551 COM_set_size(
"unstr_prism_tet_2.:W6:", 2, num_prisms2);
561 1,2,5,4,28,10,11,14,13,32,
565 2,3,6,5,29,11,12,15,14,33,
569 4,5,8,7,30,13,14,17,16,34,
573 5,6,9,8,31,14,15,18,17,35,
577 1,2,5,4,28,10,11,14,13,32,
581 2,3,6,5,29,11,12,15,14,33,
585 4,5,8,7,30,13,14,17,16,34,
589 5,6,9,8,31,14,15,18,17,35,
592 coors1[129] = 1.0; coors1[130] = 1.0; coors1[131] = 2.5;
593 coors1[132] = 2.0; coors1[133] = 1.0; coors1[134] = 2.5;
594 coors1[135] = 2.5; coors1[136] = 0.5; coors1[137] = 2.5;
604 1,2,5,4,28,10,11,14,13,32,
608 2,3,6,5,29,11,12,15,14,33,
612 4,5,8,7,30,13,14,17,16,34,
616 5,6,9,8,31,14,15,18,17,35,
620 1,2,5,4,28,10,11,14,13,32,
624 2,3,6,5,29,11,12,15,14,33,
628 4,5,8,7,30,13,14,17,16,34,
632 5,6,9,8,31,14,15,18,17,35,
635 coors2[129] = 2.0; coors2[130] = 1.0; coors2[131] = 2.5;
636 coors2[132] = 3.0; coors2[133] = 1.0; coors2[134] = 2.5;
637 coors2[135] = 1.5; coors2[136] = 1.5; coors2[137] = 2.5;
650 "unstr_prism_tet_2",
"001");
void init_crds2_tet_unstr_2(double *crds)
void print_array(T *data, int size, int space)
void int int REAL REAL * y
void init_hex(int *elmt, int a, int b, int c, int d)
void init_tet(int *elmt, int a, int b, int c, int d)
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 init_prism(int *elmt, int a, int b, int c, int d, int e, int f)
void init_unstr_prism_elmts(int *elmts)
void init_crds1_tet_unstr_2(double *crds)
A Roccom mesh optimization module.
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
void init_pyr(int *elmt, int a, int b, int c, int d, int e)
void init_unstr_pyr_coords(double *coords)
void int int int REAL REAL REAL * z
void build_unstr_prism_tet_2()
void init_unstr_prism_tet_coords(double *coords)
void init_tets_from_hex(int *elmt, int a, int b, int c, int d)
void init_unstr_hex_coords(double *coords)
int elmts[total_npanes][num_elmts][4]
void COM_window_init_done(const char *w_str, int pane_changed=true)
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,...)
Definition for Rocblas API.
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 init_unstr_prism_coords(double *coords)
void init_prism_tet_unit_coords(double *coords, double x, double y, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, int n13, int n14, int n15, int n16)
void init_unstr_prism_tet_elmts(int *elmts)
void COM_init(int *argc, char ***argv)
void build_unstr_prism_tet()
void init_tet_unstr_2_elmts(int *elmts)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
void init_unstr_hex_elmts(int *elmts)
void init_unstr_pyr_elmts(int *elmts)
void init_prism_tet_unit(int *prism_conn, int *tet_conn, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, int n13, int n14, int n15, int n16)
#define COM_EXTERN_MODULE(moduleName)