Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
build_meshes.C File Reference
#include "roccom.h"
#include "mapbasic.h"
#include "Rocblas.h"
#include <iostream>
#include <sstream>
Include dependency graph for build_meshes.C:

Go to the source code of this file.

Functions

 COM_EXTERN_MODULE (Rocmap)
 
 COM_EXTERN_MODULE (Rocout)
 
 COM_EXTERN_MODULE (Rocmop)
 
void build_unstr_tet_2 ()
 
void build_unstr_hex ()
 
void build_unstr_pyr ()
 
void build_unstr_prism ()
 
void build_unstr_prism_tet ()
 
void build_unstr_prism_tet_2 ()
 
template<class T >
void print_array (T *data, int size, int space)
 
int main (int argc, char *argv[])
 
void init_tets_from_hex (int *elmt, int a, int b, int c, int d)
 
void init_tet_unstr_2_elmts (int *elmts)
 
void init_crds1_tet_unstr_2 (double *crds)
 
void init_crds2_tet_unstr_2 (double *crds)
 
void init_hex (int *elmt, int a, int b, int c, int d)
 
void init_unstr_hex_elmts (int *elmts)
 
void init_unstr_hex_coords (double *coords)
 
void init_pyr (int *elmt, int a, int b, int c, int d, int e)
 
void init_unstr_pyr_elmts (int *elmts)
 
void init_unstr_pyr_coords (double *coords)
 
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_unstr_prism_coords (double *coords)
 
void init_unstr_prism_tet_elmts (int *elmts)
 
void init_unstr_prism_tet_coords (double *coords)
 
void init_tet (int *elmt, int a, int b, int c, int d)
 
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)
 
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)
 

Function Documentation

void build_unstr_hex ( )

Definition at line 208 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), elmts, init_hex(), init_unstr_hex_coords(), num_elmts, and num_nodes.

Referenced by main().

208  {
209 
210  const int num_nodes = 27;
211  const int num_elmts = 8;
212  double crds[num_nodes*3];
213  int elmts[num_elmts*8];
214 
215  // Create a new window named "unstr"
216  COM_new_window("unstr_hex");
217 
218  // Regist nodal coordinates, connectivity tables,
219  // and the pconn for pane 1.
220  COM_set_size( "unstr_hex.nc", 1, num_nodes);
221  COM_set_array( "unstr_hex.nc", 1, &crds[0],3);
222  COM_set_size( "unstr_hex.:H8:", 1, num_elmts);
223  COM_set_array( "unstr_hex.:H8:", 1, &elmts[0],8);
224 
225  COM_window_init_done("unstr_hex");
226 
227  init_hex(elmts, 1,2,5,4); init_hex(elmts+8, 2,3,6,5);
228  init_hex(elmts+16,4,5,8,7); init_hex(elmts+24,5,6,9,8);
229 
230  init_hex(elmts+32,10,11,14,13); init_hex(elmts+40,11,12,15,14);
231  init_hex(elmts+48,13,14,17,16); init_hex(elmts+56,14,15,18,17);
232 
233  init_unstr_hex_coords(&crds[0]);
234 
235  // Write the mesh to file.
236  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
237  int HDL_all = COM_get_attribute_handle("unstr_hex.all");
238  COM_call_function( OUT_write, "unstr_hex", &HDL_all,
239  "unstr_hex", "001");
240 
241 }
void init_hex(int *elmt, int a, int b, int c, int d)
Definition: build_meshes.C:243
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
const int num_nodes
Definition: ex1.C:96
void init_unstr_hex_coords(double *coords)
Definition: build_meshes.C:248
int elmts[total_npanes][num_elmts][4]
Definition: ex1.C:109
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_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
const int num_elmts
Definition: ex1.C:97
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

void build_unstr_prism ( )

Definition at line 328 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), elmts, init_prism(), init_unstr_prism_coords(), num_elmts, and num_nodes.

Referenced by main().

