Hello Markus,

thank-you for your answer.
I haven't understood very well how I would have to work with FECollection
and FE_Nothing classes.
I would be really grateful if you could help me.

Up to now, as I had to solve two different equations to the same
Triangulation but for two different domains I did:

DoFHandler<2>  dof_handler_laplace, dof_handler_NS;
Triangulation<2>        triangulation;

FE_Q<2>                 fe_fc;
FE_Q<2>                 fe_velocity;
FE_Q<2>                 fe_pressure;
FESystem<2>             fe_total;

//In my construction method I did:

dof_handler_laplace(triangulation),
dof_handler_NS(triangulation),
fe_fc(2),
fe_velocity(2),
fe_pressure(2),
fe_total(fe_velocity,2, fe_pressure,1),

//In my initialization method I did:

dof_handler_laplace.distribute_dofs(fe_fc);
DoFRenumbering::component_wise(dof_handler_laplace);

dof_handler_NS.distribute_dofs(fe_total);
DoFRenumbering::component_wise(dof_handler_NS);

If I used FECollection and FE_Nothing classes, I wouldn't know how to
create the construction method or the initialization one. How would it be?

Besides, other doubts I have are the following ones:

(Regarding the picture I "draw" in my first email)

1) Regarding Navier-Stokes equations: If I put FE_System with FE_Q for
domains 1,2,3,5,6 and 7 and FE_Nothing for domain 4, I should put boundary
conditions on the line between 3 and 4 and on the line between 4 and 5,
shouldn't I?
But as they are not external boundaries I should use the method
DoFTools::extract_subdomain_dofs(,,,) in the following way;

DoFTools::extract_subdomain_dofs(dof_handler_NS,4, selected_dofsMEM);
DoFTools::extract_subdomain_dofs(dof_handler_NS,3, selected_dofsCLa);
DoFTools::extract_subdomain_dofs(dof_handler_NS,5, selected_dofsCLc);
for (unsigned int i=0;i<dof_handler.n_dofs();i++)
if ((selected_dofsMEM[i]==true) &&(selected_dofsCLa[i]==true)
    ||(selected_dofsMEM[i]==true) &&(selected_dofsCLc[i]==true))
                boundary_values[i]=0.0;

2) Regarding Laplace equation: If I put FE_Q for domains3,4 and 5 and
FE_Nothing for domain 1,2,6 and 7, I should put boundary conditions on the
line between 2 and 3 and on the line between 5 and 6, shouldn't I? But as
they are not external boundaries I should use the method
DoFTools::extract_subdomain_dofs(,,,) in the following way;

DoFTools::extract_subdomain_dofs(dof_handler_NS,2, selected_dofsGDLa);
DoFTools::extract_subdomain_dofs(dof_handler_NS,3, selected_dofsCLa);
DoFTools::extract_subdomain_dofs(dof_handler_NS,5, selected_dofsCLc);
DoFTools::extract_subdomain_dofs(dof_handler_NS,6, selected_dofsCDLc);
for (unsigned int i=0;i<dof_handler.n_dofs();i++)
if ((selected_dofsGDLa[i]==true) &&(selected_dofsCLa[i]==true)
                boundary_values[i]=0.0;
f ((selected_dofsGDLc[i]==true) &&(selected_dofsCLc[i]==true)
                boundary_values[i]=0.0;

3) And in order to create the assemble of matrices, I shouldn't do
anything with the cells that are using FE_Nothing, should I?
4) Another question is if the way I used previously, i.e., without using
FECollection nor FE_Nothing, although being more complicated, didn't it do
the same that the scheme you have suggested?

Again, thank-you very much in advance.
Best
Isa


> Hello Isa,
>
> perhabs you want to take look on the FE_Nothing element. With this you
> can create a FECollection consisting of, for example, Taylor-Hood or
> Raviart-Thomas elements (for Navier-Stokes), FE_Nothing (for the cells,
> where nothing should happen) and FE_Q (for Laplace) and activate that
> finite element on the cell, which you require for your current PDE.
> Doing it this way, you do not have to set the degrees of freedom on the
> unwanted part of the domain to zero explicitly, because there are just
> no degrees of freedom anymore.
>
> Best Regards,
> Markus
>
>
>
> Am 28.08.10 18:10, schrieb [email protected]:
>> Hello everybody!
>>
>> I have a 2D geometry with different domains (each domain has its own
>> material value in order to be identified).
>> This geometry has associated its ?Triangulation? and its ?DoFHandler?.
>>
>> The geometry and its material values is the following one:
>> -----------------------------------------------------------------
>> |              |     |       |       |       |       |       |
>> |              |     |       |       |       |       |       |
>> |    1         |   2    |  3    |  4    |  5 |  6    |   7   |
>> |              |     |       |       |       |       |       |
>> -----------------------------------------------------------------
>>
>> I want to calculate Navier-Stokes equations in domains 1,2,3,5,6 and 7.
>> So, I don't want to take into account the domain 4. That is to say, for
>> this system the line between domain 3 and 4 is a boundary and also the
>> line between domain 4 and 5.
>>
>> To calculate the assemble of matrices I do:
>>
>> ...
>>    for (; cell!=endc; ++cell)
>>    {
>>      if ((celltria->material_id()==1))
>>     ...
>>      else if ((celltria->material_id()==2))
>>     ...
>>      else if ((celltria->material_id()==3))
>>     ?
>>      else if ((celltria->material_id()==5))
>>     ...
>>      else if ((celltria->material_id()==6))
>>     ...
>>      else if ((celltria->material_id()==7))
>>     ...
>>      else if ((celltria->material_id()==4))
>> {
>> //Here I don't do anything because I don't want calculate nothing.
>> }
>>
>> cell->  get_dof_indices(local_dof_indices);
>> for (unsigned int i=0;i<dofs_per_cell;++i)
>>        {
>>        for (unsigned int j=0;j<dofs_per_cell;j++)
>>                        general.add(local_dof_indices[i],
>>                                      local_dof_indices[j],
>>                                      cell_matrix(i,j));
>>        vector_solution_rhs(local_dof_indices[i]) += cell_rhs(i);
>>        }
>>        celltria++;
>>
>>    }
>>
>> //Here, I put all values inside domain 4 with a value of zero:
>>
>> DoFTools::extract_subdomain_dofs(dof_handler,4, selected_dofsMEM);
>>
>> for (unsigned int i=0;i<dof_handler.n_dofs();i++)
>>   if ((selected_dofsMEM[i]==true))
>>              boundary_values[i]=0.0;
>>
>> //Apply the boundary values to my system:
>>
>> MatrixTools::apply_boundary_values(boundary_values,general,
>> vector_solution,vector_solution_rhs,false);
>>
>> I am not sure if this way is the correct way to proceed.
>>
>> On the other hand, I want to calculate a Laplace equation in domains 3,4
>> and 5. So, I don't want to take into account the domains 1,2,6 and 7.
>> So,
>> the line between 2 and 3 would be a boundary and the same to line
>> between
>> 5 and 6.
>>
>> I was asking me if there are a way in other to calculate a particular
>> equation only in some domains belonging to the same geometry.
>>
>> Thanks in advance.
>> Best.
>> Isa
>>
>>
>> _______________________________________________
>> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
>>
>>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
>



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

Reply via email to