I have a system with three 3d-variables, and would like to apply different 
boundary conditions on the constraint matrix, depending on the variable. 
According to the examples I have to create my own function:

template <int dim>
    class BoundaryValues : public Function<dim>
    {
    private:
        equation_class eq_class;
        physics_equations equations;
    public:
        BoundaryValues(equation_class equ_class) : eq_class(equ_class), 
Function<dim>(dim) {}
        virtual double value(const Point<dim> &p, const unsigned int 
component) const;
        virtual void vector_value(const Point<dim> &p, Vector<double> &
values) const;
    };

    template <int dim>
    double BoundaryValues<dim>::value(const Point<dim> &p, const unsigned 
int component) const
    {
        (void) component;
        Assert(component < this->n_components, ExcIndexRange(component, 0, 
this->n_components));
        if(eq_class == carrier_density)
            return equations.initial_carrier_density;//Boundary condition 
is that we have the initial carrier density in the crystal
        else
            return equations.ambient_temperature;//Boundary condition is 
that we have ambient temperature in the surrounding crystal
    }

    template <int dim>
    void BoundaryValues<dim>::vector_value(const Point<dim> &p, Vector
<double> &values) const
    {
        for(size_t i = 0; i < this->n_components; ++i)
            values(i) = BoundaryValues<dim>::value(p, i);
    }



but how do I tell that in 
VectorTools::interpolate_boundary_values(dof_handler,1,BoundaryValues<3*dim
>(),constraint_matrix);


?

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to