Dear fellow dealii users (and developers),

I think I ran into another bug here, but there is always the possibilty 
that I just tried to do something stupid. Therefore, before I post this on 
GitHub, I'd like someone who knows what he/she is doing to have a look at 
that.
Outline of the Problem: Use Nedelec Elements to compute time-harmonic 
Maxwell's Equation in 2D on a circle, with the Boundary condition of 
vanishing normal component (that actually holds true for the magnetic 
B-field on the surface of perfect electric conductor). The boundary 
conditions compute_no_normal_flux_constraint(...) cannot be applied, 
yielding the error at the end of the mail. A minimal-ish example of just 
the constructor of the problem is attached.

Some additional information: If I use, instead of Nedelec's element, an 
FESystem fe(FE_Q<dim>(1),2), the programm runs through the initialisation 
process, but the solver does not converge (of the few commented lines in 
the code example, there are two that you have to activate to see this).

Another question: if I use a spherical manifold for the boundary before 
global refinement, and try to set up the system with the working FESystem 
composite element, the function compute_no_normal_flux_constraints crashes 
as well, telling me that "I gave it a manifold instead of boundaries". I 
don't understand how to handle that. In this case, I hope a short code 
snippet is enough:

    GridGenerator::hyper_ball(triangulation);
    static const SphericalManifold<dim> bound;
    triangulation.set_all_manifold_ids_on_boundary(1);
    triangulation.set_manifold(1,bound);
    triangulation.refine_global(3);
    dof_handler.distribute_dofs(fe);
    std::set<types::boundary_id> bd_id;
    bd_id.insert(0);
    
VectorTools::compute_no_normal_flux_constraints(dof_handler,0,bd_id,constraints);

Any Ideas?

Thank you in advance!

Felix Schwarz

An error occurred in line <5270> of file 
</build/deal.ii-MRHzH9/deal.ii-8.4.2/include/deal.II/numerics/vector_tools.templates.h>
 
in function
    void dealii::VectorTools::compute_nonzero_normal_flux_constraints(const 
DoFHandlerType<dim, spacedim>&, unsigned int, const std::set<unsigned 
char>&, typename dealii::FunctionMap<spacedim>::type&, 
dealii::ConstraintMatrix&, const dealii::Mapping<dim, spacedim>&) [with int 
dim = 2; DoFHandlerType = dealii::DoFHandler; int spacedim = 2; typename 
dealii::FunctionMap<spacedim>::type = std::map<unsigned char, const 
dealii::Function<2, double>*, std::less<unsigned char>, 
std::allocator<std::pair<const unsigned char, const dealii::Function<2, 
double>*> > >]
The violated condition was: 
    unit_support_points.size() == fe_collection[i].dofs_per_face
The name and call sequence of the exception was:
    ExcInternalError()
Stacktrace:
-----------
#0  /usr/lib/x86_64-linux-gnu/libdeal.ii.g.so.8.4.2: void 
dealii::VectorTools::compute_nonzero_normal_flux_constraints<2, 
dealii::DoFHandler, 2>(dealii::DoFHandler<2, 2> const&, unsigned int, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned 
char> > const&, dealii::FunctionMap<2, double>::type&, 
dealii::ConstraintMatrix&, dealii::Mapping<2, 2> const&)
#1  /usr/lib/x86_64-linux-gnu/libdeal.ii.g.so.8.4.2: void 
dealii::VectorTools::compute_no_normal_flux_constraints<2, 
dealii::DoFHandler, 2>(dealii::DoFHandler<2, 2> const&, unsigned int, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned 
char> > const&, dealii::ConstraintMatrix&, dealii::Mapping<2, 2> const&)
#2  ./Microwave_Resonator: 
MR_fesc::EigenvalueProblem<2>::make_grid_and_dofs()
#3  ./Microwave_Resonator: MR_fesc::EigenvalueProblem<2>::run()
#4  ./Microwave_Resonator: main
--------------------------------------------------------

-- 
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.
For more options, visit https://groups.google.com/d/optout.
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_nedelec.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/numerics/vector_tools.h>
#include <deal.II/grid/manifold_lib.h>
#include <set>
#include <fstream>
#include <iostream>

namespace MR_fesc{
  using namespace dealii;
  template<int dim>
  class EigenvalueProblem{
  public:
    EigenvalueProblem();
  private:
    Triangulation<dim> triang;
    FE_Nedelec<dim> fe;
    //FESystem<dim> fe; //using this actually works, but delivers no solution in the Eigenvalue solver later on
    DoFHandler<dim> dof_h;

    ConstraintMatrix constraints;
  };

  template<int dim>
  EigenvalueProblem<dim>::EigenvalueProblem():
    fe(1),dof_h(triang)
    //fe(FE_Q<dim>(1),2),dof_h(triang) //use this with FE_systems
  {
    GridGenerator::hyper_ball(triang); //default radius 1 around 0,0
    //static const SphericalManifold<dim> bound;
    //triang.set_all_manifold_ids_on_boundary(1);
    //triang.set_manifold(1,bound);
    //triang.refine_global(3);
    dof_h.distribute_dofs(fe);
    std::set<types::boundary_id> bd_id;
    bd_id.insert(0);
    VectorTools::compute_no_normal_flux_constraints
      (dof_h,0,bd_id,constraints);
    constraints.close();
  }
}

int main(){
  using namespace MR_fesc;
  using namespace dealii;

  EigenvalueProblem<2> prob;
  return 0;
}

Reply via email to