328  {
329 
330  const int num_nodes = 15;
331  const int num_elmts = 8;
332  double crds[num_nodes*3];
333  int elmts[num_elmts*6];
334 
335  // Create a new window named "pyr"
336  COM_new_window("unstr_prism");
337 
338  // Regist nodal coordinates, connectivity tables,
339  // and the pconn for pane 1.
340  COM_set_size( "unstr_prism.nc", 1, num_nodes);
341  COM_set_array( "unstr_prism.nc", 1, &crds[0],3);
342  COM_set_size( "unstr_prism.:W6:", 1, num_elmts);
343  COM_set_array( "unstr_prism.:W6:", 1, &elmts[0],6);
344 
345  COM_window_init_done("unstr_prism");
346 
347  init_prism(elmts, 1,5,4,6,10,9);
348  init_prism(elmts+6, 1,2,5,6,7,10);
349  init_prism(elmts+12, 2,3,5,7,8,10);
350  init_prism(elmts+18, 3,4,5,8,9,10);
351  init_prism(elmts+24, 6,10,9,11,15,14);
352  init_prism(elmts+30, 6,7,10,11,12,15);
353  init_prism(elmts+36, 7,8,10,12,13,15);
354  init_prism(elmts+42, 8,9,10,13,14,15);
355 
356  init_unstr_prism_coords(&crds[0]);
357 
358  // Write the mesh to file.
359  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
360  int HDL_all = COM_get_attribute_handle("unstr_prism.all");
361  COM_call_function( OUT_write, "unstr_prism", &HDL_all,
362  "unstr_prism", "001");
363 }
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
void init_prism(int *elmt, int a, int b, int c, int d, int e, int f)
Definition: build_meshes.C:365
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
const int num_nodes
Definition: ex1.C:96
int elmts[total_npanes][num_elmts][4]
Definition: ex1.C:109
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_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 init_unstr_prism_coords(double *coords)
Definition: build_meshes.C:370
const int num_elmts
Definition: ex1.C:97
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

void build_unstr_prism_tet ( )

Definition at line 393 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), init_prism(), init_tet(), init_unstr_prism_tet_coords(), and num_nodes.

Referenced by main().

393  {
394 
395  const int num_nodes = 16;
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];
401 
402  // Create a new window
403  COM_new_window("unstr_prism_tet");
404 
405  // Regist nodal coordinates, connectivity tables,
406  // and the pconn for pane 1.
407 
408  COM_set_size( "unstr_prism_tet.nc", 1, num_nodes);
409  COM_set_array( "unstr_prism_tet.nc", 1, &crds[0],3);
410  COM_set_size( "unstr_prism_tet.:W6:", 1, num_prisms);
411  COM_set_array( "unstr_prism_tet.:W6:", 1, &prism_conn[0],6);
412  COM_set_size( "unstr_prism_tet.:T4:", 1, num_tets);
413  COM_set_array( "unstr_prism_tet.:T4:", 1, &tet_conn[0],4);
414 
415  COM_window_init_done("unstr_prism_tet");
416 
417  init_prism(prism_conn, 1,5,4,6,10,9);
418  init_prism(prism_conn+6, 1,2,5,6,7,10);
419  init_prism(prism_conn+12, 2,3,5,7,8,10);
420  init_prism(prism_conn+18, 3,4,5,8,9,10);
421  init_prism(prism_conn+24, 6,10,9,11,15,14);
422  init_prism(prism_conn+30, 6,7,10,11,12,15);
423  init_prism(prism_conn+36, 7,8,10,12,13,15);
424  init_prism(prism_conn+42, 8,9,10,13,14,15);
425 
426  init_tet(tet_conn, 11,12,15,16);
427  init_tet(tet_conn+4, 12,13,15,16);
428  init_tet(tet_conn+8, 13,14,15,16);
429  init_tet(tet_conn+12,14,11,15,16);
430 
431  init_unstr_prism_tet_coords(&crds[0]);
432 
433  // Write the mesh to file.
434  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
435  int HDL_all = COM_get_attribute_handle("unstr_prism_tet.all");
436  COM_call_function( OUT_write, "unstr_prism_tet", &HDL_all,
437  "unstr_prism_tet", "001");
438 }
void init_tet(int *elmt, int a, int b, int c, int d)
Definition: build_meshes.C:440
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
void init_prism(int *elmt, int a, int b, int c, int d, int e, int f)
Definition: build_meshes.C:365
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
const int num_nodes
Definition: ex1.C:96
void init_unstr_prism_tet_coords(double *coords)
Definition: build_meshes.C:444
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_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
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

