Hi,

I'm trying to subtract some elements based on a user-defined criteria. 
Ideally, I want to use each processor in a way that they are responsible 
only for their partition (using is_locally_owned()) to remove the cells 
from the triangulation 
using GridGenerator::create_triangulation_with_removed_cells. However, when 
I used  this, it will not proceed after 
GridGenerator::create_triangulation_with_removed_cells. 
Very inefficient solution is each processor will process the whole 
triangulation space and remove the elements. This works. However, as the 
simulation size increases, this becomes really a bottle neck.

Is there any way I can tackle this smarter?

Thanks
Reza

*Below is the version of the code which works but very inefficiently.*
*I added the red lines so every processor be responsible just for their own 
parts. It stops at GridGenerator::create_triangulation_with_removed_cells.*



GridGenerator::subdivided_hyper_rectangle (triangulation2, 
userInputs.subdivisions, Point<dim>(), 
Point<dim>(userInputs.span[0],userInputs.span[1],userInputs.span[2]), true);

typename Triangulation< dim, dim >::active_cell_iterator cell = 
triangulation2.begin_active(), endc = triangulation2.end();

for (; cell!=endc; ++cell) {
if (cell->is_locally_owned()){
double pnt3[3];
const Point<dim> pnt2=cell->center();
for (unsigned int i=0; i<dim; ++i){
pnt3[i]=pnt2[i];
}

gID=orientations_Mesh.getMaterialID(pnt3);
cellOrientationMap_Mesh.push_back(gID);
}
}

unsigned int materialID;
unsigned int cell2=0;
cell = triangulation2.begin_active(); endc = triangulation2.end();
std::set<typename Triangulation< dim, dim >::active_cell_iterator> 
cells_to_remove;
unsigned int NumberOwned=0;
for (; cell!=endc; ++cell) {
if (cell->is_locally_owned()){
materialID=cellOrientationMap_Mesh[cell2];
NumberOwned=NumberOwned+1;
if (materialID ==userInputs.deletionGrainID){
cells_to_remove.insert (cell);
}
cell2=cell2+1;
}
}

char buffer[200];

if (cells_to_remove.size()>0){
GridGenerator::create_triangulation_with_removed_cells(triangulation2,cells_to_remove,triangulation);
}
else{
triangulation.copy_triangulation(triangulation2);
}
}
else {
triangulation.copy_triangulation(triangulation2);
}

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6003fa12-32f1-4bf8-a03b-680b45cb25fan%40googlegroups.com.

Reply via email to