Commit 2fb383ac authored by Dion Haefner's avatar Dion Haefner

added evaporation reference test

parent a6ad4850
......@@ -19,7 +19,9 @@
// Do not treat DUNE warnings as errors
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#if __GNUC__ > 5
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/ios_state.hh>
......
......@@ -86,7 +86,7 @@ public:
}
/// Adapt the grid according to the estimated flux error and the strategy applied
/**
/**
* \param grid Grid to adapt
* \param gv Leaf grid view of the grid
* \param gfs Solution GridFunctionSpace
......@@ -110,9 +110,8 @@ public:
Dune::Timer timer3;
float t_setup,t_est,t_sqrt,t_strtgy,t_mark,t_adapt;
if(verbose>1 /*&& strategy == "targetTolerance"*/){
if(verbose>1)
std::cout << " Refinement Step " << multiRefinementCounter << ": ";
}
double eta_alpha(0.0);
double eta_beta(0.0);
......@@ -138,12 +137,8 @@ public:
native(eta)[i] = sqrt(native(eta)[i]); // eta contains squares
if (native(eta)[i] > maxeta) maxeta = native(eta)[i];
}
if (verbose>1) {
if (verbose>1)
std::cout << "Largest Local Error: " << maxeta << " " << std::endl;
if (maxeta < adaptivityThreshold) {
std::cout << " Max local error smaller than threshold " << adaptivityThreshold << ". Skipping grid refinement." << std::endl;
}
}
t_sqrt = timer3.elapsed();
timer3.reset();
......@@ -157,9 +152,9 @@ public:
// Apply marking strategy
if (strategy == "elementFraction")
Dune::PDELab::element_fraction( eta, alpha, beta, eta_alpha, eta_beta, verbose-1 );
Dune::PDELab::element_fraction(eta, alpha, beta, eta_alpha, eta_beta, verbose-1);
else if (strategy == "errorFraction")
Dune::PDELab::error_fraction( eta, alpha, beta, eta_alpha, eta_beta, verbose-1 );
Dune::PDELab::error_fraction(eta, alpha, beta, eta_alpha, eta_beta, verbose-1);
else{ //((strategy == "threshold") || (strategy == "targetTolerance")) {
eta_alpha = alpha;
eta_beta = beta; }
......@@ -168,15 +163,18 @@ public:
timer3.reset();
// Skip refinement if threshold is met, but still allow coarsening
if (maxeta < adaptivityThreshold)
if (maxeta < adaptivityThreshold) {
eta_alpha = maxeta + 1; // Only refine elements with error > maxerror + 1
if (verbose>1)
std::cout << " Max local error smaller than threshold " << adaptivityThreshold << ". Skipping grid refinement." << std::endl;
}
Dune::PDELab::mark_grid( grid, eta, eta_alpha, eta_beta, minLevel, maxLevel, verbose-1);
Dune::PDELab::mark_grid(grid, eta, eta_alpha, eta_beta, minLevel, maxLevel, verbose-1);
t_mark = timer3.elapsed();
timer3.reset();
Dune::PDELab::adapt_grid( grid, gfs, uold, unew, (order) * 2 );
Dune::PDELab::adapt_grid(grid, gfs, uold, unew, 2*order);
t_adapt = timer3.elapsed();
timer3.reset();
......@@ -228,7 +226,7 @@ private:
public:
/// Create the factory, taking the parameters for building an AdaptivityHandler
/**
/**
* \param _inifile Parameter file parser
* \param _grid Grid to adapt (reference is not saved)
*/
......
......@@ -31,7 +31,6 @@ def write_parameter_file(group,data_dict,out_path,attrs=None,overwrite=False):
:param overwrite: If true, overwrite an existing file without asking
"""
print(group)
if os.path.isfile(out_path) and not overwrite:
ow = raw_input("The output file {} already exists. Overwrite? [y/N] ".format(out_path))
if not ow.lower() in ["y","yes"]:
......
......@@ -18,6 +18,7 @@ endfunction()
#dorie_add_system_test_dependency(dorie_muphi dorie-pfg_muphi_pfg)
#dorie_add_system_test(dorie reference_2d.mini)
#dorie_add_system_test(dorie reference_3d.mini)
dorie_add_system_test(dorie reference_evaporation.mini)
# dorie pfg
#dorie_add_system_test(dorie-pfg parfield.mini)
......
spatial_resolution_north 0
spatial_resolution_south 0
spatial_resolution_west -1
spatial_resolution_east -1
number_BC_change_times 3
0 neumann -5.55e-6 dirichlet 0
1e5 neumann 0 dirichlet 0
1e5 evaporation 1e-7 -10 dirichlet 0
......@@ -2,7 +2,7 @@ include ${CMAKE_BINARY_DIR}/doc/default_files/parfield.ini
__name = pfg_parallel
_test_command = pfg
_test_command_options = --parallel 2 -m=--allow-run-as-root
_test_command_options = --parallel -m=--allow-run-as-root
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_data_path = {_asset_path}/parfield-data
_evaluation = reference
......
include ${CMAKE_BINARY_DIR}/doc/default_files/config.ini
__name = reference_evaporation
_test_command = run
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_evaluation = reference
_reference.path = {_asset_path}/references/evaporation/
output.fileName = reference_evaporation | unique name
output.outputPath = reference_evaporation | unique name
output.verbose = 0
time.end = 1E6
time.maxTimestep = 1E6
time.startTimestep = 1E3
adaptivity.useAdaptivity = false, true | expand adaptivity
adaptivity.threshold = 1E-7
grid.initialLevel = 2, 0 | expand adaptivity
grid.gridType = gmsh, rectangular | expand
grid.cells = 20 20
grid.extensions = 1 1
grid.gridFile = "{_asset_path}/meshes/square.msh"
boundary.file = "{_asset_path}/bcs/evaporation_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5"
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment