I realized the mistake I was making, since all my sub-problems share the
same fe space.  I don't need a vector of FESystem or FEValues but just one
object of each object for all my sub-problems.

Best,
Karthi.

On Sun, Jan 17, 2021 at 4:48 PM Karthikeyan Chockalingam <
karthi.chockalin...@gmail.com> wrote:

> Thank you very much for your response.
>
>
> Now, I understand since the fe space is the same for the sub-problems I
> can use the same dof_handler for both.
>
>
> Question (1) Does it mean when I distribute the dofs, I should do it twice
> with the same dof_handler?
>
>
> dof_handler.distribute_dofs(fe_one);
>
> dof_handler.distribute_dofs(fe_two);
>
>
>
> Question(2) Currently, both the sub-problems solves almost the same pde
> and in
>
> the future the number of subproblems can be more than two.
>
> So I am planning to define a vector of FESystem<dim>.
>
>
> std::vector<FESystem<dim>>  fe;
>
>
> In the body of the constructor I have
>
>
>    for(unsigned int i=0; i < num_index; i++)
>
>        fe.push_back({FE_Q<dim>(degree),1,FE_Q<dim>(degree)});
>
>
> The above code compiles.
>
>
> Likewise define a vector for system_matrix, solution, old_solution,
> system_rhs.
>
> Is this the approach correct?
>
>
> Question (3)
>
>
> Can I do the same for FEValues?
>
>
> std::vector<FEValues<dim>> fe_vector_values;
>
>
>     for(unsigned int i=0; i < num_index; i++)
>
>       fe_vector_values.push_back({fe_vector[i], quadrature_formula,
> update_values});
>
>
> Strangely enough depending on where the above code is located,
>
> it sometimes gives me compile errors.
>
>
> If there is a better approach please let me know. Thank you!!
>
>
> Best,
>
> Karthi.
>
> On Sat, Jan 16, 2021 at 5:22 PM Wolfgang Bangerth <bange...@colostate.edu>
> wrote:
>
>> On 1/14/21 10:51 AM, Karthi wrote:
>> > I have gone through a lot of tutorials. I would like to understand the
>> basic
>> > relation between dof_handler and FESystem. I am trying to solve
>> _two_ 4th
>> > order equations on the same mesh (or triangulation). And each equation
>> is
>> > split into two second order equations.
>> >
>> > FESystem<dim>      fe_one,  fe_two;
>> >
>> > BlockSparseMatrix<double> system_matrix_one, system_matrix_two;
>> >
>> > BlockVector<double> solution_one, solution_two;
>> >
>> > BlockVector<double> old_solution_one, old_solution_two;
>> >
>> > BlockVector<double> system_rhs_one, system_rhs_two;
>> >
>> > Question (1) Do I need one or two dof_handler?
>> >
>> > DoFHandler<dim>    dof_handler;
>> >
>> > Where,
>> >
>> > fe_one(FE_Q<dim>(degree),1, FE_Q<dim>(degree),1)
>> >
>> > fe_two(FE_Q<dim>(degree),1, FE_Q<dim>(degree),1)
>> >
>> > Some additional information, both the fe_one and fe_two systems are
>> > _independently solved_ in a semi-implicitly manner. Meaning
>> system_matrix_one
>> > is a function of old_solution_one and old_solution_two, likewise for
>> > system_matrix_two.
>>
>> No. A DoFHandler in essence just describes a function space: The
>> triangulation
>> provides the subdivision of the domain into cells, the finite element
>> provides
>> information about what the polynomial space is, and the DoFHandler
>> provides an
>> enumeration of degrees of freedom. As a consequence, if you want to use
>> the
>> same function space for your two problems, then you can use the same
>> DoFHandler for both of your sub-problems.
>>
>>
>> > Question (2) I am assuming one block spartisty_pattern is enough and
>> use the
>> > same for both the system_matrix?
>> >
>> > BlockSparsityPattern      sparsity_pattern;
>>
>> Correct.
>>
>> Best
>>   W.
>> --
>> ------------------------------------------------------------------------
>> Wolfgang Bangerth          email:                 bange...@colostate.edu
>>                             www: http://www.math.colostate.edu/~bangerth/
>>
>> --
>> 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 a topic in the
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/dealii/TyT5br2YYnM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> dealii+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/dealii/0e23dcc8-d543-824a-1165-0c8bf008b350%40colostate.edu
>> .
>>
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAFd7mX1o6rTLZYw00K02ARrmQ6B8HkUXPT2nJtTpyZT7P6iZ7A%40mail.gmail.com.

Reply via email to