Hi everyone,

I want to solve the coupled equations in step-21. There, the author used to DG 
methods to solve saturations equation. But I want to use Galerkin methods, 
which is FE_Q element in deal.II, to solve this equation.

I meet a question to deal with boundary conditions. It just needs to implement 
inhomogeneous Dirichlet boundary conditions for saturation, not for pressure 
and velocity. But I do not know how to do it.

I have tried to use the method like in step-22, as below:

      constraints.clear ();
      std::vector<bool> component_mask (dim+2,false);
      component_mask[dim+1] = true;
      DoFTools::make_hanging_node_constraints (dof_handler,
                                               constraints);
      VectorTools::interpolate_boundary_values (dof_handler,
                                                1,
                                                SaturationBoundaryValues<dim>(),
                                                constraints,
                                                component_mask);
    constraints.close ();

But it till failed. It showed in the screen, as:

An error occurred in line <1390> of file 
</usr/local/deal.II/include/deal.II/numerics/vectors.templates.h> in function
    void dealii::VectorTools::internal::interpolate_boundary_values(const 
dealii::Mapping<DH:: dimension, DH:: space_dimension>&, const DH&, const 
typename dealii::FunctionMap<DH:: space_dimension>::type&, std::map<unsigned 
int, double>&, const std::vector<bool>&, dealii::internal::int2type<DH:: 
dimension>) [with DH = dealii::DoFHandler<2, 2>, typename 
dealii::FunctionMap<DH:: space_dimension>::type = std::map<unsigned char, const 
dealii::Function<2>*, std::less<unsigned char>, std::allocator<std::pair<const 
unsigned char, const dealii::Function<2>*> > >]
The violated condition was:
    n_components == i->second->n_components
The name and call sequence of the exception was:
    ExcDimensionMismatch(n_components, i->second->n_components)
Additional Information:
Dimension 4 not equal to 1

So could you give me some advice on this problem?

Best regards.
S Zhang

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to