Re: [deal.II] Using affine constraints object to apply boundary condition at a vertex

2023-03-12 Thread Timo Heister
It should be as simple as doing

constraints.add_line(y);

Unless you are writing an MPI parallel program. Then you would need to
check if this line can be stored first.

-- https://www.math.clemson.edu/~heister/

On Sun, Mar 12, 2023, 09:17 Wasim Niyaz Munshi ce21d400 <
ce21d...@smail.iitm.ac.in> wrote:

> I am solving an elasticity problem wherein I have a pin support at one
> vertex. Earlier, I was using std: : map object to apply BCs. Now, I am
> trying to solve the same problem using an affine constraint object to apply
> BCs. But, I am facing issues
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> Use caution when opening links or attachments if you do not recognize the
> sender.
>
> ZjQcmQRYFpfptBannerEnd
> I am solving an elasticity problem wherein I have a pin support at one
> vertex. Earlier, I was using std::map object to apply BCs. Now, I am trying
> to solve the same problem using an affine constraint object to apply BCs.
> But, I am facing issues filling my affine constraint object with the
> information corresponding to the vertex with pin support.
>
> I was doing the following for my std::map boundary_values object:
>
> for (const auto  : dof_handler.active_cell_iterators())
> {
> for (const auto  : cell->face_iterators())
>
> for (const auto vertex_number : cell->vertex_indices())
> {
> const auto vert = cell->vertex(vertex_number);
> if (vertices satisfy the condition)
> {
>
>types::global_dof_index x=
> cell->vertex_dof_index(vertex_number, 0);
> boundary_values[x] = 0;
>
> types::global_dof_index y=
> cell->vertex_dof_index(vertex_number, 1);
> boundary_values[y] = 0;
> }
> }
>
> }
>
> What changes should I do to fill my constraint object with the same
> information?
> Thanks and regards
> Wasim Niyaz
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/932c962f-e382-4c73-9ab3-a1486b2624b4n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAMRj59GcYMsiSphMe76wGfNZcTcYVQ46HKe%2BV%2BWxtbU92YMMag%40mail.gmail.com.


Re: [deal.II] Using affine constraints object to apply boundary condition at a vertex

2023-03-12 Thread Daniel Arndt
Wasim,

Have a look at step-11 (
https://www.dealii.org/current/doxygen/deal.II/step_11.html).

Best,
Daniel

On Sun, Mar 12, 2023 at 9:17 AM Wasim Niyaz Munshi ce21d400 <
ce21d...@smail.iitm.ac.in> wrote:

> I am solving an elasticity problem wherein I have a pin support at one
> vertex. Earlier, I was using std::map object to apply BCs. Now, I am trying
> to solve the same problem using an affine constraint object to apply BCs.
> But, I am facing issues filling my affine constraint object with the
> information corresponding to the vertex with pin support.
>
> I was doing the following for my std::map boundary_values object:
>
> for (const auto  : dof_handler.active_cell_iterators())
> {
> for (const auto  : cell->face_iterators())
>
> for (const auto vertex_number : cell->vertex_indices())
> {
> const auto vert = cell->vertex(vertex_number);
> if (vertices satisfy the condition)
> {
>
>types::global_dof_index x=
> cell->vertex_dof_index(vertex_number, 0);
> boundary_values[x] = 0;
>
> types::global_dof_index y=
> cell->vertex_dof_index(vertex_number, 1);
> boundary_values[y] = 0;
> }
> }
>
> }
>
> What changes should I do to fill my constraint object with the same
> information?
> Thanks and regards
> Wasim Niyaz
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/932c962f-e382-4c73-9ab3-a1486b2624b4n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAOYDWbKxTZ4raz%2BShKajZKXVbknaq-b8uLYmGz%2BVJ0pyyf4VRg%40mail.gmail.com.


[deal.II] Using affine constraints object to apply boundary condition at a vertex

2023-03-12 Thread Wasim Niyaz Munshi ce21d400
I am solving an elasticity problem wherein I have a pin support at one 
vertex. Earlier, I was using std::map object to apply BCs. Now, I am trying 
to solve the same problem using an affine constraint object to apply BCs. 
But, I am facing issues filling my affine constraint object with the 
information corresponding to the vertex with pin support.

I was doing the following for my std::map boundary_values object:

for (const auto  : dof_handler.active_cell_iterators())
{
for (const auto  : cell->face_iterators())

for (const auto vertex_number : cell->vertex_indices())
{
const auto vert = cell->vertex(vertex_number);
if (vertices satisfy the condition)
{

   types::global_dof_index x=
cell->vertex_dof_index(vertex_number, 0);
boundary_values[x] = 0;
types::global_dof_index 
y=
cell->vertex_dof_index(vertex_number, 1);
boundary_values[y] = 0; 
}
}

}

What changes should I do to fill my constraint object with the same 
information?
Thanks and regards
Wasim Niyaz

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/932c962f-e382-4c73-9ab3-a1486b2624b4n%40googlegroups.com.