Doubt with set_boundary_id()

42 views
Skip to first unread message

RAJAT ARORA

unread,
Dec 8, 2016, 12:50:45 AM12/8/16
to deal.II User Group
Hello all,

I am using deal.ii to solve  a 3D solid mechanics problem which uses Parallel::Distributed::Triangulation.

I have a question related to setting the boundary indicators on the triangulation when no automatic partitioning is allowed.

To set the boundary ids,

1) Should I only loop over active_cells (triangulation.begin_active() to triangulation.end()) or all cells (triangulation.begin() to triangulation.end()) ?

2) Should the boundary ids be set only for locally_owned_cells or for all cells (locally_owned + ghost )  ?


Thanks.

Wolfgang Bangerth

unread,
Dec 8, 2016, 9:01:49 AM12/8/16
to dea...@googlegroups.com
You need to set boundary_ids for at least locally owned and ghost cells. But
there is no harm setting them for all cells, so I might just go with 1/ above.

It's easiest to set them for *all* cells (not just the active ones) because
then boundary ids can be inherited upon mesh refinement from parent face to
child face.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

RAJAT ARORA

unread,
Dec 8, 2016, 11:25:49 PM12/8/16
to deal.II User Group, bang...@colostate.edu
Hello Professor,

Thanks for your reply.

I am actually doing what you suggested but still I am getting error (Assertion) in the debug mode.
I am setting boundary ids for all the cells (not just active) which are either locally_owned or ghost. 
The assertion is triggered in the compute_no_normal_flux_conditions.

I have made a minimal test case to demonstrate this.
Kindly look at the code attached. 

Also, the mesh is read from a mesh.ucd file using read_ucd function from grid in class.

Thanks.
main.cc
mesh.ucd
CMakeLists.txt

RAJAT ARORA

unread,
Dec 8, 2016, 11:26:49 PM12/8/16
to deal.II User Group, bang...@colostate.edu
I am posting the error here.

--------------------------------------------------------
An error occurred in line <5594> of file </home/rajat/Documents/Code-Libraries/deal/dealii8.3/dealii-8.3.0/include/deal.II/numerics/vector_tools.templates.h> in function
   
void dealii::VectorTools::compute_nonzero_normal_flux_constraints(const DH<dim, spacedim>&, unsigned int, const std::set<unsigned char>&, typename dealii::FunctionMap<spacedim>::type&, dealii::ConstraintMatrix&, const dealii::Mapping<dim, spacedim>&) [with int dim = 3; DH = dealii::DoFHandler; int spacedim = 3; typename dealii::FunctionMap<spacedim>::type = std::map<unsigned char, const dealii::Function<3, double>*, std::less<unsigned char>, std::allocator<std::pair<const unsigned char, const dealii::Function<3, double>*> > >]
The violated condition was:
    cell_to_normals_map
.size() == 1
The name and call sequence of the exception was:
   
ExcInternalError()
Additional Information:
This exception -- which is used in many places in the library -- usually indicates that some condition which the author of the code thought must be satisfied at a certain point in an algorithm, is not fulfilled. An example would be that the first part of an algorithm sorts elements of an array in ascending order, and a second part of the algorithm later encounters an an element that is not larger than the previous one.


There is usually not very much you can do if you encounter such an exception since it indicates an error in deal.II, not in your own program. Try to come up with the smallest possible program that still demonstrates the error and contact the deal.II mailing lists with it to obtain help.


Stacktrace:
-----------
#0  /home/rajat/Documents/Code-Libraries/deal/dealii8.3/installed-dealii/lib/libdeal_II.g.so.8.3.0: void dealii::VectorTools::compute_nonzero_normal_flux_constraints<3, dealii::DoFHandler, 3>(dealii::DoFHandler<3, 3> const&, unsigned int, std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> > const&, dealii::FunctionMap<3, double>::type&, dealii::ConstraintMatrix&, dealii::Mapping<3, 3> const&)
#1  /home/rajat/Documents/Code-Libraries/deal/dealii8.3/installed-dealii/lib/libdeal_II.g.so.8.3.0: void dealii::VectorTools::compute_no_normal_flux_constraints<3, dealii::DoFHandler, 3>(dealii::DoFHandler<3, 3> const&, unsigned int, std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> > const&, dealii::ConstraintMatrix&, dealii::Mapping<3, 3> const&)
#2  ./fdm: BugFinder<3>::BugFinder(int)
#3  ./fdm: main
--------------------------------------------------------

RAJAT ARORA

unread,
Dec 9, 2016, 7:38:09 PM12/9/16
to deal.II User Group, bang...@colostate.edu
Hello Professor,

The problem was because of the mesh. I regenerated the mesh and this time there is no such issue that arises. 
I think the options used to export and make the mesh earlier were wrong.

Thanks for your help again.
Reply all
Reply to author
Forward
0 new messages