I am working on a adaptive finite elements for flows. For starters I want to base my simulation on Step 35 and introduce the refine_mesh( )  like in Step 26 to it:

See attached code snippet.

When I make I get the error message:

/[ 50%] Building CXX object CMakeFiles/step-35a.dir/step-35a.cc.o//
///home/dealii/examples/step-35a/step-35a.cc: In member function ‘void Step35a::NavierStokesProjection<dim>::refine_mesh(unsigned int, unsigned int)’:// ///home/dealii/examples/step-35a/step-35a.cc:1057:5: error: there are no arguments to ‘setup_system’ that depend on a template parameter, so a declaration of ‘setup_system’ must be available [-fpermissive]//
// 1057 |     setup_system();//
//      |     ^~~~~~~~~~~~//
///home/dealii/examples/step-35a/step-35a.cc:1057:5: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)// ///home/dealii/examples/step-35a/step-35a.cc:1059:32: error: ‘previous_solution’ was not declared in this scope// // 1059 |     solution_trans.interpolate(previous_solution, output_results);//
//      |                                ^~~~~~~~~~~~~~~~~//
///home/dealii/examples/step-35a/step-35a.cc:1060:5: error: ‘constraints’ was not declared in this scope//
// 1060 |     constraints.distribute(output_results);//
//      |     ^~~~~~~~~~~//
//make[2]: *** [CMakeFiles/step-35a.dir/build.make:63: CMakeFiles/step-35a.dir/step-35a.cc.o] Error 1// //make[1]: *** [CMakeFiles/Makefile2:272: CMakeFiles/step-35a.dir/all] Error 2//
//make: *** [Makefile:84: all] Error 2//
//dealii@cd3db784d9d2:~/examples/step-35a$ ^C//
/

Anyone with any idea how to fix this, or have implemented a similar problem in dealii.

Thank you.



--
mathematical sciences
15015 Ganges road
p.o box be277
belvedere
harare
zimbabwe

business:   +263.24.274.1423-36
fax : +263.24.274.1408
mobile zw1: +263.77.283.8167
mobile zw2: +263.77.412.0815
mobile ind: +91.844.867.9322
home : +263.68.215.3910


--




The information in this message is confidential and legally
privileged. It is intended solely for the addressee(s). Access to this message by anyone else is unauthorized. If received in error, please accept our apologies and notify the sender immediately. You must also delete the original message from your machine. If you are not the intended recipient, any use, disclosure, copying, distribution or action taken in reliance of it, is prohibited and may be unlawful. The information, attachments, opinions or advice contained in this email are not the views or opinions of Harare Institute of Technology, its subsidiaries or affiliates. Although this email and any attachments are believed to be free of any virus or other defects which might affect any computer or IT system into which they are received, no responsibility is accepted by Harare Institute of Technology and/or its subsidiaries for any loss or damage arising in any way from the receipt or use thereof.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/becdd682-abfe-17b9-54df-f240b0eca9c3%40hit.ac.zw.
  template <int dim>
  void NavierStokesProjection<dim>::refine_mesh(const unsigned int min_grid_level,
                                      const unsigned int max_grid_level)
  {
    Vector<float> estimated_error_per_cell(triangulation.n_active_cells());

    KellyErrorEstimator<dim>::estimate(
      dof_handler_velocity,
      dof_handler_pressure,
      QGauss<dim - 1>(deg + 1),
      std::map<types::boundary_id, const Function<dim> *>(),
      output_results,
      estimated_error_per_cell);
    GridRefinement::refine_and_coarsen_fixed_fraction(triangulation,
                                                      estimated_error_per_cell,
                                                      0.6,
                                                      0.4);

    if (triangulation.n_levels() > max_grid_level)
      for (const auto &cell :
           triangulation.active_cell_iterators_on_level(max_grid_level))
        cell->clear_refine_flag();
    for (const auto &cell :
         triangulation.active_cell_iterators_on_level(min_grid_level))
      cell->clear_coarsen_flag();

/*******/

 SolutionTransfer<dim> solution_trans(dof_handler_velocity, dof_handler_pressure);

    Vector<double> previous_velocity;
    previous_velocity = fe_velocity;
    triangulation.prepare_coarsening_and_refinement();
    solution_trans.prepare_for_coarsening_and_refinement(previous_velocity);

    Vector<double> previous_pressure;
    previous_pressure = fe_pressure;
    triangulation.prepare_coarsening_and_refinement();
    solution_trans.prepare_for_coarsening_and_refinement(previous_pressure);

/*******/

 triangulation.execute_coarsening_and_refinement();
    setup_system();

    solution_trans.interpolate(previous_solution, output_results);
    constraints.distribute(output_results);
  }

Reply via email to