void build_unstr_prism_tet_2 ( )

Definition at line 514 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), init_prism_tet_unit(), init_prism_tet_unit_coords(), init_tet(), and num_nodes.

Referenced by main().

514  {
515 
516  const int num_nodes = 46;
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};
530 
531 
532  // Create a new window named "unstr"
533  COM_new_window("unstr_prism_tet_2");
534 
535  // Regist nodal coordinates, connectivity tables,
536  // and the pconn for pane 1.
537  COM_set_size( "unstr_prism_tet_2.nc", 1, num_nodes);
538  COM_set_array( "unstr_prism_tet_2.nc", 1, &coors1[0],3);
539  COM_set_size( "unstr_prism_tet_2.:W6:", 1, num_prisms1);
540  COM_set_array( "unstr_prism_tet_2.:W6:", 1, &prisms1[0],6);
541  COM_set_size( "unstr_prism_tet_2.:T4:", 1, num_tets1);
542  COM_set_array( "unstr_prism_tet_2.:T4:", 1, &tets1[0],4);
543  // COM_set_size( "unstr_prism_tet_2.pconn", 1, pconn_size);
544  //COM_set_array( "unstr_prism_tet_2.pconn", 1, &pconn1[0]);
545 
546  // Register nodal coordinates, connectivity tables,
547  // and the pconn for pane 2.
548 
549  COM_set_size( "unstr_prism_tet_2.nc", 2, num_nodes);
550  COM_set_array( "unstr_prism_tet_2.nc", 2, &coors2[0],3);
551  COM_set_size( "unstr_prism_tet_2.:W6:", 2, num_prisms2);
552  COM_set_array( "unstr_prism_tet_2.:W6:", 2, &prisms2[0],6);
553  COM_set_size( "unstr_prism_tet_2.:T4:", 2, num_tets2);
554  COM_set_array( "unstr_prism_tet_2.:T4:", 2, &tets2[0],4);
555  // COM_set_size( "unstr_prism_tet_2.pconn", 2, pconn_size);
556  //COM_set_array( "unstr_prism_tet_2.pconn", 2, &pconn2[0]);
557 
558  COM_window_init_done("unstr_prism_tet_2");
559 
560  init_prism_tet_unit(prisms1, tets1,
561  1,2,5,4,28,10,11,14,13,32,
562  19,20,23,22,36,40);
563 
564  init_prism_tet_unit(prisms1+8*6,tets1+4*4,
565  2,3,6,5,29,11,12,15,14,33,
566  20,21,24,23,37,41);
567 
568  init_prism_tet_unit(prisms1+16*6,tets1+8*4,
569  4,5,8,7,30,13,14,17,16,34,
570  22,23,26,25,38,42);
571 
572  init_prism_tet_unit(prisms1+24*6,tets1+12*4,
573  5,6,9,8,31,14,15,18,17,35,
574  23,24,27,26,39,43);
575 
576  init_prism_tet_unit_coords(coors1, 0.0, 0.0,
577  1,2,5,4,28,10,11,14,13,32,
578  19,20,23,22,36,40);
579 
580  init_prism_tet_unit_coords(coors1, 1.0, 0.0,
581  2,3,6,5,29,11,12,15,14,33,
582  20,21,24,23,37,41);
583 
584  init_prism_tet_unit_coords(coors1,0.0,1.0,
585  4,5,8,7,30,13,14,17,16,34,
586  22,23,26,25,38,42);
587 
588  init_prism_tet_unit_coords(coors1,1.0,1.0,
589  5,6,9,8,31,14,15,18,17,35,
590  23,24,27,26,39,43);
591 
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;
595 
596  init_tet(tets1+64,44,41,40,23); init_tet(tets1+68,44,43,41,23);
597  init_tet(tets1+72,44,42,43,23); init_tet(tets1+76,44,40,42,23);
598  init_tet(tets1+80,40,41,20,23); init_tet(tets1+84,41,43,24,23);
599  init_tet(tets1+88,43,42,26,23); init_tet(tets1+92,42,40,22,23);
600  init_tet(tets1+96,41,46,21,24); init_tet(tets1+100,41,45,46,24);
601  init_tet(tets1+104,41,43,45,24);
602 
603  init_prism_tet_unit(prisms2, tets2,
604  1,2,5,4,28,10,11,14,13,32,
605  19,20,23,22,36,40);
606 
607  init_prism_tet_unit(prisms2+8*6,tets2+4*4,
608  2,3,6,5,29,11,12,15,14,33,
609  20,21,24,23,37,41);
610 
611  init_prism_tet_unit(prisms2+16*6,tets2+8*4,
612  4,5,8,7,30,13,14,17,16,34,
613  22,23,26,25,38,42);
614 
615  init_prism_tet_unit(prisms2+24*6,tets2+12*4,
616  5,6,9,8,31,14,15,18,17,35,
617  23,24,27,26,39,43);
618 
619  init_prism_tet_unit_coords(coors2, 2.0, 0.0,
620  1,2,5,4,28,10,11,14,13,32,
621  19,20,23,22,36,40);
622 
623  init_prism_tet_unit_coords(coors2, 3.0, 0.0,
624  2,3,6,5,29,11,12,15,14,33,
625  20,21,24,23,37,41);
626 
627  init_prism_tet_unit_coords(coors2,2.0,1.0,
628  4,5,8,7,30,13,14,17,16,34,
629  22,23,26,25,38,42);
630 
631  init_prism_tet_unit_coords(coors2,3.0,1.0,
632  5,6,9,8,31,14,15,18,17,35,
633  23,24,27,26,39,43);
634 
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;
638 
639  init_tet(tets2+64,45,41,40,23); init_tet(tets2+68,45,43,41,23);
640  init_tet(tets2+72,45,42,43,23); init_tet(tets2+76,45,40,42,23);
641  init_tet(tets2+80,40,41,20,23); init_tet(tets2+84,41,43,24,23);
642  init_tet(tets2+88,43,42,26,23); init_tet(tets2+92,42,40,22,23);
643  init_tet(tets2+96,40,44,42,22); init_tet(tets2+100,44,46,42,22);
644  init_tet(tets2+104,46,25,42,22);
645 
646  // Write the mesh to file.
647  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
648  int HDL_all = COM_get_attribute_handle("unstr_prism_tet_2.all");
649  COM_call_function( OUT_write, "unstr_prism_tet_2", &HDL_all,
650  "unstr_prism_tet_2", "001");
651 }
void init_tet(int *elmt, int a, int b, int c, int d)
Definition: build_meshes.C:440
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
const int num_nodes
Definition: ex1.C:96
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_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 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)
Definition: build_meshes.C:487
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
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)
Definition: build_meshes.C:466

Here is the call graph for this function:

Here is the caller graph for this function:

void build_unstr_pyr ( )

Definition at line 272 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), elmts, init_pyr(), init_unstr_pyr_coords(), num_elmts, and num_nodes.

Referenced by main().

272  {
273 
274  const int num_nodes = 9;
275  const int num_elmts = 6;
276  double crds[num_nodes*3];
277  int elmts[num_elmts*5];
278 
279  // Create a new window named "pyr"
280  COM_new_window("unstr_pyr");
281 
282  // Regist nodal coordinates, connectivity tables,
283  // and the pconn for pane 1.
284  COM_set_size( "unstr_pyr.nc", 1, num_nodes);
285  COM_set_array( "unstr_pyr.nc", 1, &crds[0],3);
286  COM_set_size( "unstr_pyr.:P5:", 1, num_elmts);
287  COM_set_array( "unstr_pyr.:P5:", 1, &elmts[0],5);
288 
289  COM_window_init_done("unstr_pyr");
290 
291  init_pyr(elmts, 1,2,3,4,5);
292  init_pyr(elmts+5, 1,6,7,2,5);
293  init_pyr(elmts+10, 2,7,8,3,5);
294  init_pyr(elmts+15, 3,8,9,4,5);
295  init_pyr(elmts+20, 4,9,6,1,5);
296  init_pyr(elmts+25, 6,9,8,7,5);
297 
298  init_unstr_pyr_coords(&crds[0]);
299 
300  // Write the mesh to file.
301  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
302  int HDL_all = COM_get_attribute_handle("unstr_pyr.all");
303  COM_call_function( OUT_write, "unstr_pyr", &HDL_all,
304  "unstr_pyr", "001");
305 }
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
void init_pyr(int *elmt, int a, int b, int c, int d, int e)
Definition: build_meshes.C:307
const int num_nodes
Definition: ex1.C:96
void init_unstr_pyr_coords(double *coords)
Definition: build_meshes.C:311
int elmts[total_npanes][num_elmts][4]
Definition: ex1.C:109
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_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
const int num_elmts
Definition: ex1.C:97
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

