Hello!
Yes, you are right.
Inserting the following lines in "read_ucd()" in "grid_in.cc", both data
(boundary values and domain values) are read in the right way.
****************************************************************************************
double cuentoquads2=0;
for (unsigned int cell=0; cell<subcelldata.boundary_quads.size();
++cell)
{
int numero;
numero=(int)(subcelldata.boundary_quads[cell].material_id);
if (numero != 0)
cuentoquads2++;
}
std::cout <<"we're in the library, number of quads: "<<cuentoquads2
<<std::endl;
double cuentohexs2=0;
for (unsigned int cell=0; cell<cuentohexs; ++cell)
{
if (((int)cells[cell].material_id !=0) ))
cuentohexs2++;
}
std::cout <<"we're in the library, number of hexs: "<<cuentohexs2
<<std::endl;
****************************************************************************************
But, once I am in my .cpp program and I want to extract dofs with a
fixed domain value (different from zero):
std::vector< bool > selected_dofs(dof_handler_total_ANODO.n_dofs());
DoFTools::extract_subdomain_dofs(dof_handler_total_ANODO,domain,
selected_dofs);
for (unsigned int i=0;i<dof_handler_total_ANODO.n_dofs();i++)
{
if (selected_dofs[i]==true)
pcout<<"XXXXXXXXXXXXXX: "<<i<<endl;
}
the "selected_dofs" vector doesn't take any TRUE value.
Thanks in advance!
Best
Isa
Wolfgang Bangerth wrote:
double cuentoquads2=0;
for (unsigned int cell=cuentohexs; cell<(cuentoquads+cuentohexs);
++cell) {
if ((int)cells[cell].material_id ==boundary_value)
cuentoquads2++;
}
std::cout <<"NUMBER OF QUADS: "<<cuentoquads2 <<std::endl; //where
cuentoquads2= 0, i.e., this is different from cuentoquads, This is
*WRONG*.
I believe that 'cells' is an array that has only 'cuentohexs' elements. You
access invalid elements here. If you want to investigate faces (quads
here) you have to look into the 'subcelldata' array, specifically the
boundary_quads member. Take a look at the queue of if-statements
immediately above the GridTools::delete_unused_vertices call in
grid_in.cc.
Best
W.
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii