Dear Bruno,

I would like to somehow pass the boundary indicator to the boundary value 
function.
I don't know if it is possible to write *boundary_values(0) or not?
I want to do something like below code, but I don't know how to write it 
correctly:

template <int dim>
    void
    Solver<dim>::*assemble_linear_system *(LinearSystem &linear_system)
    {
        ....
        VectorTools::interpolate_boundary_values (dof_handler,
                                                                      0,
                                                                     
**boundary_values(0),*
                                                                     
boundary_value_map);

        VectorTools::interpolate_boundary_values (dof_handler,
                                                                      1,
                                                                      
**boundary_values(1),*
                                                                      
boundary_value_map);
        ...  
    }  


template<int dim>
    void* My_Case_2*<dim>::*BoundaryValues::vector_value*(const Point<dim> 
&p,
                
                                                                    
Vector<double> &values) const
    {
        ...
        if (boundary_indicator == 0) {
           BC = p(0) + p(1);
        } else if (boundary_indicator == 1) {
           BC = p(0)*p(0) + p(1);
        } 
        ...
    }
              
Thanks.
Elena



On Tuesday, May 16, 2017 at 4:48:05 PM UTC+2, Bruno Turcksin wrote:
>
> Elena, 
>
> I am not sure I understand exactly what you want to do. Can you write 
> a simple pseudo code to show the problem? The way I understand what 
> you want to do, you need to replace interpolate_boundary_values 
> function from step 13 & 14 (which allows you to use only one BC) and 
> instead used the one that I showed you which uses a map. Yous also 
> need to add a function that fills this map and where you do the switch 
> between the different cases. This way assemble_linear_system is still 
> general and everything is encapsulated in the filling function. 
>
> Best, 
>
> Bruno 
>
> 2017-05-16 10:31 GMT-04:00 Elena Greco <elena.gr...@gmail.com 
> <javascript:>>: 
> > Dear Bruno 
> > Thanks for your reply. 
> > 
> > I know how to use interpolate_boundary_values but in steps 13 & 14, if I 
> > want to keep Solver<dim>::assemble_linear_system in the general form, I 
> > don't know how to implement new boundary conditions. 
> > 
> > In steps 13 & 14, Solver<dim>::assemble_linear_system assembles the 
> linear 
> > system and implements BC for primal and dual problems of several cases 
> like 
> > CurvedRidges, Exercise_2_3, and three new cases which I have added. I do 
> not 
> > want to change Solver<dim>::assemble_linear_system, and I want to keep 
> it in 
> > general form and I only want to modify template <int dim> double 
> > My_case_2<dim>::BoundaryValues::value(...) 
> > 
> > Thanks. 
> > Elena 
> > 
> > 
> > 
> > 
> > 
> > On Tuesday, May 16, 2017 at 2:21:58 PM UTC+2, Bruno Turcksin wrote: 
> >> 
> >> Elena, 
> >> 
> >> On Tuesday, May 16, 2017 at 7:19:08 AM UTC-4, Elena Greco wrote: 
> >>> 
> >>> May be it would be better to edit my question and remove the 
> "cylinder" 
> >>> part, but I do not have access to modify the question. 
> >>> Please consider my question for a general case of a geometry with 
> >>> multiple boundary indicators and different BCs on them. 
> >> 
> >> You should first tag the boundaries with boundary indicators and then 
> use 
> >> 
> http://dealii.org/8.5.0/doxygen/deal.II/group__constraints.html#gaa96810fcf5053e0bf08785aa53bfd6cc
>  
> >> The map associates a boundary ID to a function and you can have as many 
> >> functions as you want. 
> >> 
> >> Best, 
> >> 
> >> Bruno 
> > 
> > -- 
> > 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 a topic in the 
> > Google Groups "deal.II User Group" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/dealii/Nt9BTAyX6Pk/unsubscribe. 
> > To unsubscribe from this group and all its topics, send an email to 
> > dealii+un...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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.

Reply via email to