Hello Tobias!
Hello DealII's users!

Thank-you very much, I misunderstood the concepts between "material_id" and "subdomain_id":

Now, doing:
/Triangulation<DIMENSION>::cell_iterator celltria =triangulation_ANODO.begin_active (), endctria = triangulation_ANODO.end(); for (; celltria!=endctria; ++celltria) celltria->set_subdomain_id(celltria->material_id());/

The following method works properly:

/DoFTools::extract_subdomain_dofs(dof_handler_total_ANODO,domain, selected_dofs);
/
Being "domain" the variable that I have put through /celltria->set_subdomain_id(celltria->material_id())/ method.

So, thank-you, again!

However, I have the following doubt:

Before inserting /celltria->set_subdomain_id(celltria->material_id());
/I could use the method "/DoFTools::extract_boundary_dofs (dof_handler_total_ANODO,component_select,selected_dofs, boundary_indicators);/", and in that case I obtained the right values.
So, my question is the following one:

Why do I need to do /celltria->set_subdomain_id(celltria->material_id()) /in order to use /DoFTools::extract_subdomain_dofs(dof_handler_total_ANODO,domain, selected_dofs) /but it isn't necessary if I want to use /DoFTools::extract_boundary_dofs (dof_handler_total_ANODO,component_select,selected_dofs, boundary_indicators)/ (I mean, in both cases, in "grid_in.cc", we are using /cells.back().material_id = material_id/ and /subcelldata.boundary_lines.back().material_id = material_id/)?



Thanks in advance!
Best
Isa

Tobias Leicht wrote:
Hi Isa,

subdomain and material are two different concepts. If you want to use the material ID read from a file as subdomain ID you have to loop over all cells and set the subdomain ID of each one to be the same as the material ID, i.e.

for (; cell!=endc; ++cell)
 cell->set_subdomain_id(cell->material_id());

Best,
Tobias



On Friday 31 July 2009 14:47, Isabel Gil wrote:
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

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to