void build_unstr_tet_2 ( )

Definition at line 103 of file build_meshes.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_set_array(), COM_set_size(), COM_window_init_done(), init_crds1_tet_unstr_2(), init_crds2_tet_unstr_2(), and init_tet_unstr_2_elmts().

Referenced by main().

103  {
104 
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};
113 
114  // Create a new window named "unstr"
115  COM_new_window("unstr_tet_2");
116 
117  // Regist nodal coordinates, connectivity tables,
118  // and the pconn for pane 1.
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);
123  COM_set_size( "unstr_tet_2.pconn", 1, 12);
124  COM_set_array( "unstr_tet_2.pconn", 1, &unstr_tet_2_pconn1[0]);
125 
126  // Register nodal coordinates, connectivity tables,
127  // and the pconn for pane 2.
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);
132  COM_set_size( "unstr_tet_2.pconn", 2, 12);
133  COM_set_array( "unstr_tet_2.pconn", 2, &unstr_tet_2_pconn2[0]);
134 
135  // Let Roccom know we have finished adding attributes
136  // to the window "unstr_tet_2"
137  COM_window_init_done("unstr_tet_2");
138 
139  // Calculate coordinates and build connectivity arrays.
140  init_crds1_tet_unstr_2(unstr_tet_2_coors1);
141  init_crds2_tet_unstr_2(unstr_tet_2_coors2);
142  init_tet_unstr_2_elmts(unstr_tet_2_elmts1);
143  init_tet_unstr_2_elmts(unstr_tet_2_elmts2);
144 
145  // Write the mesh to file.
146  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
147  int HDL_all = COM_get_attribute_handle("unstr_tet_2.all");
148  COM_call_function( OUT_write, "unstr_tet_2", &HDL_all,
149  "unstr_tet_2", "001");
150 
151 }
void init_crds2_tet_unstr_2(double *crds)
Definition: build_meshes.C:169
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
void init_crds1_tet_unstr_2(double *crds)
Definition: build_meshes.C:153
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
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_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 init_tet_unstr_2_elmts(int *elmts)
Definition: build_meshes.C:180
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

COM_EXTERN_MODULE ( Rocmap  )
COM_EXTERN_MODULE ( Rocout  )
COM_EXTERN_MODULE ( Rocmop  )
void init_crds1_tet_unstr_2 ( double *  crds)

Definition at line 153 of file build_meshes.C.

