Hi all,

I am having a little problem with projecting a function onto (parts of) FE 
spaces. I am getting the error

The violated condition was:  
   (dynamic_cast<const parallel::Triangulation<dim> *>( 
&(dof.get_triangulation())) == nullptr) 
Additional information:  
   You are trying to use functionality in deal.II that is currently not 
implemented. In many cases, this indicates that there simply didn't appear 
much of a need for 
it, or that the author of the original code did not have the time to 
implement a particular case. If you hit this exception, it is therefore 
worth the time to look int
o the code to find out whether you may be able to implement the missing 
functionality. If you do, please consider providing a patch to the deal.II 
development sources 
(see the deal.II website on how to contribute).

I of course get what this error message suggests and I am wondering if I 
could fix this somehow. The funny thing is that when I step through the 
code in debug mode I see that exactly the cast above fails. Funnily, the 
cast dynamic_cast<const parallel::Triangulation<dim,dim> *>( 
&(dof.get_triangulation())) works. 

Now I am asking myself why?  Am I missing something here?

Best regards,
Konrad


This is my function:

{
        TrilinosWrappers::MPI::BlockVector locally_relevant_exact_solution;
locally_relevant_exact_solution.reinit(owned_partitioning,
mpi_communicator);

{ // write sigma to Nedelec_0 space

// Quadrature used for projection
QGauss<3> quad_rule (3);

// Setup function
ExactSolutionLin_A_curl exact_sigma(parameter_filename); // Exact solution 
for first FE ---> Nedelec FE

DoFHandler<3> dof_handler_fake (triangulation);
dof_handler_fake.distribute_dofs (fe.base_element(0));

if (parameters.renumber_dofs)
{
DoFRenumbering::Cuthill_McKee (dof_handler_fake);
}

AffineConstraints<double> constraints_fake;
constraints_fake.clear ();
DoFTools::make_hanging_node_constraints (dof_handler_fake, 
constraints_fake);
constraints_fake.close();

VectorTools::project (dof_handler_fake,
constraints_fake,
quad_rule,
exact_sigma,
locally_relevant_exact_solution.block(0));

dof_handler_fake.clear ();
}

{// write u to Raviart-Thomas_0 space

// Quadrature used for projection
QGauss<3> quad_rule (3);

// Setup function
ExactSolutionLin exact_u(parameter_filename); // Exact solution for second 
FE ---> Raviart-Thomas FE

DoFHandler<3> dof_handler_fake (triangulation);
dof_handler_fake.distribute_dofs (fe.base_element(1)); 

if (parameters.renumber_dofs)
{
DoFRenumbering::Cuthill_McKee (dof_handler_fake);
}

AffineConstraints<double> constraints_fake;
constraints_fake.clear ();
DoFTools::make_hanging_node_constraints (dof_handler_fake, 
constraints_fake);
constraints_fake.close();

VectorTools::project (dof_handler_fake,
constraints_fake,
quad_rule,
exact_u,
locally_relevant_exact_solution.block(1));

dof_handler_fake.clear ();
}
}

-- 
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/7a66b73f-4fe3-449f-b0ba-c4b16e8fbca3%40googlegroups.com.

Reply via email to