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