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> 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 > 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/jI31ro8W_Cg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > dealii+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/64772c85-044f-3492-5895-b1d6ac398b0f%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 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.