References x, y, and z.

Referenced by build_unstr_tet_2(), and init_crds2_tet_unstr_2().

153  {
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;
158  crds[index*3]=x;
159  crds[index*3+1]=2-y;
160  crds[index*3+2]=2-z;
161  // if((index == 13)||(index == 14))
162  if(index == 14)
163  crds[index*3] += .33;
164  }
165  }
166  }
167 }
void int int REAL REAL * y
Definition: read.cpp:74
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

void init_crds2_tet_unstr_2 ( double *  crds)

Definition at line 169 of file build_meshes.C.

References i, and init_crds1_tet_unstr_2().

Referenced by build_unstr_tet_2().

169  {
171  for(int i =0; i < 27; ++i){
172  crds[3*i] += 2;
173  if(i == 12)
174  crds[3*i] += .33;
175  else if (i == 14)
176  crds[3*i] -= .33;
177  }
178 }
void init_crds1_tet_unstr_2(double *crds)
Definition: build_meshes.C:153
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

void init_hex ( int *  elmt,
int  a,
int  b,
int  c,
int  d 
)

Definition at line 243 of file build_meshes.C.

References d.

Referenced by build_unstr_hex().

243  {
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;
246 }
const NT & d

Here is the caller graph for this function:

void init_prism ( int *  elmt,
int  a,
int  b,
int  c,
int  d,
int  e,
int  f 
)

Definition at line 365 of file build_meshes.C.

References d.

Referenced by build_unstr_prism(), build_unstr_prism_tet(), and init_prism_tet_unit().

365  {
366  elmt[0] = a; elmt[1] = b; elmt[2] = c;
367  elmt[3] = d; elmt[4] = e; elmt[5] = f;
368 }
const NT & d

Here is the caller graph for this function:

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 
)

Definition at line 466 of file build_meshes.C.

References init_prism(), and init_tet().

Referenced by build_unstr_prism_tet_2().

470  {
471 
472  init_prism(prism_conn, n1,n5,n4,n6,n10,n9);
473  init_prism(prism_conn+6, n1,n2,n5,n6,n7,n10);
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);
480 
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);
485 }
void init_tet(int *elmt, int a, int b, int c, int d)
Definition: build_meshes.C:440
void init_prism(int *elmt, int a, int b, int c, int d, int e, int f)
Definition: build_meshes.C:365

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Definition at line 487 of file build_meshes.C.

References x, and y.

Referenced by build_unstr_prism_tet_2().

491  {
492 
493  coords[3*n1-3] = 0.0+x; coords[3*n1-2] = 0.0+y; coords[3*n1-1] = 0.0; // 1
494  coords[3*n2-3] = 1.0+x; coords[3*n2-2] = 0.0+y; coords[3*n2-1] = 0.0; // 2
495  coords[3*n3-3] = 1.0+x; coords[3*n3-2] = 1.0+y; coords[3*n3-1] = 0.0; // 3
496  coords[3*n4-3] = 0.0+x; coords[3*n4-2] = 1.0+y; coords[3*n4-1] = 0.0; // 4
497  coords[3*n5-3] = 0.5+x; coords[3*n5-2] = 0.5+y; coords[3*n5-1] = 0.0; // 5
498 
499  coords[3*n6-3] = 0.0+x; coords[3*n6-2] = 0.0+y; coords[3*n6-1] = 1.0; // 6
500  coords[3*n7-3] = 1.0+x; coords[3*n7-2] = 0.0+y; coords[3*n7-1] = 1.0; // 7
501  coords[3*n8-3] = 1.0+x; coords[3*n8-2] = 1.0+y; coords[3*n8-1] = 1.0; // 8
502  coords[3*n9-3] = 0.0+x; coords[3*n9-2] = 1.0+y; coords[3*n9-1] = 1.0; // 9
503  coords[3*n10-3] = .65+x; coords[3*n10-2] = .35+y; coords[3*n10-1] = 1.0; // 10
504 
505  coords[3*n11-3] = 0.0+x; coords[3*n11-2] = 0.0+y; coords[3*n11-1] = 2.0; // 11
506  coords[3*n12-3] = 1.0+x; coords[3*n12-2] = 0.0+y; coords[3*n12-1] = 2.0; // 12
507  coords[3*n13-3] = 1.0+x; coords[3*n13-2] = 1.0+y; coords[3*n13-1] = 2.0; // 13
508  coords[3*n14-3] = 0.0+x; coords[3*n14-2] = 1.0+y; coords[3*n14-1] = 2.0; // 14
509  coords[3*n15-3] = .27+x; coords[3*n15-2] = .29+y; coords[3*n15-1] = 2.24; // 15
510 
511  coords[3*n16-3] = 0.5+x; coords[3*n16-2] = 0.5+y; coords[3*n16-1] = 2.5; // 16
512 }
void int int REAL REAL * y
Definition: read.cpp:74
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

