I attached a simple .cc file that illustrates the tittle. 
Switching lines 18 and 19 leads to a segmentation fault and I would like to 
know why out of curiosity. 
Would appreciate it. Thanks 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/86dd356e-58a4-4e61-96e0-e9a0ecfd7236n%40googlegroups.com.

#include <deal.II/base/timer.h>
using namespace dealii;

template <int dim>
class LaplaceProblem
{
public:
    LaplaceProblem();

    void run();

private:
    void setup_system();

    MPI_Comm mpi_communicator;
    TimerOutput computing_timer;
    ConditionalOStream pcout;

};

template <int dim>
LaplaceProblem<dim>::LaplaceProblem()
    : mpi_communicator(MPI_COMM_WORLD), pcout(std::cout,
                                              (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)),
      computing_timer(mpi_communicator,
                      pcout,
                      TimerOutput::never,
                      TimerOutput::wall_times)
{
}

template <int dim>
void LaplaceProblem<dim>::setup_system()
{
    TimerOutput::Scope t(computing_timer, "setup");
}
template <int dim>
void LaplaceProblem<dim>::run()
{
    setup_system();
    computing_timer.print_summary();
    computing_timer.reset();
}

int main(int argc, char *argv[])
{

    Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
    LaplaceProblem<2> laplace_problem_2d;
    laplace_problem_2d.run();
}


Reply via email to