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);
The latter would overwrite the former. But because your two elements are the
same, the second operation in reality does nothing at all.
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(unsignedinti=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?
You can do that, but in reality all of your finite element spaces are the
same, so you might as well create only one finite element and one DoFHandler,
plus multiple matrices and vectors. I think you already figured this out in
your follow-up email.
Question (3)
Can I do the same for FEValues?
std::vector<FEValues<dim>> fe_vector_values;
for(unsignedinti=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.
You can do that, but again you are using identical objects where it would be
enough to just have one. (You get the error messages because FEValues objects
cannot be copied. But std::vector<X> requires that objects of type X can be
copied. The solution is to use std::vector<std::unique_ptr<X>> in such cases.)
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
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 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/2564a02a-10cd-5bf3-fc93-b11e2f99ea44%40colostate.edu.