Changeset 23522
- Timestamp:
- 12/08/18 09:23:04 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r23501 r23522 353 353 analysis_type=output->analysis_type_list[i]; 354 354 output->SetCurrentConfiguration(analysis_type); 355 if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices355 //if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices 356 356 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type); 357 357 NodesDofx(output->nodes_list[i],output->parameters,analysis_type); … … 442 442 443 443 if(i==0){ 444 if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n");445 VerticesDofx(vertices,parameters);444 // if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n"); 445 // VerticesDofx(vertices,parameters); 446 446 447 447 if(VerboseMProcessor()) _printf0_(" detecting active vertices\n"); … … 530 530 analysis_type=this->analysis_type_list[i]; 531 531 SetCurrentConfiguration(analysis_type); 532 if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices532 //if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices 533 533 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type); 534 534 NodesDofx(this->nodes_list[i],this->parameters,analysis_type); -
issm/trunk-jpl/src/c/classes/Vertex.cpp
r23519 r23522 20 20 } 21 21 /*}}}*/ 22 Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid, bool vertex_clone, IoModel* iomodel){/*{{{*/22 Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,int vertex_pid,bool vertex_clone, IoModel* iomodel){/*{{{*/ 23 23 24 24 /*Checks in debugging mode*/ 25 25 _assert_(vertex_sid>=0 && vertex_sid<iomodel->numberofvertices); 26 26 27 this->id = vertex_id; 28 this->sid = vertex_sid; 29 this->pid = UNDEF; 30 this->lid = vertex_lid; 31 27 /*IDs*/ 28 this->id = vertex_id; 29 this->sid = vertex_sid; 30 this->pid = vertex_pid; 31 this->lid = vertex_lid; 32 33 /*Coordinates*/ 32 34 _assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z")); 33 35 this->x = iomodel->Data("md.mesh.x")[vertex_sid]; … … 35 37 this->z = iomodel->Data("md.mesh.z")[vertex_sid]; 36 38 this->domaintype = iomodel->domaintype; 37 38 39 if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){ 39 40 this->latitute = iomodel->Data("md.mesh.lat")[vertex_sid]; -
issm/trunk-jpl/src/c/classes/Vertex.h
r23519 r23522 37 37 /*Vertex constructors, destructors {{{*/ 38 38 Vertex(); 39 Vertex(int id, int sid,int lid, bool clone, IoModel* iomodel);39 Vertex(int id, int sid,int lid,int pid,bool clone, IoModel* iomodel); 40 40 ~Vertex(); 41 41 /*}}}*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
r23519 r23522 382 382 xDelete<int>(vertices_proc_count); 383 383 384 /*Final step: prepare pids (parallel ids), first count number of masters for each proc*/ 385 int* num_masters = xNewZeroInit<int>(num_procs); 386 for(int i=0;i<iomodel->numberofvertices;i++){ 387 num_masters[vertices_ranks[MAXCONNECTIVITY*i+0]]++; 388 } 389 /*Now count offsets for each procs (by taking the sum of masters of procs<my_rank)*/ 390 int* rank_offsets = xNewZeroInit<int>(num_procs); 391 for(int i=0;i<num_procs;i++){ 392 for(int j=i+1;j<num_procs;j++) rank_offsets[i]+=num_masters[j]; 393 } 394 xDelete<int>(num_masters); 395 /*Now create pids*/ 396 int* vertices_pids = xNew<int>(iomodel->numberofvertices); 397 int* rank_counters = xNewZeroInit<int>(iomodel->numberofvertices); 398 for(int i=0;i<iomodel->numberofvertices;i++){ 399 int rank_master = vertices_ranks[MAXCONNECTIVITY*i+0]; 400 vertices_pids[i] = rank_offsets[rank_master]+rank_counters[rank_master]; 401 rank_counters[rank_master]++; 402 } 403 xDelete<int>(rank_counters); 404 xDelete<int>(rank_offsets); 405 406 /*Go ahead and create vertices now that we have all we need*/ 384 407 for(int i=0;i<iomodel->numberofvertices;i++){ 385 408 if(vertices_lids[i]!=-1){ 386 409 bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank); 387 vertices->AddObject(new Vertex(i+1,i,vertices_lids[i], isclone,iomodel));410 vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],vertices_pids[i],isclone,iomodel)); 388 411 } 389 412 } 390 413 xDelete<int>(vertices_ranks); 391 414 xDelete<int>(vertices_lids); 415 xDelete<int>(vertices_pids); 392 416 393 417 /*Free data: */
Note:
See TracChangeset
for help on using the changeset viewer.