Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/pidomus.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ class piDoMUS : public ParameterAcceptor
std::vector<IndexSet> relevant_partitioning;

bool adaptive_refinement;
unsigned int max_cells;
const bool we_are_parallel;
bool use_direct_solver;

Expand Down
7 changes: 7 additions & 0 deletions source/pidomus_mesh_refinement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ piDoMUS<dim, spacedim, LAC>::solver_should_restart(const double t,
if (max_kelly > kelly_threshold)

{
unsigned int n_active_cells=triangulation->n_active_cells();
unsigned int max_cells=this->max_cells;
if ((max_cells > 0) & (n_active_cells > max_cells))
{
signals.end_solver_should_restart();
return false;
}
pcout << " ################ restart ######### \n"
<< "max_kelly > threshold\n"
<< max_kelly << " > " << kelly_threshold
Expand Down
6 changes: 6 additions & 0 deletions source/pidomus_parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ declare_parameters (ParameterHandler &prm)
"true",
Patterns::Bool());

add_parameter( prm,
&max_cells,
"Max number of cells",
"0",
Patterns::Integer (0));

add_parameter( prm,
&verbose,
"Print some useful informations about processes",
Expand Down