Thank You.
I went through the documentations and realized that in step 8 Dirichlet
boundary conditions are being applied using the constraint object. Hence,
we only need to pass the constraint object to
VectorTools::interpolate_boundary_values. No need to pass the
'boundary_values' std::map object.
I made that change as follows:
FEValuesExtractors::Scalar u_x(0);
FEValuesExtractors::Scalar u_y(1);
ComponentMask u_x_mask = fe.component_mask(u_x);
ComponentMask u_y_mask = fe.component_mask(u_y);
double u_x_values = 1.2;
double u_y_values = 0.0;
VectorTools::interpolate_boundary_values(dof_handler,
0,
Functions::ZeroFunction<dim>(dim),
constraints); //imposing both
u_x and u_y to be zero on boudaries with id=0
VectorTools::interpolate_boundary_values(dof_handler,
1,
Functions::ConstantFunction<dim>(dim)(u_x_values,2),constraints,u_x_mask);
//imposing u_x=1.2 on
boudaries with id=1
VectorTools::interpolate_boundary_values(dof_handler,
1,
Functions::ConstantFunction<dim>(dim)(u_y_values,2),constraints,u_y_mask
);//imposing u_y=0 on
boudaries with id=1
Now, it gives the following error:
error: no match for call to ‘(dealii::Functions::ConstantFunction<2,
double>) (double&, int)’
Functions::ConstantFunction<dim>(dim)(u_x_values,dim),constraints,u_x_mask);
It gives the same error for u_y also.
On Mon, Sep 19, 2022 at 3:09 AM Wolfgang Bangerth <[email protected]>
wrote:
> On 9/18/22 06:51, Wasim Niyaz Munshi ce21d400 wrote:
> > VectorTools::interpolate_boundary_values(dof_handler,
> > 1,
> >
> Functions::ConstantFunction<dim>(dim)(u_y_values,2),boundary_values,u_y_mask,
> > constraints);
>
> You are providing both the 'boundary_values' std::map object, and the
> 'constraints' AffineConstraints object. There are two versions of this
> function, one for each kind, but you can only provide one of these objects
> to
> each.
>
> Best
> W.
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.colostate.edu/~bangerth/
>
> --
> 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/jEO3kQ-d9Cg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/408279cc-c18c-9526-8931-705ddd7c6b12%40colostate.edu
> .
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/CAM8ps5AHaNgLDun5optaTf_JhFqQ6-_R9Jx-rCiUQuhVTfLh-g%40mail.gmail.com.