void init_pyr ( int *  elmt,
int  a,
int  b,
int  c,
int  d,
int  e 
)

Definition at line 307 of file build_meshes.C.

References d.

Referenced by build_unstr_pyr().

307  {
308  elmt[0] = a; elmt[1] = b; elmt[2] = c; elmt[3] = d; elmt[4] = e;
309 }
const NT & d

Here is the caller graph for this function:

void init_tet ( int *  elmt,
int  a,
int  b,
int  c,
int  d 
)

Definition at line 440 of file build_meshes.C.

References d.

Referenced by build_unstr_prism_tet(), build_unstr_prism_tet_2(), and init_prism_tet_unit().

440  {
441  elmt[0] = a; elmt[1] = b; elmt[2] = c; elmt[3] = d;
442 }
const NT & d

Here is the caller graph for this function:

void init_tet_unstr_2_elmts ( int *  elmts)

Definition at line 180 of file build_meshes.C.

References init_tets_from_hex().

Referenced by build_unstr_tet_2().

180  {
181  init_tets_from_hex(elmts+0, 1,2,4,5);
182  init_tets_from_hex(elmts+24, 2,3,5,6);
183  init_tets_from_hex(elmts+48, 4,5,7,8);
184  init_tets_from_hex(elmts+72, 5,6,8,9);
185  init_tets_from_hex(elmts+96, 10,11,13,14);
186  init_tets_from_hex(elmts+120,11,12,14,15);
187  init_tets_from_hex(elmts+144,13,14,16,17);
188  init_tets_from_hex(elmts+168,14,15,17,18);
189 }
void init_tets_from_hex(int *elmt, int a, int b, int c, int d)
Definition: build_meshes.C:191
int elmts[total_npanes][num_elmts][4]
Definition: ex1.C:109

Here is the call graph for this function:

Here is the caller graph for this function:

void init_tets_from_hex ( int *  elmt,
int  a,
int  b,
int  c,
int  d 
)

Definition at line 191 of file build_meshes.C.

References d.

Referenced by init_tet_unstr_2_elmts().

191  {
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;
199 }
const NT & d

Here is the caller graph for this function:

void init_unstr_hex_coords ( double *  coords)

Definition at line 248 of file build_meshes.C.

References i, j, and k.

Referenced by build_unstr_hex().

248  {
249 
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;
256  }
257  }
258  }
259 
260  coords[39] = .73;
261  coords[40] = .87;
262  coords[41] = 1.27;
263 }
j indices k indices k
Definition: Indexing.h:6
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6

Here is the caller graph for this function:

void init_unstr_hex_elmts ( int *  elmts)
void init_unstr_prism_coords ( double *  coords)

Definition at line 370 of file build_meshes.C.

Referenced by build_unstr_prism().

370  {
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;
386 }

Here is the caller graph for this function:

void init_unstr_prism_elmts ( int *  elmts)
void init_unstr_prism_tet_coords ( double *  coords)

Definition at line 444 of file build_meshes.C.

Referenced by build_unstr_prism_tet().

