Changeset 2055

Show
Ignore:
Timestamp:
09/04/08 12:35:47 (3 months ago)
Author:
janehu
Message:

updated test cases for unite operation to see the name changes with the order of enities to be united.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cgm/trunk/test/r_w.cpp

    r2047 r2055  
    196196  gti->get_free_ref_entities(free_entities); 
    197197  assert(free_entities.size() ==0); 
     198 
     199  // Read in the geometry from files specified on the command line 
     200  argv = "unite1.occ"; 
     201  status = read_geometry(1, &argv, true); 
     202  if (status == CUBIT_FAILURE) exit(1); 
     203  //Read in 2 volumes. 
     204 
     205  from_bodies.clean_out(); 
     206  new_bodies.clean_out(); 
     207  gti->bodies(from_bodies); 
     208  status = gmti->unite(from_bodies, new_bodies, CUBIT_FALSE); 
     209  assert(status); 
     210 
     211  filename = "unite2.occ"; 
     212  ref_entity_list.clean_out(); 
     213  num_ents_exported = 0; 
     214  rsl = gti->export_solid_model(ref_entity_list, filename, filetype, 
     215                                 num_ents_exported, cubit_version); 
     216 
     217  bodies.clean_out(); 
     218  gti->bodies(bodies); 
     219  //delete all entities 
     220  gti->delete_Body(bodies); 
     221 
     222  gti->get_free_ref_entities(free_entities); 
     223  assert(free_entities.size() ==0); 
     224 
     225  // Read in the geometry from files specified on the command line 
     226  argv = "unite1.occ"; 
     227  status = read_geometry(1, &argv, true); 
     228  if (status == CUBIT_FAILURE) exit(1); 
     229  //Read in 2 volumes. 
     230 
     231  //change the order of the two bodies,and unite, see the united name unchanged. 
     232  new_bodies.clean_out(); 
     233  bodies.clean_out(); 
     234  gti->bodies(bodies); 
     235  from_bodies.clean_out(); 
     236  from_bodies.append(bodies.step_and_get()); 
     237  from_bodies.append(bodies.step_and_get()); 
     238 
     239  status = gmti->unite(from_bodies, new_bodies, CUBIT_FALSE); 
     240  assert(status); 
     241  filename = "unite3.occ"; 
     242  ref_entity_list.clean_out(); 
     243  num_ents_exported = 0; 
     244  rsl = gti->export_solid_model(ref_entity_list, filename, filetype, 
     245                                 num_ents_exported, cubit_version); 
     246 
     247  bodies.clean_out(); 
     248  gti->bodies(bodies); 
     249  //delete all entities 
     250  gti->delete_Body(bodies); 
     251 
     252  gti->get_free_ref_entities(free_entities); 
     253  assert(free_entities.size() ==0); 
     254 
     255    // Read in the geometry from files specified on the command line 
     256  argv = "unite4.occ"; 
     257  status = read_geometry(1, &argv, true); 
     258  if (status == CUBIT_FAILURE) exit(1); 
     259  //Read in 2 volumes. 
     260 
     261  from_bodies.clean_out(); 
     262  new_bodies.clean_out(); 
     263  gti->bodies(from_bodies); 
     264  status = gmti->unite(from_bodies, new_bodies, CUBIT_FALSE); 
     265  assert(status); 
     266 
     267  filename = "unite5.occ"; 
     268  ref_entity_list.clean_out(); 
     269  num_ents_exported = 0; 
     270  rsl = gti->export_solid_model(ref_entity_list, filename, filetype, 
     271                                 num_ents_exported, cubit_version); 
     272 
     273  bodies.clean_out(); 
     274  gti->bodies(bodies); 
     275  //delete all entities 
     276  gti->delete_Body(bodies); 
     277 
     278  gti->get_free_ref_entities(free_entities); 
     279  assert(free_entities.size() ==0); 
     280 
     281  // Read in the geometry from files specified on the command line 
     282  argv = "unite4.occ"; 
     283  status = read_geometry(1, &argv, true); 
     284  if (status == CUBIT_FAILURE) exit(1); 
     285  //Read in 2 volumes. 
     286 
     287  //change the order of the two bodies, and unite, see the name change. 
     288  new_bodies.clean_out(); 
     289  bodies.clean_out(); 
     290  gti->bodies(bodies); 
     291  from_bodies.clean_out(); 
     292  from_bodies.append(bodies.step_and_get()); 
     293  from_bodies.append(bodies.step_and_get()); 
     294 
     295  status = gmti->unite(from_bodies, new_bodies, CUBIT_FALSE); 
     296  assert(status); 
     297  filename = "unite6.occ"; 
     298  ref_entity_list.clean_out(); 
     299  num_ents_exported = 0; 
     300  rsl = gti->export_solid_model(ref_entity_list, filename, filetype, 
     301                                 num_ents_exported, cubit_version); 
     302 
     303  bodies.clean_out(); 
     304  gti->bodies(bodies); 
     305  //delete all entities 
     306  gti->delete_Body(bodies); 
     307 
     308  gti->get_free_ref_entities(free_entities); 
     309  assert(free_entities.size() ==0); 
    198310  return CUBIT_SUCCESS; 
    199311}