Dear Jean-Paul,
 

> Yes, this looks like a copy-paste error in the documentation. Would you 
> like to submit a patch to correct it? 
>

Sure. How and where can I submit a patch?  

When you refine cells at a boundary, the child cell's faces will inherit 
> the boundary and manifold ID's of the parent cells regardless of whether 
> the mesh was read in or created using the GridGenerator functions. 
>

But according to the documentation this is only true for sequential 
triangulations and not for distributed triangulations. It is more safe to 
update boundary IDs while the 
distributed::parallel::Triangulation::execute_coarsening_and_refinement 
function is running.

I cite: 

This is not necessary for sequential triangulations because, there, these 
flags are inherited from mother to child cell and remain with a cell even if 
it is refined and the children are later coarsened again, but this does not 
hold for distributed triangulations.

 See: 
https://www.dealii.org/developer/doxygen/deal.II/classparallel_1_1distributed_1_1Triangulation.html

There is a slight problem using the approach written there. I am trying to 
compile the following:

triangulation.signals.post_refinement.connect(std_cxx11::bind(&
SolidMechanics<dim>::set_boundary_ids, std_cxx11::cref(*this), std_cxx11::
ref(triangulation)));

Then I receive the following compilation error:

/usr/include/c++/5/functional(1426): error: static assertion failed with 
"Wrong number of arguments for pointer-to-member"
        static_assert(_Varargs::value
        ^
          detected during:
            instantiation of class "std::_Bind_check_arity<_Tp _Class::*, 
_BoundArgs...> [with _Tp=void (), _Class=SolidMechanics<2>, 
_BoundArgs=<std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>>]" at line 1440
            instantiation of class "std::_Bind_helper<_SocketLike, _Func, 
_BoundArgs...> [with _SocketLike=false, _Func=void 
(SolidMechanics<2>::*)(), _BoundArgs=<std::reference_wrapper<const 
SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>>]" at line 787 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void SolidMechanics<dim>::create_geometry() 
[with dim=2]" at line 544 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void 
SolidMechanics<dim>::do_initial_timestep() [with dim=2]" at line 1440 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void SolidMechanics<dim>::run() [with dim=2]" 
at line 1472 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"

/home/seyedali/programming/c++/libraries/boost-1.62.0/include/boost/function/function_template.hpp(159):
 
error: no instance of overloaded function "std::_Bind<_Functor 
(_Bound_args...)>::operator() [with _Functor=std::_Mem_fn<void 
(SolidMechanics<2>::*)()>, _Bound_args=<std::reference_wrapper<const 
SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>>]" matches the argument list
            object type is: std::_Bind<std::_Mem_fn<void 
(SolidMechanics<2>::*)()> (std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 2>>)>
            BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
            ^
/usr/include/c++/5/functional(1171): note: this candidate was rejected 
because at least one template argument could not be deduced
  operator()(_Args&&... __args) const volatile
  ^
/usr/include/c++/5/functional(1157): note: this candidate was rejected 
because at least one template argument could not be deduced
  operator()(_Args&&... __args) volatile
  ^
/usr/include/c++/5/functional(1143): note: this candidate was rejected 
because at least one template argument could not be deduced
  operator()(_Args&&... __args) const
  ^
/usr/include/c++/5/functional(1129): note: this candidate was rejected 
because at least one template argument could not be deduced
  operator()(_Args&&... __args)
  ^
          detected during:
            instantiation of "void 
boost::detail::function::void_function_obj_invoker0<FunctionObj, 
R>::invoke(boost::detail::function::function_buffer &) [with 
FunctionObj=std::_Bind<std::_Mem_fn<void (SolidMechanics<2>::*)()> 
(std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>, R=void]" at line 936
            instantiation of "void boost::function0<R>::assign_to(Functor) 
[with R=void, Functor=std::_Bind<std::_Mem_fn<void 
(SolidMechanics<2>::*)()> (std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 727
            instantiation of "boost::function0<R>::function0(Functor, 
boost::enable_if_c<<expression>, int>::type) [with R=void, 
Functor=std::_Bind<std::_Mem_fn<void (SolidMechanics<2>::*)()> 
(std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 1073
            instantiation of "boost::function<R ()>::function(Functor, 
boost::enable_if_c<<expression>, int>::type) [with R=void, 
Functor=std::_Bind<std::_Mem_fn<void (SolidMechanics<2>::*)()> 
(std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 1125
            instantiation of "boost::enable_if_c<<expression>, 
boost::function<R ()>::self_type &>::type boost::function<R 
()>::operator=(Functor) [with R=void, Functor=std::_Bind<std::_Mem_fn<void 
(SolidMechanics<2>::*)()> (std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 160 of 
"/home/seyedali/programming/c++/libraries/boost-1.62.0/include/boost/signals2/detail/slot_template.hpp"
            instantiation of "void boost::signals2::slot<R (Args...), 
SlotFunction>::init_slot_function(const F &) [with 
SlotFunction=boost::function<void ()>, R=void, Args=<>, 
F=std::_Bind<std::_Mem_fn<void (SolidMechanics<2>::*)()> 
(std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 85 of 
"/home/seyedali/programming/c++/libraries/boost-1.62.0/include/boost/signals2/detail/slot_template.hpp"
            instantiation of "boost::signals2::slot<R (Args...), 
SlotFunction>::slot(const F &) [with SlotFunction=boost::function<void ()>, 
R=void, Args=<>, F=std::_Bind<std::_Mem_fn<void (SolidMechanics<2>::*)()> 
(std::reference_wrapper<const SolidMechanics<2>>, 
std::reference_wrapper<dealii::parallel::distributed::Triangulation<2, 
2>>)>]" at line 787 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void SolidMechanics<dim>::create_geometry() 
[with dim=2]" at line 544 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void 
SolidMechanics<dim>::do_initial_timestep() [with dim=2]" at line 1440 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"
            instantiation of "void SolidMechanics<dim>::run() [with dim=2]" 
at line 1472 of 
"/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc"

compilation aborted for 
/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc (code 2)
make[2]: *** [CMakeFiles/solid_mechanics.dir/solid_mechanics.cc.o] Fehler 2
make[1]: *** [CMakeFiles/solid_mechanics.dir/all] Fehler 2
CMakeFiles/solid_mechanics.dir/build.make:62: die Regel für Ziel 
„CMakeFiles/solid_mechanics.dir/solid_mechanics.cc.o“ scheiterte
make: *** [all] Fehler 2
CMakeFiles/Makefile2:195: die Regel für Ziel 
„CMakeFiles/solid_mechanics.dir/all“ scheiterte
Makefile:83: die Regel für Ziel „all“ scheiterte

I already tried using std::bind by including the <functional> library 
instead of #include <deal.II/base/std_cxx11/bind.h> , but it also won't 
compile correctly. 

Maybe there is something missing in the connect function?

Kind regards,
Seyed Ali


-- 
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.

Reply via email to