Wasim,
I imagine you are calling your setup_boundary_values() function before you call dof_handler.distribute_dofs()?
Best
 W.

On 10/11/22 05:16, Wasim Niyaz Munshi ce21d400 wrote:
*** Caution: EXTERNAL Sender ***

I was using a constraint object to apply the boundary conditions and component mask to deal with hanging nodes and apply x and y displacements separately. Now, I want to solve an elasticity problem on a unit square wherein I want to apply a displacement in y direction on top face and have a pin and roller support at lower left and right node respectively.
I tried to do this as follows:
1. I used the constraint object to apply displacement in y direction on top 
face.
2. I created a std::map boundary_values object to enforce a pin and roller support bc at lower left and right node respectively. I took a look at step79. They seem to have similar dirichlet bc at the bottom but apply a neumann bc at the top. I followed a similar procedure to have a pin and roller bc at lower left and right node respectively(using the setup_boundary_values class as they have done).


My code throws the following error:
An error occurred in line <324> of file </home/wasim/dealii-candi/deal.II-v9.4.0/include/deal.II/dofs/dof_accessor.templates.h> in function     static void dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index(const dealii::DoFHandler<dim, spacedim>&, unsigned int, unsigned int, unsigned int, unsigned int, const std::integral_constant<int, structdim>&, GlobalIndexType&, const DoFPProcessor&) [with int dim = 2; int spacedim = 2; int structdim = 0; GlobalIndexType = unsigned int; DoFPProcessor = dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 2, 0>::<lambda(const auto:9&, auto:10&)>]
The violated condition was:
    ::dealii::deal_II_exceptions::internals::compare_less_than(obj_level, dof_handler.object_dof_indices.size())
Additional information:
     Index 0 is not in the half-open range [0,0). In the current case, this
     half-open range is in fact empty, suggesting that you are accessing an
     element of an empty collection such as a vector that has not been set
     to the correct size.

Stacktrace:
-----------
#0  ./step-103: void dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index<2, 2, 0, unsigned int, dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned int, unsigned int, std::integral_constant<int, 0> const&)::{lambda(auto:1 const&, auto:2&)#1}>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned int, unsigned int, std::integral_constant<int, 0> const&, unsigned int&, dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned int, unsigned int, std::integral_constant<int, 0> const&)::{lambda(auto:1 const&, auto:2&)#1} const&) #1  ./step-103: unsigned int dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned int, unsigned int, std::integral_constant<int, 0> const&) #2  ./step-103: dealii::DoFAccessor<2, 2, 2, false>::vertex_dof_index(unsigned int, unsigned int, unsigned int) const
#3  ./step-103: step103::ElasticProblem::setup_boundary_values()
#4  ./step-103: step103::ElasticProblem::run()
#5  ./step-103: main
--------------------------------------------------------

make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] Aborted (core dumped)
make[2]: *** [CMakeFiles/Makefile2:116: CMakeFiles/run.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:137: run] Error 2
 Is it because I am applying Dirichlet bc using two objects, constraints and boundary_values?


Thank you



On Mon, Oct 10, 2022 at 7:28 PM Wolfgang Bangerth <bange...@colostate.edu <mailto:bange...@colostate.edu>> wrote:

    On 10/10/22 07:42, Wasim Niyaz Munshi ce21d400 wrote:
     > I am trying to solve the elasticity equation on a square domain
    (similar to
     > step 8).
     > For the patch test I am using just one element.
     > I am having problems with the application of boundary conditions.
     > I want to fix the lower left node in both x and y, and also fix the lower
     > right node in y.
     > The lower right node is free to move in x.
     > The problem I am facing is that both these nodes are on the same face,
    and I
     > do not know how to specify different values of x displacement for the 2
    nodes
     > of the same face.
     >
     > Is there a way to set boundary id to a node rather than to a face?

    No -- principally because from a mathematical perspective, you can only set
    boundary indicators on parts of the boundary that have (d-1) dimensional
    measure larger than zero. Vertices do not satisfy this.

    But it is a common thing to do anyway. You might want to look at the step-79
    that does something similar.

    Best
       W>


-- ------------------------------------------------------------------------
    Wolfgang Bangerth          email: bange...@colostate.edu
    <mailto:bange...@colostate.edu>
                                 www: http://www.math.colostate.edu/~bangerth/
    <http://www.math.colostate.edu/~bangerth/>

-- The deal.II project is located at http://www.dealii.org/
    
<https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dealii.org%2F&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048599291%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GczFY9xgCuNhKCygAdQqZMzE3pQtDVR%2BJunoKQQyndQ%3D&reserved=0>
    For mailing list/forum options, see
    https://groups.google.com/d/forum/dealii?hl=en
    
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fforum%2Fdealii%3Fhl%3Den&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Al7MfSTwuuRHdmniebbLxp4ugBaX1ddbBdlldSxuX5o%3D&reserved=0>
    ---
    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/jI31ro8W_Cg/unsubscribe
    
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Ftopic%2Fdealii%2FjI31ro8W_Cg%2Funsubscribe&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=u7Mxyrfrhc1DwitmIF%2BiRyqv2syo1cseWqCO%2Bsvnoyc%3D&reserved=0>.
    To unsubscribe from this group and all its topics, send an email to
    dealii+unsubscr...@googlegroups.com
    <mailto:dealii%2bunsubscr...@googlegroups.com>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/dealii/64772c85-044f-3492-5895-b1d6ac398b0f%40colostate.edu
    
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdealii%2F64772c85-044f-3492-5895-b1d6ac398b0f%2540colostate.edu&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gE%2B7eZCtkI2CnOoTmXDBuSrLav%2FLa1PmFvtYv2EIDW8%3D&reserved=0>.

--
The deal.II project is located at http://www.dealii.org/ <https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dealii.org%2F&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eJu3T7DEwblMZTdI3vLLnxO2RfznkOCeZEj8k2rSKPY%3D&reserved=0> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fforum%2Fdealii%3Fhl%3Den&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Al7MfSTwuuRHdmniebbLxp4ugBaX1ddbBdlldSxuX5o%3D&reserved=0>
---
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 <mailto:dealii+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAM8ps5DTY_KXs7MZq%2B_zaW0aB2JemWgJ4SLf3dEow%3D_eqDYutA%40mail.gmail.com <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdealii%2FCAM8ps5DTY_KXs7MZq%252B_zaW0aB2JemWgJ4SLf3dEow%253D_eqDYutA%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C861d8e11d32747990c3308daab7a1301%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638010838048755540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WOjaRCuN9KlVtE1fGxNdAwQ3U0z4x%2FWG4oQ4kGrjWBQ%3D&reserved=0>.


--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           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 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/b1a9fa0b-2505-c786-c24b-e98d63ea4aa0%40colostate.edu.

Reply via email to