Commit 1e39542d authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

first commit unit test config

parent 2de8b132
Pipeline #90852 failed with stages
in 17 minutes and 48 seconds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Test Configuration File %
% Author: Steffen Schotthöfer %
% Date: 08.06.2020 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = testOutput
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = testMesh.su2
%
% ---- Solver specifications ----
%
% CFL number
CFL_NUMBER = 0.4
% Final time for simulation
TIME_FINAL = 0.3
%
% ---- Problem Specifications ----
%
% Preselected Problem for Physics Settings
PROBLEM = LINESOURCE
%
% Scattering Kernel
KERNEL = ISOTROPIC
%
%% Quadrature Specifications
% Quadrature Type
QUAD_TYPE = MONTE_CARLO
% Quadrature Order
QUAD_ORDER = 5000
%
% ---- Boundary Conditions ----
%
% Example: BC_DIRICLET = (dummyMarker1, dummyMarker2)
% Dirichlet Boundary
BC_DIRICHLET = ( DirichletTestMarker1, DirichletTestMarker2 )
%
% Neumann Boundary
BC_NEUMANN = (NeumannTestMarker1, NeumannTestMarker2)
%
#include "catch.hpp"
#include "settings/config.h"
#include "settings/globalconstants.h"
TEST_CASE( "Read in Config Template" ) {
std::string filename = "input/configTest.cfg";
char config_file_name[MAX_STRING_SIZE];
/*--- Load in the number of zones and spatial dimensions in the mesh file (If no config
file is specified, default.cfg is used) ---*/
strcpy( config_file_name, filename.c_str() );
// Load Settings from File
Config* config = new Config( config_file_name );
// Test all set configurations
bool allSatisfied = true;
if( config->GetMeshFile().compare( "testMesh.su2" ) != 0 ) allSatisfied = false;
if( config->GetOutputDir().compare( "../result" ) != 0 ) allSatisfied = false;
if( config->GetOutputFile().compare( "testOutput" ) != 0 ) allSatisfied = false;
if( config->GetLogDir().compare( "../result/logs" ) != 0 ) allSatisfied = false;
if( config->GetCFL() != 0.4 ) allSatisfied = false;
if( config->GetTEnd() != 0.3 ) allSatisfied = false;
if( config->GetProblemName() != PROBLEM_LineSource ) allSatisfied = false;
if( config->GetKernelName() != KERNEL_Isotropic ) allSatisfied = false;
if( config->GetQuadName() != QUAD_MonteCarlo ) allSatisfied = false;
if( config->GetQuadOrder() != 5000 ) allSatisfied = false;
// Check boundary conditions
if( config->GetBoundaryType( "DirichletTestMarker2" ) != DIRICHLET ) allSatisfied = false;
if( config->GetBoundaryType( "DirichletTestMarker1" ) != DIRICHLET ) allSatisfied = false;
if( config->GetBoundaryType( "NeumannTestMarker1" ) != NEUMANN ) allSatisfied = false;
if( config->GetBoundaryType( "NeumannTestMarker2" ) != NEUMANN ) allSatisfied = false;
REQUIRE( allSatisfied );
}
Supports Markdown
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