444  {
445  coords[0] = 0.0; coords[1] = 0.0; coords[2] = 0.0; // 1
446  coords[3] = 1.0; coords[4] = 0.0; coords[5] = 0.0; // 2
447  coords[6] = 1.0; coords[7] = 1.0; coords[8] = 0.0; // 3
448  coords[9] = 0.0; coords[10] = 1.0; coords[11] = 0.0; // 4
449  coords[12] = 0.5; coords[13] = 0.5; coords[14] = 0.0; // 5
450 
451  coords[15] = 0.0; coords[16] = 0.0; coords[17] = 1.0; // 6
452  coords[18] = 1.0; coords[19] = 0.0; coords[20] = 1.0; // 7
453  coords[21] = 1.0; coords[22] = 1.0; coords[23] = 1.0; // 8
454  coords[24] = 0.0; coords[25] = 1.0; coords[26] = 1.0; // 9
455  coords[27] = 0.65; coords[28] = 0.35; coords[29] = 1.0; // 10
456 
457  coords[30] = 0.0; coords[31] = 0.0; coords[32] = 2.0; // 11
458  coords[33] = 1.0; coords[34] = 0.0; coords[35] = 2.0; // 12
459  coords[36] = 1.0; coords[37] = 1.0; coords[38] = 2.0; // 13
460  coords[39] = 0.0; coords[40] = 1.0; coords[41] = 2.0; // 14
461  coords[42] = 0.27; coords[43] = 0.29; coords[44] = 2.24; // 15
462 
463  coords[45] = 0.5; coords[46] = 0.5; coords[47] = 2.5; // 16
464 }

Here is the caller graph for this function:

void init_unstr_prism_tet_elmts ( int *  elmts)
void init_unstr_pyr_coords ( double *  coords)

Definition at line 311 of file build_meshes.C.

Referenced by build_unstr_pyr().

311  {
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;
321 }

Here is the caller graph for this function:

void init_unstr_pyr_elmts ( int *  elmts)
int main ( int  argc,
char *  argv[] 
)

Definition at line 63 of file build_meshes.C.

References build_unstr_hex(), build_unstr_prism(), build_unstr_prism_tet(), build_unstr_prism_tet_2(), build_unstr_pyr(), build_unstr_tet_2(), COM_finalize(), COM_init(), COM_LOAD_MODULE_STATIC_DYNAMIC, COM_set_profiling(), and COM_set_verbose().

63  {
64 
65  // Initialize Roccom
66  COM_init( &argc, &argv);
67 
68  // Set Rocom's verbose level pretty high, and
69  // turn on profiling.
70  COM_set_verbose(111);
72 
73  // Load the required Roccom modules.
77 
84 
85  COM_finalize();
86 }
void build_unstr_tet_2()
Definition: build_meshes.C:103
A Roccom mesh optimization module.
Definition: Rocmop.h:41
void COM_set_verbose(int i)
Definition: roccom_c++.h:543
void COM_finalize()
Definition: roccom_c++.h:59
void build_unstr_prism_tet_2()
Definition: build_meshes.C:514
Definition: Rocout.h:81
void build_unstr_pyr()
Definition: build_meshes.C:272
void COM_set_profiling(int i)
Definition: roccom_c++.h:550
void build_unstr_prism()
Definition: build_meshes.C:328
void build_unstr_hex()
Definition: build_meshes.C:208
void COM_init(int *argc, char ***argv)
Definition: roccom_c++.h:57
void build_unstr_prism_tet()
Definition: build_meshes.C:393
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
Definition: roccom_basic.h:111

Here is the call graph for this function:

void print_array ( T *  data,
int  size,
int  space 
)

Definition at line 55 of file build_meshes.C.

References i.

55  {
56  for(int i =0; i < size; ++i){
57  cout << data[i] << " ";
58  if((i+1)%space ==0)
59  cout << endl;
60  }
61 }
blockLoc i
Definition: read.cpp:79