tychoGUI  1.0
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields | Private Slots | Private Member Functions | Private Attributes
MainWindow Class Reference

#include <mainwindow.h>

Public Member Functions

 MainWindow (QWidget *parent=0)
 ~MainWindow ()

Data Fields

int x_res
int y_res
int z_res
bool resolution_is_yet_determined

Private Slots

void quit ()
void openfile ()
void savefile ()
void reset_gui ()
void open_local_simulation ()
void open_about ()
void open_configure_path ()
void open_help1 ()
void open_help2 ()
void open_help3 ()
void open_help4 ()
void open_help5 ()
void open_help6 ()
void open_help7 ()
void open_help8 ()
void set_parameters (QList< QString > data)
void ic_density ()
void ic_temperature ()
void ic_velocity ()
void ic_wind ()
void ic_obstacle ()
void ic_marker ()
void ic_soundemitter ()
void output_path ()
void check_resolution (QString filename)
void ic_logic ()
void boundary_logic ()
void dimension_logic ()
void gravity_logic ()
void windemitter_logic ()
void obstacle_logic ()
void marker_logic ()
void soundemitter_logic ()
void soundemitter_logic_part2 ()

Private Member Functions

QString boundary_selector (QString boundary)
QString ic_selector (QString ic)
QString filetype_selector (QString filetype)
void initiate_ic_files ()

Private Attributes

Ui::MainWindowui
help1myhelp1
help2myhelp2
help3myhelp3
help4myhelp4
help5myhelp5
help6myhelp6
help7myhelp7
help8myhelp8
configure_pathmyconfigure_path
local_simulationmylocal_simulation
aboutmyabout
QString ic_density_file
QString ic_temperature_file
QString ic_velocity_file
QString ic_windemitter_file
QString ic_obstacle_file
QString ic_marker_file
QString ic_soundemitter_file
QString output_directory

Detailed Description

Definition at line 22 of file mainwindow.h.


Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0)
explicit

Here are the connects on the mainform defined and called

Definition at line 18 of file mainwindow.cpp.

References Ui_MainWindow::actionConfigure_Path, Ui_MainWindow::actionLocal_Simulation, Ui_MainWindow::actionOpen_2, Ui_MainWindow::actionQuit_2, Ui_MainWindow::actionReset, Ui_MainWindow::actionSave_Parameterfile, Ui_MainWindow::actionTycho_GUI, Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, boundary_logic(), Ui_MainWindow::dimension, dimension_logic(), Ui_MainWindow::frame, gravity_logic(), Ui_MainWindow::gravity_off, Ui_MainWindow::gravity_on, Ui_MainWindow::help_1, Ui_MainWindow::help_2, Ui_MainWindow::help_3, Ui_MainWindow::help_4, Ui_MainWindow::help_5, Ui_MainWindow::help_6, Ui_MainWindow::help_7, Ui_MainWindow::help_8, ic_density(), Ui_MainWindow::ic_density, ic_logic(), ic_marker(), Ui_MainWindow::ic_marker, ic_obstacle(), Ui_MainWindow::ic_obstacle, ic_soundemitter(), Ui_MainWindow::ic_soundemitter, Ui_MainWindow::ic_temperatur, ic_temperature(), ic_velocity(), Ui_MainWindow::ic_velocity, ic_wind(), Ui_MainWindow::ic_wind, Ui_MainWindow::inflow_density, Ui_MainWindow::inflow_temperature, Ui_MainWindow::inflow_velocity, Ui_MainWindow::initial_conditions, initiate_ic_files(), Ui_MainWindow::marker_field_off, Ui_MainWindow::marker_field_on, marker_logic(), obstacle_logic(), Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_on, Ui_MainWindow::one_pulse_off, Ui_MainWindow::one_pulse_on, Ui_MainWindow::open, open_about(), open_configure_path(), open_help1(), open_help2(), open_help3(), open_help4(), open_help5(), open_help6(), open_help7(), open_help8(), open_local_simulation(), openfile(), output_path(), Ui_MainWindow::output_path, quit(), Ui_MainWindow::reset, reset_gui(), resolution_is_yet_determined, Ui_MainWindow::save, savefile(), Ui_MainWindow::setupUi(), soundemitter_logic(), soundemitter_logic_part2(), Ui_MainWindow::Soundemitter_off, Ui_MainWindow::Soundemitter_on, ui, Ui_MainWindow::wind_boundary_0, Ui_MainWindow::wind_boundary_1, Ui_MainWindow::wind_emitter_off, Ui_MainWindow::wind_emitter_on, windemitter_logic(), x_res, y_res, and z_res.

