Thank you for your quick replay. It seems like the way I assigned the condition in if ("certain condition") was not appropriate, and neither do the boundary conditions. That was the reason the matrix was invertible. After fixing that, it looks working well now.
Best. Sogo On Sunday, March 19, 2017 at 9:55:09 AM UTC-5, Wolfgang Bangerth wrote: > > > > I assign such a boundary condition at points by giving boundary values > > to std::map<unsigned int,double> boundary_values directly, and it looks > > working well. > > Yes, this is the correct approach. > > > > However, for handling conflict between hanging node and > > boundary condition with ConstraintMatrix, just doing something like: > > > > typenameDoFHandler<dim>::active_cell_iterator cell = > dof_handler.begin_active(), > > > > endc = > > dof_handler.end(); > > > > for(; cell!=endc; ++cell) > > > > { > > > > for(unsignedintvert = 0; vert < > GeometryInfo<dim>::vertices_per_cell; vert++) > > > > { > > > > if("certain condition") > > > > { > > > > > constraints_update.add_line(cell2->vertex_dof_index(vert,I)); > > > > } > > > > } > > > > } > > > > > > (Here constraints_update is an object of ConstraintMatrix). > > > > does not seem working because the solver eventually gives the error: > > [...] > > Well, that means that your matrix is probably not invertible (although the > residual does get pretty small -- are you sure you don't just need more > iterations?). This *may* be because of your constraints, but it may also > be > because of any number of other reasons. Have you tried this on a small > problem, say a 2x2 or 3x3 mesh, to make sure it really is because of the > constraints? For small problems, you can often figure out on a piece of > paper > what the matrix should be, and compare with what you get from your > program. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > <javascript:> > 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. For more options, visit https://groups.google.com/d/optout.