The problem was with the fe object.. 
The way I went around it was to declare it as a static class member 

static FE_Q<dim>  fe;

....

template <int dim>

FE_Q<dim> Helmholtz_GFE2<dim>::fe(1);


The other solution that worked as well was to create the pointers directly 
in the constructor with "new"

fe_enriched

(

    new FE_Q<dim> (1),

    { new FE_Q<dim> (1)},

                {

                    {

                     [=] (const typename Triangulation<dim>::cell_iterator &) 
-> 

                          const Function<dim> * {return & enrich1;},

                     [=] (const typename Triangulation<dim>::cell_iterator &) 
-> 

                          const Function<dim> * {return & enrich2;}

                    }

                }

             ),


If you have a better suggestion I will be happy to hear. 

Edith



On Friday, February 3, 2017 at 8:34:25 AM UTC-6, Denis Davydov wrote:
>
> Hi Edith,
>
> I would certainly run in debugger to see what’s going on.
> From the code you show, it looks like you initialize your functions 
> **after** you actually pass them to constructor of FE_Enriched.
> To be on the safe side, i would move those above.
>
> Cheers,
> Denis.
>
>
> On 3 Feb 2017, at 15:29, Edith Sotelo <sotelo...@gmail.com <javascript:>> 
> wrote:
>
> Hi Denis,
> Actually I still need some help regarding this. The program builds but 
> cannot execute and I get an error of Segmentation fault:11
>
> EdithMac:code_test Edith$ make
>
> [ 33%] Building CXX object 
> CMakeFiles/Helmholtz_GFEM3.dir/source/functions.cc.o
>
> [ 66%] Building CXX object 
> CMakeFiles/Helmholtz_GFEM3.dir/source/Helmholtz_GFEM3.cc.o
>
> [100%] *Linking CXX executable Helmholtz_GFEM3*
>
> [100%] Built target Helmholtz_GFEM3
>
> EdithMac:code_test Edith$ Helmholtz_GFEM3 
>
> Segmentation fault: 11
>
> Since I wanted to test the constructor, this program is only running a 
> make_grid()  class function that makes the triangulation and should output 
> the number of cells. 
>
> For  the constructor,  Apart from the FE_Enriched<dim >  fe_enriched 
> object, I created a FE_Q<dim>  fe object in my class to be able to pass it 
> by address as in the code below.
>
> Hope you can give some ideas of what is wrong with it.. 
>
>
>  
>
> template <int dim>
>
> Helmholtz_GFE2<dim>::Helmholtz_GFE2 ():
>
>
>
>   fe_enriched (
>
>                 & fe ,
>
>                 {&fe },
>
>
>                 {{
>
>                   [=] (const typename Triangulation<dim>::cell_iterator 
> &) -> const Function<dim> * {return & enrich1;},
>
>                   [=] (const typename Triangulation<dim>::cell_iterator 
> &) -> const Function<dim> * {return & enrich2;}
>
>                 }}
>
>               ),
>
>
>   fe (1),
>
>   dof_handler (triangulation),
>
>
>   enrich1 (k[0]),
>
>
>   enrich2 (k[1])
>
>
> {
>
> }
>
>
>

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