Skip to content

Commit

Permalink
Merge pull request #113 from doluk/fix_fematch_advanced
Browse files Browse the repository at this point in the history
Fix: Changing band volume in advanced dialog has no effect
  • Loading branch information
ehb54 authored Jun 20, 2024
2 parents 7b2d4c4 + 3839e4f commit 15d3fa8
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 70 deletions.
20 changes: 10 additions & 10 deletions programs/us_autoflow_analysis/us_autoflow_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2039,9 +2039,9 @@ void US_Analysis_auto::simulateModel( )

qDebug() << "SimMdl: speed_steps:" << simparams.speed_step.size();

QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bndvolume" ];
QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bandvolume" ];


if ( gtyp.contains( "Constant" ) )
Expand Down Expand Up @@ -2685,13 +2685,13 @@ void US_Analysis_auto::show_overlay( QString triple_stage )

dbg_level = US_Settings::us_debug();

adv_vals[ "simpoints" ] = "500";
adv_vals[ "bndvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";
adv_vals[ "simpoints" ] = "500";
adv_vals[ "bandvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";

resids.clear();
dataLoaded = false;
Expand Down
62 changes: 31 additions & 31 deletions programs/us_fematch/us_advanced_fem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ US_AdvancedFem::US_AdvancedFem( US_Model* amodel,
mainLayout->setSpacing ( 2 );
mainLayout->setContentsMargins( 2, 2, 2, 2 );

QLabel* lb_analysis = us_banner( tr( "Advanced Analysis" ) );
QLabel* lb_simpoints = us_label( tr( "Simulation Points:" ) );
QLabel* lb_bldvolume = us_label( tr( "Band-loading Volume:" ) );
QLabel* lb_parameter = us_label( tr( "Parameter:" ) );
QLabel* lb_analysis = us_banner( tr( "Advanced Analysis" ) );
QLabel* lb_simpoints = us_label( tr( "Simulation Points:" ) );
QLabel* lb_bandvolume = us_label( tr( "Band-loading Volume:" ) );
QLabel* lb_parameter = us_label( tr( "Parameter:" ) );

ct_simpoints = us_counter( 3, 0, 10000, 1 );
ct_bldvolume = us_counter( 3, 0, 1, 0.001 );
ct_parameter = us_counter( 2, 1, 50, 1 );
ct_simpoints = us_counter( 3, 0, 10000, 1 );
ct_bandvolume = us_counter( 3, 0, 1, 0.001 );
ct_parameter = us_counter( 2, 1, 50, 1 );

cb_mesh = us_comboBox();
cb_mesh->addItem( "Adaptive Space Time Mesh (ASTFEM)" );
Expand All @@ -50,25 +50,25 @@ US_AdvancedFem::US_AdvancedFem( US_Model* amodel,
QPushButton* pb_accept = us_pushbutton( tr( "Accept" ) );

int row = 0;
mainLayout->addWidget( lb_analysis, row++, 0, 1, 6 );
mainLayout->addWidget( lb_simpoints, row, 0, 1, 3 );
mainLayout->addWidget( ct_simpoints, row++, 3, 1, 3 );
mainLayout->addWidget( lb_bldvolume, row, 0, 1, 3 );
mainLayout->addWidget( ct_bldvolume, row++, 3, 1, 3 );
mainLayout->addWidget( lb_parameter, row, 0, 1, 3 );
mainLayout->addWidget( ct_parameter, row++, 3, 1, 3 );
mainLayout->addWidget( cb_mesh, row++, 0, 1, 6 );
mainLayout->addWidget( cb_grid, row++, 0, 1, 6 );
mainLayout->addWidget( pb_help, row, 0, 1, 2 );
mainLayout->addWidget( pb_cancel, row, 2, 1, 2 );
mainLayout->addWidget( pb_accept, row++, 4, 1, 2 );

ct_simpoints->setValue( parmap[ "simpoints" ].toDouble() );
ct_bldvolume->setValue( parmap[ "bldvolume" ].toDouble() );
ct_parameter->setValue( parmap[ "parameter" ].toDouble() );
ct_simpoints->setSingleStep( 5 );
ct_bldvolume->setSingleStep( 0.001 );
ct_parameter->setSingleStep( 1 );
mainLayout->addWidget( lb_analysis, row++, 0, 1, 6 );
mainLayout->addWidget( lb_simpoints, row, 0, 1, 3 );
mainLayout->addWidget( ct_simpoints, row++, 3, 1, 3 );
mainLayout->addWidget( lb_bandvolume, row, 0, 1, 3 );
mainLayout->addWidget( ct_bandvolume, row++, 3, 1, 3 );
mainLayout->addWidget( lb_parameter, row, 0, 1, 3 );
mainLayout->addWidget( ct_parameter, row++, 3, 1, 3 );
mainLayout->addWidget( cb_mesh, row++, 0, 1, 6 );
mainLayout->addWidget( cb_grid, row++, 0, 1, 6 );
mainLayout->addWidget( pb_help, row, 0, 1, 2 );
mainLayout->addWidget( pb_cancel, row, 2, 1, 2 );
mainLayout->addWidget( pb_accept, row++, 4, 1, 2 );

ct_simpoints ->setValue( parmap[ "simpoints" ].toDouble() );
ct_bandvolume->setValue( parmap[ "bandvolume" ].toDouble() );
ct_parameter ->setValue( parmap[ "parameter" ].toDouble() );
ct_simpoints ->setSingleStep( 5 );
ct_bandvolume->setSingleStep( 0.001 );
ct_parameter ->setSingleStep( 1 );

connect( pb_help, SIGNAL( clicked() ),
this, SLOT( help() ) );
Expand All @@ -88,11 +88,11 @@ qDebug() << "AdvF:Post-resize size" << size();
// private slot to pass parameters then close with an accepted() signal
void US_AdvancedFem::done( void )
{
parmap[ "simpoints" ] = QString::number( ct_simpoints->value() );
parmap[ "bldvolume" ] = QString::number( ct_bldvolume->value() );
parmap[ "parameter" ] = QString::number( ct_parameter->value() );
parmap[ "meshtype" ] = cb_mesh->currentText();
parmap[ "gridtype" ] = cb_grid->currentText();
parmap[ "simpoints" ] = QString::number( ct_simpoints ->value() );
parmap[ "bandvolume" ] = QString::number( ct_bandvolume->value() );
parmap[ "parameter" ] = QString::number( ct_parameter ->value() );
parmap[ "meshtype" ] = cb_mesh->currentText();
parmap[ "gridtype" ] = cb_grid->currentText();

accept();
}
Expand Down
18 changes: 9 additions & 9 deletions programs/us_fematch/us_advanced_fem.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ class US_AdvancedFem : public US_WidgetsDialog
QWidget* p = 0 );

private:
US_Model* model;
QMap< QString, QString >& parmap;
US_Model* model; //! \brief Pointer to model
QMap< QString, QString >& parmap; //! \brief Reference to advanced dialog values

QGridLayout* mainLayout;
QGridLayout* mainLayout; //! \brief Pointer to main layout

QWidget* parentw;
QWidget* parentw; //! \brief Pointer to parent widget

QwtCounter* ct_simpoints;
QwtCounter* ct_bldvolume;
QwtCounter* ct_parameter;
QwtCounter* ct_simpoints; //! \brief Number of simulation points
QwtCounter* ct_bandvolume; //! \brief Band-loading volume
QwtCounter* ct_parameter; //! \brief Parameter

QComboBox* cb_mesh;
QComboBox* cb_grid;
QComboBox* cb_mesh; //! \brief Mesh type
QComboBox* cb_grid; //! \brief Grid type

protected:
US_Help showHelp;
Expand Down
20 changes: 10 additions & 10 deletions programs/us_fematch/us_fematch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ US_FeMatch::US_FeMatch() : US_Widgets()
ti_noise.count = 0;
ri_noise.count = 0;

adv_vals[ "simpoints" ] = "500";
adv_vals[ "bndvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";
adv_vals[ "simpoints" ] = "500";
adv_vals[ "bandvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";

sdata = &wsdata;

Expand Down Expand Up @@ -2100,9 +2100,9 @@ DbgLv(1) << "SimMdl: simpoints" << simparams.simpoints

DbgLv(1) << "SimMdl: speed_steps:" << simparams.speed_step.size();

QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bndvolume" ];
QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bandvolume" ];

#if 0
if ( mtyp.contains( "Claverie" ) )
Expand Down
20 changes: 10 additions & 10 deletions programs/us_reporter_gmp/us_reporter_gmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3836,13 +3836,13 @@ void US_ReporterGMP::simulate_triple( const QString triplesname, QString stage_m

dbg_level = US_Settings::us_debug();

adv_vals[ "simpoints" ] = "500";
adv_vals[ "bndvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";
adv_vals[ "simpoints" ] = "500";
adv_vals[ "bandvolume" ] = "0.015";
adv_vals[ "parameter" ] = "0";
adv_vals[ "modelnbr" ] = "0";
adv_vals[ "meshtype" ] = "ASTFEM";
adv_vals[ "gridtype" ] = "Moving";
adv_vals[ "modelsim" ] = "mean";

resids.clear();
dataLoaded = false;
Expand Down Expand Up @@ -4983,9 +4983,9 @@ void US_ReporterGMP::simulateModel( QMap < QString, QString> & tripleInfo )

qDebug() << "SimMdl: speed_steps:" << simparams.speed_step.size();

QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bndvolume" ];
QString mtyp = adv_vals[ "meshtype" ];
QString gtyp = adv_vals[ "gridtype" ];
QString bvol = adv_vals[ "bandvolume" ];


if ( gtyp.contains( "Constant" ) )
Expand Down

0 comments on commit 15d3fa8

Please sign in to comment.