In the step-20, the mixed finite
element method is used to solve a 2D Laplace problem, where RT and DG
elements are used for the velocity and the pressure respectively. How
does it work on spaces of Pn and Pn-1 elements?
Since the velocity is a vector, the main problem becomes representing the two components of the velocity both by Pn elements. Thanks for your help!
Best,
Jie Liu
template <int dim>
MixedLaplaceProblem<dim>::MixedLaplaceProblem (const unsigned int degree)
:
degree (degree),
//fe (FE_RaviartThomas<dim>(degree), 1,
// FE_DGQ<dim>(degree-2), 1),
fe (FE_Q<dim>(degree), dim,
FE_Q<dim>(degree-1), 1),
dof_handler (triangulation)
{}
Number of active cells: 64
Total number of cells: 85
Number of degrees of freedom: 1539 (625+289)
--------------------------------------------------------
An error occurred in line <65> of file </mnt/dutita4/dv/jliu/Localdisk/dealii-8.5.0/source/dofs/dof_tools_sparsity.cc> in function
void dealii::DoFTools::make_sparsity_pattern(const DoFHandlerType&, SparsityPatternType&, const dealii::ConstraintMatrix&, bool, dealii::types::subdomain_id) [with DoFHandlerType = dealii::DoFHandler<2>; SparsityPatternType = dealii::BlockDynamicSparsityPattern; dealii::types::subdomain_id = unsigned int]
The violated condition was:
sparsity.n_rows() == n_dofs
Additional information:
Dimension 914 not equal to 1539.
Stacktrace:
-----------
#0 /mnt/dutita4/dv/jliu/Localdisk/dealii-8.5.0/lib/libdeal_II.g.so.8.5.0: void dealii::DoFTools::make_sparsity_pattern<dealii::DoFHandler<2, 2>, dealii::BlockDynamicSparsityPattern>(dealii::DoFHandler<2, 2> const&, dealii::BlockDynamicSparsityPattern&, dealii::ConstraintMatrix const&, bool, unsigned int)
#1 ./step-20: Step20::MixedLaplaceProblem<2>::make_grid_and_dofs()
#2 ./step-20: Step20::MixedLaplaceProblem<2>::run()
#3 ./step-20: main
--------------------------------------------------------
BlockDynamicSparsityPattern dsp(2, 2);
dsp.block(0, 0).reinit (n_u, n_u);
dsp.block(1, 0).reinit (n_p, n_u);
dsp.block(0, 1).reinit (n_u, n_p);
dsp.block(1, 1).reinit (n_p, n_p);
dsp.collect_sizes ();
DoFTools::make_sparsity_pattern (dof_handler, dsp);