:
QMainWindow(parent),
{
ui->setupUi(this);
//scrollbars
QScrollArea *const scroll(new QScrollArea);
scroll->setWidget(ui->frame);
setCentralWidget(scroll);
//menus
connect(ui->actionQuit_2, SIGNAL(triggered()), this, SLOT(quit()));
connect(ui->actionOpen_2, SIGNAL(triggered()), this, SLOT(openfile()));
connect(ui->actionSave_Parameterfile, SIGNAL(triggered()), this, SLOT(savefile()));
connect(ui->actionLocal_Simulation, SIGNAL(triggered()), this, SLOT(open_local_simulation()));
connect(ui->actionReset, SIGNAL(triggered()), this, SLOT(reset_gui()));
connect(ui->actionTycho_GUI, SIGNAL(triggered()), this, SLOT(open_about()));
connect(ui->actionConfigure_Path, SIGNAL(triggered()), this, SLOT(open_configure_path()));
//helpbuttons
connect(ui->help_1, SIGNAL(clicked()), this, SLOT(open_help1()));
connect(ui->help_2, SIGNAL(clicked()), this, SLOT(open_help2()));
connect(ui->help_3, SIGNAL(clicked()), this, SLOT(open_help3()));
connect(ui->help_4, SIGNAL(clicked()), this, SLOT(open_help4()));
connect(ui->help_5, SIGNAL(clicked()), this, SLOT(open_help5()));
connect(ui->help_6, SIGNAL(clicked()), this, SLOT(open_help6()));
connect(ui->help_7, SIGNAL(clicked()), this, SLOT(open_help7()));
connect(ui->help_8, SIGNAL(clicked()), this, SLOT(open_help8()));
//for the IC files and the output directory
connect(ui->ic_density, SIGNAL(clicked()), this, SLOT(ic_density()));
connect(ui->ic_temperatur, SIGNAL(clicked()), this, SLOT(ic_temperature()));
connect(ui->ic_velocity, SIGNAL(clicked()), this, SLOT(ic_velocity()));
connect(ui->ic_wind, SIGNAL(clicked()), this, SLOT(ic_wind()));
connect(ui->ic_obstacle, SIGNAL(clicked()), this, SLOT(ic_obstacle()));
connect(ui->ic_marker, SIGNAL(clicked()), this, SLOT(ic_marker()));
connect(ui->ic_soundemitter, SIGNAL(clicked()), this, SLOT(ic_soundemitter()));
connect(ui->output_path, SIGNAL(clicked()), this, SLOT(output_path()));
//the save, open and reset button on the mainwindow
connect(ui->save, SIGNAL(clicked()), this, SLOT(savefile()));
connect(ui->open, SIGNAL(clicked()), this, SLOT(openfile()));
connect(ui->reset, SIGNAL(clicked()), this, SLOT(reset_gui()));
//section to prevent wrong usage
connect(ui->initial_conditions, SIGNAL(currentIndexChanged(int)), this, SLOT(ic_logic()));
//the inflow settings are disabled by default
ui->inflow_velocity->setDisabled(true);
ui->inflow_density->setDisabled(true);
ui->inflow_temperature->setDisabled(true);
ui->wind_boundary_0->setDisabled(true);
ui->wind_boundary_1->setDisabled(true);
connect(ui->bound_down,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
connect(ui->bound_up,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
connect(ui->bound_left,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
connect(ui->bound_right,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
connect(ui->bound_front,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
connect(ui->bound_back,SIGNAL(currentIndexChanged(int)), this, SLOT(boundary_logic()));
//dimension_logic
connect(ui->dimension,SIGNAL(currentIndexChanged(int)), this, SLOT(dimension_logic()));
//gravity_logic
connect(ui->gravity_on, SIGNAL(clicked()), this, SLOT(gravity_logic()));
connect(ui->gravity_off, SIGNAL(clicked()), this, SLOT(gravity_logic()));
//windemitter_logic
connect(ui->wind_emitter_on, SIGNAL(clicked()), this, SLOT(windemitter_logic()));
connect(ui->wind_emitter_off, SIGNAL(clicked()), this, SLOT(windemitter_logic()));
//obstacle_logic
connect(ui->obstacle_on, SIGNAL(clicked()), this, SLOT(obstacle_logic()));
connect(ui->obstacle_off, SIGNAL(clicked()), this, SLOT(obstacle_logic()));
//marker_logic
connect(ui->marker_field_on, SIGNAL(clicked()), this, SLOT(marker_logic()));
connect(ui->marker_field_off, SIGNAL(clicked()), this, SLOT(marker_logic()));
//soundemitter
connect(ui->Soundemitter_on, SIGNAL(clicked()), this, SLOT(soundemitter_logic()));
connect(ui->Soundemitter_off, SIGNAL(clicked()), this, SLOT(soundemitter_logic()));
//soundemitter_part2
connect(ui->one_pulse_on, SIGNAL(clicked()), this, SLOT(soundemitter_logic_part2()));
connect(ui->one_pulse_off, SIGNAL(clicked()), this, SLOT(soundemitter_logic_part2()));
//Aufloesung
x_res = 0;
y_res = 0;
z_res = 0;
}
MainWindow::~MainWindow ( )

Definition at line 126 of file mainwindow.cpp.

References ui.

{
delete ui;
}

Member Function Documentation

void MainWindow::boundary_logic ( )
privateslot

Function to make boundary-condition inflow setting possible

Definition at line 151 of file logic_parameter.cpp.

References Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, Ui_MainWindow::inflow_density, Ui_MainWindow::inflow_temperature, Ui_MainWindow::inflow_velocity, ui, Ui_MainWindow::wind_boundary_0, and Ui_MainWindow::wind_boundary_1.

Referenced by MainWindow(), and reset_gui().

{
if ((ui->bound_down->currentIndex() == 4)||
(ui->bound_up->currentIndex() == 4)||
(ui->bound_left->currentIndex() == 4)||
(ui->bound_right->currentIndex() == 4)||
(ui->bound_front->currentIndex() == 4)||
(ui->bound_back->currentIndex() == 4))
{
ui->inflow_velocity->setDisabled(false);
ui->inflow_density->setDisabled(false);
ui->inflow_temperature->setDisabled(false);
ui->wind_boundary_0->setDisabled(false);
ui->wind_boundary_1->setDisabled(false);
}
else
{
ui->inflow_velocity->setDisabled(true);
ui->inflow_density->setDisabled(true);
ui->inflow_temperature->setDisabled(true);
ui->wind_boundary_0->setDisabled(true);
ui->wind_boundary_1->setDisabled(true);
ui->wind_boundary_0->setChecked(true);
ui->inflow_density->setText("1.229");
ui->inflow_temperature->setText("300");
ui->inflow_velocity->setText("100");
}
}
QString MainWindow::boundary_selector ( QString  boundary)
private

Selects the proper number for boundaries

Definition at line 12 of file boundary_selector.cpp.

Referenced by savefile().

{
QString number;
if (boundary=="zero gradient") number = "0";
if (boundary=="reflecting") number = "1";
if (boundary=="small padding") number = "2";
if (boundary=="outflow") number = "3";
if (boundary=="inflow") number = "4";
if (boundary=="periodic") number = "5";
return number;
}
void MainWindow::check_resolution ( QString  filename)
privateslot

*Checks the resolution of the IC file and make some plausibility checks

Definition at line 175 of file open_initial_conditions.cpp.

References Ui_MainWindow::dimension, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, resolution_is_yet_determined, ui, x_res, y_res, and z_res.

Referenced by ic_density(), ic_marker(), ic_obstacle(), ic_soundemitter(), ic_temperature(), ic_velocity(), and ic_wind().

{
int read_x_res = 0;
int read_y_res = 0;
int read_z_res = 0;
QFile file(filename);
file.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream in(&file);
int i = 0;
while(i<4)
{
QString line = in.readLine();
std::istringstream iss(line.toStdString());
std::string name;
if (i == 1) iss >> name >> read_x_res;
if (i == 2) iss >> name >> read_y_res;
if (i == 3) iss >> name >> read_z_res;
i++;
}
if ((read_x_res != MainWindow::x_res)||
(read_y_res != MainWindow::y_res)||
(read_z_res != MainWindow::z_res)){
ui->res_x->setValue(0);
ui->res_y->setValue(0);
ui->res_z->setValue(0);
QMessageBox msgBox;
msgBox.setText("Attention!");
msgBox.setInformativeText("The file has a different resolution as a already loaded, plaese check the IC files.");
msgBox.exec();
}
}
MainWindow::x_res = read_x_res;
MainWindow::y_res = read_y_res;
MainWindow::z_res = read_z_res;
ui->res_x->setValue(read_x_res);
ui->res_y->setValue(read_y_res);
ui->res_z->setValue(read_z_res);
if ((read_y_res==1)&&(read_z_res==1)) ui->dimension->setCurrentIndex(0);
if (read_z_res ==1) ui->dimension->setCurrentIndex(1);
if ((read_y_res!=1)&&(read_z_res!=1)) ui->dimension->setCurrentIndex(2);
}
void MainWindow::dimension_logic ( )
privateslot

Function to set the dimensions and extends

Definition at line 186 of file logic_parameter.cpp.

References Ui_MainWindow::dimension, Ui_MainWindow::extend_x, Ui_MainWindow::extend_y, Ui_MainWindow::extend_z, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, and ui.

Referenced by MainWindow().

{
if (ui->dimension->currentIndex()==0){
ui->res_x->setDisabled(false);
ui->res_y->setDisabled(true);
ui->res_z->setDisabled(true);
ui->extend_x->setDisabled(false);
ui->extend_y->setDisabled(true);
ui->extend_z->setDisabled(true);
}
if (ui->dimension->currentIndex()==1){
ui->res_x->setDisabled(false);
ui->res_y->setDisabled(false);
ui->res_z->setDisabled(true);
ui->extend_x->setDisabled(false);
ui->extend_y->setDisabled(false);
ui->extend_z->setDisabled(true);
}
if (ui->dimension->currentIndex()==2){
ui->res_x->setDisabled(false);
ui->res_y->setDisabled(false);
ui->res_z->setDisabled(false);
ui->extend_x->setDisabled(false);
ui->extend_y->setDisabled(false);
ui->extend_z->setDisabled(false);
}
}
QString MainWindow::filetype_selector ( QString  filetype)
private

Selects the filetype-number from the input

Definition at line 13 of file filetype_selector.cpp.

Referenced by savefile().

{
QString number;
if (filetype=="TYCHO files") number = "0";
if (filetype=="VTK files") number = "1";
if (filetype=="AMIRA files") number = "2";
if (filetype=="IFRIT files") number = "3";
return number;
}
void MainWindow::gravity_logic ( )
privateslot

Setting the right boundary conditions and stratified atmosphere button logic if gravity is enabled

Definition at line 224 of file logic_parameter.cpp.

References Ui_MainWindow::bound_down, Ui_MainWindow::bound_up, Ui_MainWindow::gravity_on, Ui_MainWindow::startified_atmos_off, Ui_MainWindow::startified_atmos_on, and ui.

Referenced by MainWindow().

{
if (ui->gravity_on->isChecked()){
ui->startified_atmos_off->setDisabled(false);
ui->startified_atmos_on->setDisabled(false);
ui->bound_down->setCurrentIndex(1);
ui->bound_up->setCurrentIndex(0);
ui->bound_down->setDisabled(true);
ui->bound_up->setDisabled(true);
}
if (!ui->gravity_on->isChecked()){
ui->startified_atmos_off->setDisabled(true);
ui->startified_atmos_on->setDisabled(true);
ui->startified_atmos_off->setChecked(true);
ui->bound_down->setCurrentIndex(0);
ui->bound_up->setCurrentIndex(0);
ui->bound_down->setDisabled(false);
ui->bound_up->setDisabled(false);
}
}
void MainWindow::ic_density ( )
privateslot

Loads the ic density file

Definition at line 17 of file open_initial_conditions.cpp.

References check_resolution(), and ic_density_file.

Referenced by MainWindow().

{
QString ic_dens = QFileDialog::getOpenFileName(this, tr("The initial density file"), QString::null);
if (ic_dens.size()==0) ic_dens = "dummy";
ic_density_file = ic_dens;
//to read out the size of the computational domain
if (ic_dens.size()>0){
check_resolution(ic_dens);
}
}
void MainWindow::ic_logic ( )
privateslot

Function to prevent wrong initial conditions logic

Definition at line 12 of file logic_parameter.cpp.

References Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, Ui_MainWindow::dimension, Ui_MainWindow::gravity_off, Ui_MainWindow::gravity_on, Ui_MainWindow::ic_density, Ui_MainWindow::ic_marker, Ui_MainWindow::ic_obstacle, ic_selector(), Ui_MainWindow::ic_temperatur, Ui_MainWindow::ic_velocity, Ui_MainWindow::ic_wind, Ui_MainWindow::inflow_density, Ui_MainWindow::inflow_temperature, Ui_MainWindow::inflow_velocity, Ui_MainWindow::initial_conditions, Ui_MainWindow::marker_density, Ui_MainWindow::marker_field_off, Ui_MainWindow::marker_field_on, marker_logic(), Ui_MainWindow::obstacle_density, Ui_MainWindow::obstacle_diff, obstacle_logic(), Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_on, Ui_MainWindow::obstacle_temp, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, Ui_MainWindow::startified_atmos_off, Ui_MainWindow::startified_atmos_on, ui, Ui_MainWindow::wind_emitter_off, Ui_MainWindow::wind_emitter_on, Ui_MainWindow::wind_speed, and windemitter_logic().

Referenced by MainWindow().

{
if (ic_selector(ui->initial_conditions->currentText()) == "0"){
ui->ic_density->setDisabled(true);
ui->ic_temperatur->setDisabled(true);
ui->ic_velocity->setDisabled(true);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(true);
ui->ic_marker->setDisabled(true);
}
if (ic_selector(ui->initial_conditions->currentText()) == "1"){
ui->ic_density->setDisabled(false);
ui->ic_temperatur->setDisabled(false);
ui->ic_velocity->setDisabled(false);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(true);
ui->ic_marker->setDisabled(true);
if (ui->obstacle_on->isChecked()) ui->ic_obstacle->setEnabled(true);
if (ui->wind_emitter_on->isChecked()) ui->ic_wind->setEnabled(true);
if (ui->marker_field_on->isChecked()) ui->ic_marker->setEnabled(true);
}
if (ic_selector(ui->initial_conditions->currentText()) == "2"){
ui->ic_density->setDisabled(true);
ui->ic_temperatur->setDisabled(true);
ui->ic_velocity->setDisabled(true);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(false);
ui->ic_marker->setDisabled(true);
ui->obstacle_on->setChecked(true);
ui->obstacle_off->setChecked(false);
ui->obstacle_density->setDisabled(false);
ui->obstacle_temp->setDisabled(false);
ui->obstacle_diff->setDisabled(false);
ui->obstacle_density->setText("7874");
ui->obstacle_temp->setText("300");
ui->obstacle_diff->setText("0.000023");
}
if (ic_selector(ui->initial_conditions->currentText()) == "3"){
ui->ic_density->setDisabled(true);
ui->ic_temperatur->setDisabled(true);
ui->ic_velocity->setDisabled(true);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(true);
ui->ic_marker->setDisabled(true);
ui->obstacle_on->setChecked(false);
ui->obstacle_off->setChecked(true);
ui->obstacle_density->setDisabled(true);
ui->obstacle_temp->setDisabled(true);
ui->obstacle_diff->setDisabled(true);
ui->obstacle_density->setText("0");
ui->obstacle_temp->setText("0");
ui->obstacle_diff->setText("0");
ui->wind_emitter_off->setChecked(true);
ui->wind_emitter_on->setChecked(false);
ui->wind_speed->setDisabled(true);
ui->wind_speed->setText("0");
ui->marker_field_off->setChecked(true);
ui->marker_field_on->setChecked(false);
ui->marker_density->setDisabled(true);
ui->marker_density->setText("0");
}
if (ic_selector(ui->initial_conditions->currentText()) == "4"){
ui->ic_density->setDisabled(true);
ui->ic_temperatur->setDisabled(true);
ui->ic_velocity->setDisabled(true);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(true);
ui->ic_marker->setDisabled(true);
ui->obstacle_on->setChecked(false);
ui->obstacle_off->setChecked(true);
//set the boundaries periodic
ui->bound_down->setCurrentIndex(5);
ui->bound_up->setCurrentIndex(5);
ui->bound_left->setCurrentIndex(5);
ui->bound_right->setCurrentIndex(5);
ui->bound_front->setCurrentIndex(5);
ui->bound_back->setCurrentIndex(5);
ui->dimension->setCurrentIndex(1);
ui->res_x->setValue(128);
ui->res_y->setValue(128);
ui->res_z->setValue(1);
ui->inflow_density->setText("0");
ui->inflow_velocity->setText("0");
ui->inflow_temperature->setText("0");
ui->gravity_off->setChecked(true);
ui->gravity_on->setChecked(false);
ui->startified_atmos_off->setChecked(true);
ui->startified_atmos_on->setChecked(false);
ui->obstacle_on->setChecked(false);
ui->obstacle_off->setChecked(true);
ui->obstacle_density->setDisabled(true);
ui->obstacle_temp->setDisabled(true);
ui->obstacle_diff->setDisabled(true);
ui->obstacle_density->setText("0");
ui->obstacle_temp->setText("0");
ui->obstacle_diff->setText("0");
ui->wind_emitter_off->setChecked(true);
ui->wind_emitter_on->setChecked(false);
ui->wind_speed->setDisabled(true);
ui->wind_speed->setText("0");
ui->marker_field_off->setChecked(true);
ui->marker_field_on->setChecked(false);
ui->marker_density->setDisabled(true);
ui->marker_density->setText("0");
}
}
void MainWindow::ic_marker ( )
privateslot

Loads the ic marker file

Definition at line 104 of file open_initial_conditions.cpp.

References check_resolution(), and ic_marker_file.

Referenced by MainWindow().

{
QString ic_marker = QFileDialog::getOpenFileName(this, tr("The initial marker-field distribution file"), QString::null);
if (ic_marker.size()==0) ic_marker = "dummy";
//to read out the size of the computational domain
if (ic_marker.size()>0){
check_resolution(ic_marker);
}
}
void MainWindow::ic_obstacle ( )
privateslot

Loads the ic obstacles file

Definition at line 86 of file open_initial_conditions.cpp.

References check_resolution(), and ic_obstacle_file.

Referenced by MainWindow().

{
QString ic_obstacle = QFileDialog::getOpenFileName(this, tr("The initial obstacles-distribution file"), QString::null);
if (ic_obstacle.size()==0) ic_obstacle = "dummy";
//to read out the size of the computational domain
if (ic_obstacle.size()>0){
check_resolution(ic_obstacle);
}
}
QString MainWindow::ic_selector ( QString  ic)
private

Selects the number for initial conditions for the parameterfile

Definition at line 13 of file ic_selector.cpp.

Referenced by ic_logic(), and savefile().

{
QString number;
if (ic=="TYCHO generated") number = "0";
if (ic=="Read ICs in TYCHO file-format") number = "1";
if (ic=="Only obstacle distribution") number = "2";
if (ic=="A Sod Shock Tube") number = "3";
if (ic=="Kelvin Helmholtz instability") number = "4";
return number;
}
void MainWindow::ic_soundemitter ( )
privateslot

Loads the ic marker file

Definition at line 122 of file open_initial_conditions.cpp.

References check_resolution(), and ic_soundemitter_file.

Referenced by MainWindow().

{
QString ic_soundemitter = QFileDialog::getOpenFileName(this, tr("The initial soundemitter file"), QString::null);
if (ic_soundemitter.size()==0) ic_soundemitter = "dummy";
//to read out the size of the computational domain
if (ic_soundemitter.size()>0){
check_resolution(ic_soundemitter);
}
}
void MainWindow::ic_temperature ( )
privateslot

Loads the ic temperature file

Definition at line 32 of file open_initial_conditions.cpp.

References check_resolution(), and ic_temperature_file.

Referenced by MainWindow().

{
QString ic_temp = QFileDialog::getOpenFileName(this, tr("The initial temperature file"), QString::null);
if (ic_temp.size()==0) ic_temp ="dummy";
//to read out the size of the computational domain
if (ic_temp.size()>0){
check_resolution(ic_temp);
}
}
void MainWindow::ic_velocity ( )
privateslot

Loads the ic velocity file

Definition at line 50 of file open_initial_conditions.cpp.

References check_resolution(), and ic_velocity_file.

Referenced by MainWindow().

{
QString ic_velo = QFileDialog::getOpenFileName(this, tr("The initial velocity file"), QString::null);
if (ic_velo.size()==0) ic_velo = "dummy";
ic_velocity_file = ic_velo;
//to read out the size of the computational domain
if (ic_velo.size()>0){
check_resolution(ic_velo);
}
}
void MainWindow::ic_wind ( )
privateslot

Loads the ic wind file

Definition at line 68 of file open_initial_conditions.cpp.

References check_resolution(), and ic_windemitter_file.

Referenced by MainWindow().

{
QString ic_wind = QFileDialog::getOpenFileName(this, tr("The initial wind-emitter file"), QString::null);
if (ic_wind.size()==0) ic_wind = "dummy";
//to read out the size of the computational domain
if (ic_wind.size()>0){
check_resolution(ic_wind);
}
}
void MainWindow::initiate_ic_files ( )
private

resets the initial conditions files

Definition at line 158 of file open_initial_conditions.cpp.

References ic_density_file, ic_marker_file, ic_obstacle_file, ic_soundemitter_file, ic_temperature_file, ic_velocity_file, ic_windemitter_file, output_directory, Ui_MainWindow::output_path_line, and ui.

Referenced by MainWindow(), and reset_gui().

{
ic_density_file = "dummy";
ic_velocity_file = "dummy";
ic_obstacle_file = "dummy";
ic_marker_file = "dummy";
output_directory= "/tmp/";
}
void MainWindow::marker_logic ( )
privateslot

Enables markerfield logic

Definition at line 312 of file logic_parameter.cpp.

References Ui_MainWindow::ic_marker, ic_marker_file, Ui_MainWindow::marker_density, Ui_MainWindow::marker_field_off, Ui_MainWindow::marker_field_on, and ui.

Referenced by ic_logic(), and MainWindow().

{
if (ui->marker_field_on->isChecked()){
ui->marker_density->setDisabled(false);
ui->marker_density->setText("0.1");
ui->ic_marker->setDisabled(false);
}
if (ui->marker_field_off->isChecked()){
ui->marker_density->setDisabled(true);
ui->marker_density->setText("0");
ui->ic_marker->setDisabled(true);
ic_marker_file = "dummy";
}
}
void MainWindow::obstacle_logic ( )
privateslot

Enables obstacles logic

Definition at line 272 of file logic_parameter.cpp.

References Ui_MainWindow::ic_obstacle, ic_obstacle_file, Ui_MainWindow::initial_conditions, Ui_MainWindow::obstacle_density, Ui_MainWindow::obstacle_diff, Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_on, Ui_MainWindow::obstacle_temp, and ui.

Referenced by ic_logic(), and MainWindow().

{
if (ui->obstacle_on->isChecked()){
ui->obstacle_density->setDisabled(false);
ui->obstacle_temp->setDisabled(false);
ui->obstacle_diff->setDisabled(false);
ui->obstacle_density->setText("7874");
ui->obstacle_temp->setText("300");
ui->obstacle_diff->setText("0.000023");
ui->ic_obstacle->setDisabled(false);
}
if (ui->obstacle_off->isChecked()){
ui->obstacle_density->setDisabled(true);
ui->obstacle_temp->setDisabled(true);
ui->obstacle_diff->setDisabled(true);
ui->obstacle_density->setText("0");
ui->obstacle_temp->setText("0");
ui->obstacle_diff->setText("0");
ui->ic_obstacle->setDisabled(true);
if (ui->initial_conditions->currentIndex()==2){
ui->initial_conditions->setCurrentIndex(0);
ui->ic_obstacle->setDisabled(true);
}
ic_obstacle_file = "dummy";
}
}
void MainWindow::open_about ( )
privateslot

Open the about tychoGUI

Definition at line 229 of file mainwindow.cpp.

References myabout.

Referenced by MainWindow().

{
myabout = new about;
myabout->show();
}
void MainWindow::open_configure_path ( )
privateslot

Open the configure_path

Definition at line 240 of file mainwindow.cpp.

References myconfigure_path.

Referenced by MainWindow().

void MainWindow::open_help1 ( )
privateslot

Open the help on Filetypes and resolution

Definition at line 149 of file mainwindow.cpp.

References myhelp1.

Referenced by MainWindow().

{
myhelp1 = new help1;
myhelp1->show();
}
void MainWindow::open_help2 ( )
privateslot

Open the help on boundary conditions

Definition at line 159 of file mainwindow.cpp.

References myhelp2.

Referenced by MainWindow().

{
myhelp2 = new help2;
myhelp2->show();
}
void MainWindow::open_help3 ( )
privateslot

Open help on timings

Definition at line 169 of file mainwindow.cpp.

References myhelp3.

Referenced by MainWindow().

{
myhelp3 = new help3;
myhelp3->show();
}
void MainWindow::open_help4 ( )
privateslot

Open help on OpenMP

Definition at line 179 of file mainwindow.cpp.

References myhelp4.

Referenced by MainWindow().

{
myhelp4 = new help4;
myhelp4->show();
}
void MainWindow::open_help5 ( )
privateslot

Open help on solver and gas physics

Definition at line 189 of file mainwindow.cpp.

References myhelp5.

Referenced by MainWindow().

{
myhelp5 = new help5;
myhelp5->show();
}
void MainWindow::open_help6 ( )
privateslot

Open help on gravity

Definition at line 199 of file mainwindow.cpp.

References myhelp6.

Referenced by MainWindow().

{
myhelp6 = new help6;
myhelp6->show();
}
void MainWindow::open_help7 ( )
privateslot

Open help on Obstacles - Winemitters and Markerfields

Definition at line 209 of file mainwindow.cpp.

References myhelp7.

Referenced by MainWindow().

{
myhelp7 = new help7;
myhelp7->show();
}
void MainWindow::open_help8 ( )
privateslot

Open help on Sound Emitter

Definition at line 219 of file mainwindow.cpp.

References myhelp8.

Referenced by MainWindow().

{
myhelp8 = new help8;
myhelp8->show();
}
void MainWindow::open_local_simulation ( )
privateslot

Open the local simulation form

Definition at line 140 of file mainwindow.cpp.

References mylocal_simulation.

Referenced by MainWindow().

void MainWindow::openfile ( )
privateslot

Saves a parameter-set into a Parameterfile

Definition at line 15 of file load_parameterfile.cpp.

References Ui_MainWindow::filename, set_parameters(), and ui.

Referenced by MainWindow().

{
QString txtfile = QFileDialog::getOpenFileName(this, tr("Open TYCHO Parameterfile"), QString::null);
ui->filename->setText(txtfile);
QList<QString> data;
QString tmp_data;
QFile file(txtfile);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream in(&file);
while (!in.atEnd()) {
tmp_data = in.readLine(0);
if ((tmp_data.contains("#"))||(tmp_data.mid(0,1) == "")) {
tmp_data.clear();
}
else {
data.append(tmp_data);
tmp_data.clear();
}
}
}
//to debug
//std::cout << "LÄNGE" << data.size() << "\n";
if (data.size() > 0 ) set_parameters(data);
data.clear();
file.close();
}
void MainWindow::output_path ( )
privateslot

Loads the output file path

Definition at line 141 of file open_initial_conditions.cpp.

References output_directory, Ui_MainWindow::output_path_line, and ui.

Referenced by MainWindow().

{
QString output_path = QFileDialog::getExistingDirectory(this, tr("The output directory"), QString::null);
if (output_path.size()==0) output_path = "/tmp/";
output_path = output_path.append("/");
}
void MainWindow::quit ( )
privateslot

Definition at line 131 of file mainwindow.cpp.

Referenced by MainWindow().

{
qApp->exit();
}
void MainWindow::reset_gui ( )
privateslot

Resets the tychoGUI

Definition at line 8 of file reset_gui.cpp.

References Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, boundary_logic(), Ui_MainWindow::cfl, Ui_MainWindow::dimension, Ui_MainWindow::end_time, Ui_MainWindow::extend_x, Ui_MainWindow::extend_y, Ui_MainWindow::extend_z, Ui_MainWindow::filename, Ui_MainWindow::filetype, Ui_MainWindow::gamma, Ui_MainWindow::gasconstant, Ui_MainWindow::gravity_off, Ui_MainWindow::ic_density, Ui_MainWindow::ic_marker, Ui_MainWindow::ic_obstacle, Ui_MainWindow::ic_temperatur, Ui_MainWindow::ic_velocity, Ui_MainWindow::ic_wind, Ui_MainWindow::initial_conditions, Ui_MainWindow::initial_velocities, initiate_ic_files(), Ui_MainWindow::marker_density, Ui_MainWindow::marker_field_off, Ui_MainWindow::obstacle_density, Ui_MainWindow::obstacle_diff, Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_temp, Ui_MainWindow::one_pulse_off, Ui_MainWindow::openmp, Ui_MainWindow::output_frequency, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, Ui_MainWindow::restart_frequency, soundemitter_logic(), soundemitter_logic_part2(), Ui_MainWindow::Soundemitter_off, Ui_MainWindow::specific_heat_capacity_gas, Ui_MainWindow::specific_heat_capacity_obstacle, Ui_MainWindow::startified_atmos_off, Ui_MainWindow::startified_atmos_on, ui, Ui_MainWindow::viscosity_off, Ui_MainWindow::wind_emitter_off, and Ui_MainWindow::wind_speed.

Referenced by MainWindow().

{
ui->filename->clear();
ui->filetype->setCurrentIndex(0);
ui->initial_conditions->setCurrentIndex(0);
ui->initial_velocities->setCurrentIndex(0);
ui->dimension->setCurrentIndex(0);
ui->res_x->setValue(64);
ui->res_y->setValue(1);
ui->res_z->setValue(1);
ui->extend_x->setText("1");
ui->extend_y->setText("0");
ui->extend_z->setText("0");
ui->ic_density->setDisabled(true);
ui->ic_temperatur->setDisabled(true);
ui->ic_velocity->setDisabled(true);
ui->ic_wind->setDisabled(true);
ui->ic_obstacle->setDisabled(true);
ui->ic_marker->setDisabled(true);
ui->bound_back->setCurrentIndex(0);
ui->bound_front->setCurrentIndex(0);
ui->bound_up->setCurrentIndex(0);
ui->bound_down->setCurrentIndex(0);
ui->bound_left->setCurrentIndex(0);
ui->bound_right->setCurrentIndex(0);
ui->bound_down->setEnabled(true);
ui->bound_up->setEnabled(true);
ui->end_time->setText("1");
ui->output_frequency->setText("0.001");
ui->restart_frequency->setText("0.01");
ui->openmp->setText("4");
ui->cfl->setText("0.3");
ui->gamma->setText("1.667");
ui->gasconstant->setText("287.058");
ui->gravity_off->setChecked(true);
ui->startified_atmos_off->setChecked(true);
ui->startified_atmos_on->setDisabled(true);
ui->startified_atmos_off->setDisabled(true);
ui->wind_emitter_off->setChecked(true);
ui->wind_speed->setText("0");
ui->wind_speed->setDisabled(true);
ui->obstacle_off->setChecked(true);
ui->obstacle_density->setText("0");
ui->obstacle_temp->setText("0");
ui->obstacle_diff->setText("0");
ui->obstacle_density->setDisabled(true);
ui->obstacle_diff->setDisabled(true);
ui->obstacle_temp->setDisabled(true);
ui->marker_field_off->setChecked(true);
ui->marker_density->setText("0");
ui->marker_density->setDisabled(true);
ui->viscosity_off->setChecked(true);
ui->Soundemitter_off->setChecked(true);
ui->one_pulse_off->setChecked(true);
}
void MainWindow::savefile ( )
privateslot

Save a parameter set into a Parameterfile

Definition at line 14 of file save_parameterfile.cpp.

References Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, boundary_selector(), Ui_MainWindow::cfl, Ui_MainWindow::dimension, Ui_MainWindow::end_time, Ui_MainWindow::extend_x, Ui_MainWindow::extend_y, Ui_MainWindow::extend_z, Ui_MainWindow::filename, Ui_MainWindow::filetype, filetype_selector(), Ui_MainWindow::gamma, Ui_MainWindow::gasconstant, Ui_MainWindow::gravity_off, Ui_MainWindow::gravity_on, ic_density_file, ic_marker_file, ic_obstacle_file, ic_selector(), ic_soundemitter_file, ic_temperature_file, ic_velocity_file, ic_windemitter_file, Ui_MainWindow::inflow_density, Ui_MainWindow::inflow_temperature, Ui_MainWindow::inflow_velocity, Ui_MainWindow::initial_conditions, Ui_MainWindow::initial_velocities, Ui_MainWindow::marker_density, Ui_MainWindow::marker_field_off, Ui_MainWindow::marker_field_on, Ui_MainWindow::obstacle_density, Ui_MainWindow::obstacle_diff, Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_on, Ui_MainWindow::obstacle_temp, Ui_MainWindow::obstacleSoundAbsoption, Ui_MainWindow::one_pulse_off, Ui_MainWindow::one_pulse_on, Ui_MainWindow::openmp, output_directory, Ui_MainWindow::output_frequency, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, Ui_MainWindow::restart_frequency, Ui_MainWindow::Soundemitter_off, Ui_MainWindow::Soundemitter_on, Ui_MainWindow::soundEmitterFrequency, Ui_MainWindow::soundPressureLevel, Ui_MainWindow::soundReflexionCoefficient, Ui_MainWindow::specific_heat_capacity_gas, Ui_MainWindow::specific_heat_capacity_obstacle, Ui_MainWindow::startified_atmos_off, Ui_MainWindow::startified_atmos_on, ui, Ui_MainWindow::viscosity_off, Ui_MainWindow::viscosity_on, Ui_MainWindow::wind_boundary_0, Ui_MainWindow::wind_boundary_1, Ui_MainWindow::wind_emitter_off, Ui_MainWindow::wind_emitter_on, and Ui_MainWindow::wind_speed.

Referenced by MainWindow().

{
QString txtfile = QFileDialog::getSaveFileName(this, tr("Save TYCHO Parameterfile"), ":", tr("Parameterfile (*.txt)"));
ui->filename->setText(txtfile);
QList<QString> data;
QFile file(txtfile);
if (file.open(QFile::WriteOnly | QFile::Truncate)) {
QTextStream out(&file);
out << "#-------WELCOME TO TYCHOS PARAMETER FILE--------------" << "\n";
out << "#COMMENTS HAVE TO START WITH #" << "\n";
out << "#THE ORDER OF PARAMETERS HERE IS MANDATORY" << "\n";
out << "#IF YOU WISH TO INCLUDE MORE PARAMETERS HERE" << "\n";
out << "#MAKE SURE TO EDIT START_FILE_READER.C" << "\n";
out << "#HAVE FUN" << "\n";
out << "#-----------------------------------------------------" << "\n";
data.clear();
out << "\n#TYCHO Files[0], VTK RECTILINEAR_GRID BINARY Files [1], AMIRA MESH [2]";
out << "\n#or IFRIT uniform scalar data files [3]\n";
data.append(ui->filetype->currentText());
out << filetype_selector(data[0]) << "\n";
out<< "\n#Make ICs by editing the source file make_ic.c yes [0]";
out << "\n#Read in initial conditions [1]";
out << "\n#Only the obstacle distribution is read in [2]";
out << "\n#A Sod Shock Tube is generated with [3]";
out << "\n#Kelvin Helmholtz instabilities in 2D [4]";
out << "\n#Your initial conditions have to be in TYCHO file format!\n";
data.append(ui->initial_conditions->currentText());
//std::cout << data[1].toUtf8().constData() << "\n";
//std::cout << ic_selector(data[1]).toUtf8().constData() << "\n";
out << ic_selector(data[1]) << "\n";
out << "\n#Initial Conditions in TYCHO file format";
out << "\n#Initial density\n";
data.append(ic_density_file);
out << data[2] << "\n";
out << "#Initial temperature\n";
data.append(ic_temperature_file);
out << data[3] << "\n";
out << "#Initial velocity\n";
data.append(ic_velocity_file);
out << data[4] << "\n";
out << "#Initial wind\n";
data.append(ic_windemitter_file);
out << data[5] << "\n";
out << "#Initial obstacle\n";
data.append(ic_obstacle_file);
out << data[6] << "\n";
out << "#Initial soundemitter\n";
data.append(ic_soundemitter_file);
out << data[7] << "\n";
out << "#Initial marker\n";
data.append(ic_marker_file);
out << data[8] << "\n";
out << "\n#Initial velocity field file present [1] or not [0]\n";
data.append(ui->initial_velocities->currentText());
if (data[9]=="Initial velocity file exists") out << "1\n";
if (data[9]=="No initial velocity file") out << "0\n";
out << "\n#Output directory\n";
data.append(output_directory);
out << data[10] << "\n";
out << "\n#Stratified Atmosphere [1] or constant Atmosphere [0]\n";
if (ui->startified_atmos_on->isChecked()){
data.append("1");
}
if (ui->startified_atmos_off->isChecked()){
data.append("0");
}
out << data[11] <<"\n";
out << "\n#Basic properties\n#Resolution\n#x y z\n";
data.append(ui->res_x->text());
out << data[12] << "\n";
data.append(ui->res_y->text());
out << data[13] << "\n";
data.append(ui->res_z->text());
out << data[14] << "\n";
out << "\n#Dimension\n" ;
data.append(ui->dimension->currentText());
out << data[15] << "\n";
out << "\n#Length scale\n#meter in x,y,z\n";
data.append(ui->extend_x->text());
out << data[16] << "\n";
data.append(ui->extend_y->text());
out << data[17] << "\n";
data.append(ui->extend_z->text());
out << data[18] << "\n";
out << "\n#Boundary conditions";
out << "\n#Boundary conditions";
out << "\n#0.....zero gradient";
out << "\n#1.....reflecting";
out << "\n#2.....small padding";
out << "\n#3.....outflow boundaries";
out << "\n#4.....inflow boundaries";
out << "\n#5.....periodic boundaries";
out << "\n#Bound.down, bound.up, bound.left, bound.right, bound.front, bound.back";
out << "\n#Bound.down is set automatically to reflecting in case gravity is";
out << "\n#switched on\n";
data.append(ui->bound_down->currentText());
out << boundary_selector(data[19]) << "\n";
data.append(ui->bound_up->currentText());
out << boundary_selector(data[20]) << "\n";
data.append(ui->bound_left->currentText());
out << boundary_selector(data[21]) << "\n";
data.append(ui->bound_right->currentText());
out << boundary_selector(data[22]) << "\n";
data.append(ui->bound_front->currentText());
out << boundary_selector(data[23]) << "\n";
data.append(ui->bound_back->currentText());
out << boundary_selector(data[24]) << "\n";
out << "\n#if inflow boundaries the inflow velocities and density";
out << "\n#inflow_velocity [m/s], inflow density [kg/m^3] and inflow temperature [K]";
out << "\n#if you want to start with the constant velocity and direction over the whole";
out << "\n#computational domain you have to set the last parameter in this section to";
out << "\n#[1] for everywhere. If you want only inflow from boundaries from the starting";
out << "\n#you have to set this parameter to [2].\n";
data.append(ui->inflow_velocity->text());
out << data[25] << "\n";
data.append(ui->inflow_density->text());
out << data[26] << "\n";
data.append(ui->inflow_temperature->text());
out << data[27] << "\n";
if (ui->wind_boundary_0->isChecked()){
data.append("2");
}
if (ui->wind_boundary_1->isChecked()){
data.append("1");
}
out << data[28] << "\n";
out << "\n#Simulation end-time in minutes\n";
data.append(ui->end_time->text());
out << data[29] << "\n";
out << "#Output frequency in seconds\n";
data.append(ui->output_frequency->text());
out << data[30] << "\n";
out << "#Restart frequency in seconds\n";
data.append(ui->restart_frequency->text());
out << data[31] << "\n";
out << "\n#CFL Number\n";
data.append(ui->cfl->text());
out << data[32] << "\n";
out << "\n#Gravity [on--1] / [off--0]\n";
if (ui->gravity_off->isChecked()){
data.append("0");
}
if (ui->gravity_on->isChecked()){
data.append("1");
}
out << data[33] <<"\n";
out << "\n#Gas constant\n";
data.append(ui->gasconstant->text());
out << data[34] << "\n";
out << "\n#Gamma factor\n";
data.append(ui->gamma->text());
out << data[35] << "\n";
out << "\n#Wind-emitters\n";
if (ui->wind_emitter_on->isChecked()){
data.append("1");
}
if (ui->wind_emitter_off->isChecked()){
data.append("0");
}
out << data[36] << "\n";
out << "\n#Wind speed [m/s]\n";
data.append(ui->wind_speed->text());
out << data[37] << "\n";
out << "\n#Number of Threads for OpenMP]\n";
data.append(ui->openmp->text());
out << data[38] << "\n";
out << "\n#With obstacle [0--off]/[1--on]\n";
if (ui->obstacle_off->isChecked()){
data.append("0");
}
if (ui->obstacle_on->isChecked()){
data.append("1");
}
out << data[39] << "\n";
out << "\n#Obstacle density [kg/m^3]\n";
data.append(ui->obstacle_density->text());
out << data[40] << "\n";
out << "\n#Obstacle temperature [K]\n";
data.append(ui->obstacle_temp->text());
out << data[41] << "\n";
out << "\n#Obstacle Thermal diffusivity [m^2/s]\n";
data.append(ui->obstacle_diff->text());
out << data[42] << "\n";
out << "\n#Specific heat capacity gas [J/kgK]\n";
data.append(ui->specific_heat_capacity_gas->text());
out << data[43] << "\n";
qDebug() << "hallo";
out << "\n#Specific_heat capacity obstacle [J/kgK]\n";
data.append(ui->specific_heat_capacity_obstacle->text());
out << data[44] << "\n";
out << "\n#A Marker Field is advected with the HYDRO Simulation [0--off]/[1--on]\n";
if (ui->marker_field_on->isChecked()){
data.append("1");
}
if (ui->marker_field_off->isChecked()){
data.append("0");
}
out << data[45] << "\n";
out << "\n#Marker density [kg/m^3]\n";
data.append(ui->marker_density->text());
out << data[46] << "\n";
out << "\n#Viscosity of gas [0--off]/[1--on]\n";
if (ui->viscosity_on->isChecked()){
data.append("1");
}
if (ui->viscosity_off->isChecked()){
data.append("0");
}
out << data[47] << "\n";
out << "\n#With_sound_emitter [0--off]/[1--on]\n";
if (ui->Soundemitter_on->isChecked()){
data.append("1");
}
if (ui->Soundemitter_off->isChecked()){
data.append("0");
}
out << data[48] << "\n";
qDebug() << "hall1";
out << "\n#Sound Pressure Level dB\n";
data.append(ui->soundPressureLevel->text());
out << data[49] << "\n";
out << "\n#With_one_pulse or periodic[0--off]/[1--on]\n";
if (ui->one_pulse_on->isChecked()){
data.append("1");
}
if (ui->one_pulse_off->isChecked()){
data.append("0");
}
out << data[50] << "\n";
out << "\n#Sound Frequency Hz\n";
data.append(ui->soundEmitterFrequency->text());
out << data[51] << "\n";
out << "\n#Sound Reflection on Obstacle coefficient\n";
data.append(ui->soundReflexionCoefficient->text());
out << data[52] << "\n";
out << "\n#Obstacle Absorption Coefficient\n";
data.append(ui->obstacleSoundAbsoption->text());
out << data[53] << "\n";
out << "\n";
out << "#--------END OF PARAMETERFILE-----------------\n";
}
file.close();
}
void MainWindow::set_parameters ( QList< QString >  data)
privateslot

Set the parameters from the specified parameterfile.

Definition at line 55 of file load_parameterfile.cpp.

References Ui_MainWindow::bound_back, Ui_MainWindow::bound_down, Ui_MainWindow::bound_front, Ui_MainWindow::bound_left, Ui_MainWindow::bound_right, Ui_MainWindow::bound_up, Ui_MainWindow::cfl, Ui_MainWindow::dimension, Ui_MainWindow::end_time, Ui_MainWindow::extend_x, Ui_MainWindow::extend_y, Ui_MainWindow::extend_z, Ui_MainWindow::filetype, Ui_MainWindow::gamma, Ui_MainWindow::gasconstant, Ui_MainWindow::gravity_off, Ui_MainWindow::gravity_on, Ui_MainWindow::ic_density, ic_density_file, Ui_MainWindow::ic_marker, ic_marker_file, Ui_MainWindow::ic_obstacle, ic_obstacle_file, Ui_MainWindow::ic_soundemitter, ic_soundemitter_file, Ui_MainWindow::ic_temperatur, ic_temperature_file, Ui_MainWindow::ic_velocity, ic_velocity_file, Ui_MainWindow::ic_wind, ic_windemitter_file, Ui_MainWindow::inflow_density, Ui_MainWindow::inflow_temperature, Ui_MainWindow::inflow_velocity, Ui_MainWindow::initial_conditions, Ui_MainWindow::initial_velocities, Ui_MainWindow::marker_density, Ui_MainWindow::marker_field_off, Ui_MainWindow::marker_field_on, Ui_MainWindow::obstacle_density, Ui_MainWindow::obstacle_diff, Ui_MainWindow::obstacle_off, Ui_MainWindow::obstacle_on, Ui_MainWindow::obstacle_temp, Ui_MainWindow::obstacleSoundAbsoption, Ui_MainWindow::one_pulse_off, Ui_MainWindow::one_pulse_on, Ui_MainWindow::openmp, output_directory, Ui_MainWindow::output_frequency, Ui_MainWindow::output_path_line, Ui_MainWindow::res_x, Ui_MainWindow::res_y, Ui_MainWindow::res_z, Ui_MainWindow::restart_frequency, soundemitter_logic(), soundemitter_logic_part2(), Ui_MainWindow::Soundemitter_off, Ui_MainWindow::Soundemitter_on, Ui_MainWindow::soundEmitterFrequency, Ui_MainWindow::soundPressureLevel, Ui_MainWindow::soundReflexionCoefficient, Ui_MainWindow::specific_heat_capacity_gas, Ui_MainWindow::specific_heat_capacity_obstacle, Ui_MainWindow::startified_atmos_off, Ui_MainWindow::startified_atmos_on, ui, Ui_MainWindow::viscosity_off, Ui_MainWindow::viscosity_on, Ui_MainWindow::wind_boundary_0, Ui_MainWindow::wind_boundary_1, Ui_MainWindow::wind_emitter_off, Ui_MainWindow::wind_emitter_on, and Ui_MainWindow::wind_speed.

Referenced by openfile().

{
//to debug
/*
QString tmp;
for (int i=0; i<data.size(); ++i){
tmp = data[i];
std::cout << tmp.toUtf8().constData() << " index:" << i << "\n";
tmp.clear();
}
*/
//set fileformat
ui->filetype->setCurrentIndex(data[0].toInt());
//set IC generator
ui->initial_conditions->setCurrentIndex(data[1].toInt());
//set IC files
ic_density_file = data[2];
//if file given, make the loading buttons active
if (data[2]!="dummy") ui->ic_density->setEnabled(true);
//if file given, make the loading buttons active
if (data[3]!="dummy") ui->ic_temperatur->setEnabled(true);
ic_velocity_file = data[4];
//if file given, make the loading buttons active
if (data[4]!="dummy") ui->ic_velocity->setEnabled(true);
//if file given, make the loading buttons active
if (data[5]!="dummy") ui->ic_wind->setEnabled(true);
ic_obstacle_file = data[6];
//if file given, make the loading buttons active
if (data[6]!="dummy") ui->ic_obstacle->setEnabled(true);
//if file given, make the loading buttons active
if (data[7]!="dummy") ui->ic_soundemitter->setEnabled(true);
ic_marker_file = data[8];
//if file given, make the loading buttons active
if (data[8]!="dummy") ui->ic_marker->setEnabled(true);
//set initial velocities
ui->initial_velocities->setCurrentIndex(data[9].toInt());
//output_directory
output_directory = data[10];
//stratified atmosphere
if (data[11]=="1"){
ui->startified_atmos_on->setChecked(true);
ui->startified_atmos_off->setChecked(false);
}
if (data[11]=="0"){
ui->startified_atmos_on->setChecked(false);
ui->startified_atmos_off->setChecked(true);
}
//set Resolution
ui->res_x->setValue(data[12].toInt());
ui->res_y->setValue(data[13].toInt());
ui->res_z->setValue(data[14].toInt());
//set Dimension
ui->dimension->setCurrentIndex(data[15].toInt()-1);
//set physical extend
ui->extend_x->setText(data[16]);
ui->extend_y->setText(data[17]);
ui->extend_z->setText(data[18]);
//set boundary conditions
ui->bound_down->setCurrentIndex(data[19].toInt());
ui->bound_up->setCurrentIndex(data[20].toInt());
ui->bound_left->setCurrentIndex(data[21].toInt());
ui->bound_right->setCurrentIndex(data[22].toInt());
ui->bound_front->setCurrentIndex(data[23].toInt());
ui->bound_back->setCurrentIndex(data[24].toInt());
//set inflow conditions
ui->inflow_velocity->setText(data[25]);
ui->inflow_density->setText(data[27]);
ui->inflow_temperature->setText(data[28]);
if (data[28]=="1"){
ui->wind_boundary_1 ->setChecked(true);
ui->wind_boundary_0 ->setChecked(false);
}
if (data[28]=="2"){
ui->wind_boundary_1->setChecked(false);
ui->wind_boundary_0->setChecked(true);
}
//Timing
ui->end_time->setText(data[29]);
ui->output_frequency->setText(data[30]);
ui->restart_frequency->setText(data[31]);
//CFL
ui->cfl->setText(data[32]);
//Gravity
if (data[33]=="1"){
ui->gravity_on->setChecked(true);
ui->gravity_off->setChecked(false);
}
if (data[33]=="0"){
ui->gravity_off->setChecked(true);
ui->gravity_on->setChecked(false);
}
//Gasconstant
ui->gasconstant->setText(data[34]);
//Gammafactor
ui->gamma->setText(data[35]);
//Windemitters
if (data[36]=="1"){
ui->wind_emitter_on->setChecked(true);
ui->wind_emitter_off->setChecked(false);
ui->wind_speed->setEnabled(true);
}
if (data[36]=="0"){
ui->wind_emitter_on->setChecked(false);
ui->wind_emitter_off->setChecked(true);
}
//wind-speed
ui->wind_speed->setText(data[37]);
//OpenMP Threads
ui->openmp->setText(data[38]);
//obstacles
if (data[39]=="1"){
ui->obstacle_on->setChecked(true);
ui->obstacle_off->setChecked(false);
}
if (data[39]=="0"){
ui->obstacle_on->setChecked(false);
ui->obstacle_off->setChecked(true);
}
//obstacle dens
ui->obstacle_density->setText(data[40]);
//obstacle temperature
ui->obstacle_temp->setText(data[41]);
//obstacle diffusion
ui->obstacle_diff->setText(data[42]);
//specific heat capacity gas
ui->specific_heat_capacity_gas->setText(data[43]);
//specific_heat capacity obstacle
ui->specific_heat_capacity_obstacle->setText(data[44]);
//Markerfield
if (data[45]=="1"){
ui->marker_field_on->setChecked(true);
ui->marker_field_off->setChecked(false);
}
if (data[45]=="0"){
ui->marker_field_on->setChecked(false);
ui->marker_field_off->setChecked(true);
}
//markerfield density
ui->marker_density->setText(data[45]);
//gas viscosity
if (data[47]=="1"){
ui->viscosity_on->setChecked(true);
ui->viscosity_off->setChecked(false);
}
if (data[47]=="0"){
ui->viscosity_on->setChecked(false);
ui->viscosity_off->setChecked(true);
}
//sound emitter
if (data[48]=="1"){
ui->Soundemitter_on->setChecked(true);
ui->Soundemitter_off->setChecked(false);
}
if (data[48]=="0"){
ui->Soundemitter_on->setChecked(false);
ui->Soundemitter_off->setChecked(true);
}
//soundPressureLevel
ui->soundPressureLevel->setText(data[49]);
//sound emitter
if (data[50]=="1"){
ui->one_pulse_on->setChecked(true);
ui->one_pulse_off->setChecked(false);
}
if (data[50]=="0"){
ui->one_pulse_on->setChecked(false);
ui->one_pulse_off->setChecked(true);
}
ui->soundEmitterFrequency->setText(data[51]);
ui->soundReflexionCoefficient->setText(data[52]);
ui->obstacleSoundAbsoption->setText(data[53]);
}
void MainWindow::soundemitter_logic ( )
privateslot

Enables soundemitter logic

Definition at line 331 of file logic_parameter.cpp.

References Ui_MainWindow::ic_soundemitter, ic_soundemitter_file, Ui_MainWindow::obstacleSoundAbsoption, soundemitter_logic_part2(), Ui_MainWindow::Soundemitter_off, Ui_MainWindow::Soundemitter_on, Ui_MainWindow::soundEmitterFrequency, Ui_MainWindow::soundPressureLevel, Ui_MainWindow::soundReflexionCoefficient, and ui.

Referenced by MainWindow(), reset_gui(), and set_parameters().

{
if (ui->Soundemitter_on->isChecked()){
ui->ic_soundemitter->setEnabled(true);
ui->soundReflexionCoefficient->setEnabled(true);
ui->soundPressureLevel->setEnabled(true);
ui->obstacleSoundAbsoption->setEnabled(true);
}
if (ui->Soundemitter_off->isChecked()){
ui->ic_soundemitter->setEnabled(false);
ui->soundEmitterFrequency->setEnabled(false);
ui->soundReflexionCoefficient->setEnabled(false);
ui->soundPressureLevel->setEnabled(false);
ui->obstacleSoundAbsoption->setEnabled(false);
ui->soundEmitterFrequency->setText("0");
ui->soundReflexionCoefficient->setText("0");
ui->obstacleSoundAbsoption->setText("0");
ui->soundPressureLevel->setText("0");
}
}
void MainWindow::soundemitter_logic_part2 ( )
privateslot

Enables soundemitter logic part2

Definition at line 359 of file logic_parameter.cpp.

References Ui_MainWindow::one_pulse_off, Ui_MainWindow::one_pulse_on, Ui_MainWindow::Soundemitter_off, Ui_MainWindow::Soundemitter_on, Ui_MainWindow::soundEmitterFrequency, and ui.

Referenced by MainWindow(), reset_gui(), set_parameters(), and soundemitter_logic().

{
if (ui->one_pulse_off->isChecked()){
if (ui->Soundemitter_on->isChecked()) ui->soundEmitterFrequency->setEnabled(true);
if (ui->Soundemitter_off->isChecked()) ui->soundEmitterFrequency->setEnabled(false);
}
if (ui->one_pulse_on->isChecked()){
ui->soundEmitterFrequency->setEnabled(false);
ui->soundEmitterFrequency->setText("0");
}
}
void MainWindow::windemitter_logic ( )
privateslot

Enbales Wind-emitter input

Definition at line 253 of file logic_parameter.cpp.

References Ui_MainWindow::ic_wind, ic_windemitter_file, ui, Ui_MainWindow::wind_emitter_off, Ui_MainWindow::wind_emitter_on, and Ui_MainWindow::wind_speed.

Referenced by ic_logic(), and MainWindow().

{
if (ui->wind_emitter_off->isChecked()){
ui->wind_speed->setDisabled(true);
ui->wind_speed->setText("0");
}
if (ui->wind_emitter_on->isChecked()) ui->wind_speed->setDisabled(false);
if (ui->wind_emitter_on->isChecked()) ui->ic_wind->setDisabled(false);
if (ui->wind_emitter_off->isChecked()){
ui->ic_wind->setDisabled(true);
}
}

Field Documentation

QString MainWindow::ic_density_file
private

Definition at line 93 of file mainwindow.h.

Referenced by ic_density(), initiate_ic_files(), savefile(), and set_parameters().

QString MainWindow::ic_marker_file
private

Definition at line 98 of file mainwindow.h.

Referenced by ic_marker(), initiate_ic_files(), marker_logic(), savefile(), and set_parameters().

QString MainWindow::ic_obstacle_file
private

Definition at line 97 of file mainwindow.h.

Referenced by ic_obstacle(), initiate_ic_files(), obstacle_logic(), savefile(), and set_parameters().

QString MainWindow::ic_soundemitter_file
private

Definition at line 99 of file mainwindow.h.

Referenced by ic_soundemitter(), initiate_ic_files(), savefile(), set_parameters(), and soundemitter_logic().

QString MainWindow::ic_temperature_file
private

Definition at line 94 of file mainwindow.h.

Referenced by ic_temperature(), initiate_ic_files(), savefile(), and set_parameters().

QString MainWindow::ic_velocity_file
private

Definition at line 95 of file mainwindow.h.

Referenced by ic_velocity(), initiate_ic_files(), savefile(), and set_parameters().

QString MainWindow::ic_windemitter_file
private

Definition at line 96 of file mainwindow.h.

Referenced by ic_wind(), initiate_ic_files(), savefile(), set_parameters(), and windemitter_logic().

about* MainWindow::myabout
private

Definition at line 91 of file mainwindow.h.

Referenced by open_about().

configure_path* MainWindow::myconfigure_path
private

Definition at line 88 of file mainwindow.h.

Referenced by open_configure_path().

help1* MainWindow::myhelp1
private

Definition at line 79 of file mainwindow.h.

Referenced by open_help1().

help2* MainWindow::myhelp2
private

Definition at line 80 of file mainwindow.h.

Referenced by open_help2().

help3* MainWindow::myhelp3
private

Definition at line 81 of file mainwindow.h.

Referenced by open_help3().

help4* MainWindow::myhelp4
private

Definition at line 82 of file mainwindow.h.

Referenced by open_help4().

help5* MainWindow::myhelp5
private

Definition at line 83 of file mainwindow.h.

Referenced by open_help5().

help6* MainWindow::myhelp6
private

Definition at line 84 of file mainwindow.h.

Referenced by open_help6().

help7* MainWindow::myhelp7
private

Definition at line 85 of file mainwindow.h.

Referenced by open_help7().

help8* MainWindow::myhelp8
private

Definition at line 86 of file mainwindow.h.

Referenced by open_help8().

local_simulation* MainWindow::mylocal_simulation
private

Definition at line 89 of file mainwindow.h.

Referenced by open_local_simulation().

QString MainWindow::output_directory
private

Definition at line 100 of file mainwindow.h.

Referenced by initiate_ic_files(), output_path(), savefile(), and set_parameters().

bool MainWindow::resolution_is_yet_determined

Definition at line 31 of file mainwindow.h.

Referenced by check_resolution(), and MainWindow().

Ui::MainWindow* MainWindow::ui
private

Definition at line 77 of file mainwindow.h.

Referenced by boundary_logic(), check_resolution(), dimension_logic(), gravity_logic(), ic_logic(), initiate_ic_files(), MainWindow(), marker_logic(), obstacle_logic(), openfile(), output_path(), reset_gui(), savefile(), set_parameters(), soundemitter_logic(), soundemitter_logic_part2(), windemitter_logic(), and ~MainWindow().

int MainWindow::x_res

Definition at line 30 of file mainwindow.h.

Referenced by check_resolution(), and MainWindow().

int MainWindow::y_res

Definition at line 30 of file mainwindow.h.

Referenced by check_resolution(), and MainWindow().

int MainWindow::z_res

Definition at line 30 of file mainwindow.h.

Referenced by check_resolution(), and MainWindow().


The documentation for this class was generated from the following files: