diff --git a/sdpm/api/core.py b/sdpm/api/core.py index f0bbb3c07a8e7cea64740e3e0db8b3ae10a12b71..10a355e658bf346726889797414fa4dcc8ad4311 100644 --- a/sdpm/api/core.py +++ b/sdpm/api/core.py @@ -58,14 +58,14 @@ def init_sdpm(cfg, use_ad=False): raise RuntimeError('Symmetric (half) geometric model cannot be used with nonzero angle of sideslip (AoS)!\n') # Mesh - pars = {} if 'Pars' not in cfg else cfg['Pars'] + pars = cfg.get('Pars', {}) _msh = MeshLoader(cfg['File']).run(pars) _wrt = sdpm.GmshExport(_msh) # Problem - aoa = 0 if 'AoA' not in cfg else cfg['AoA'] * math.pi / 180 - aos = 0 if 'AoS' not in cfg else cfg['AoS'] * math.pi / 180 - minf = 0 if 'Mach' not in cfg else cfg['Mach'] + aoa = cfg.get('AoA', 0.) * math.pi / 180 + aos = cfg.get('AoS', 0.) * math.pi / 180 + minf = cfg.get('Mach', 0.) _pbl = sdpm.Problem(_msh) _pbl.setGeometry(cfg['s_ref'], cfg['c_ref'], cfg['x_ref'], cfg['y_ref'], cfg['z_ref'], cfg['Symmetry']) _pbl.setFreestream(aoa, aos, minf) @@ -85,7 +85,7 @@ def init_sdpm(cfg, use_ad=False): _pbl.addBody(_bdy) # Solver - vrb = cfg['Verb_lvl'] if 'Verb_lvl' in cfg else 1 + vrb = cfg.get('Verb_lvl', 1) _sol = sdpm.Solver(_pbl, vrb) if 'Transonic_pressure_grad' not in cfg else sdpm.SolverTransonic(_pbl, vrb) _adj = sdpm.Adjoint(_sol) if use_ad else None diff --git a/sdpm/src/sdpmSolver.cpp b/sdpm/src/sdpmSolver.cpp index 17cd2ddf059a2a18aa46abf66d35a11677c16956..4953c5b48b8e65e4c2c19a88208e74d5f0f3eda2 100644 --- a/sdpm/src/sdpmSolver.cpp +++ b/sdpm/src/sdpmSolver.cpp @@ -34,7 +34,7 @@ Solver::Solver(Problem &pbl, int vrb) : _pbl(pbl), _vrb(vrb), _cl(0), _cd(0), _c // Say hi std::cout << std::endl; std::cout << "*******************************************************************************" << std::endl; - std::cout << "** Hi! My name is SDPM v1.1-2401 **" << std::endl; + std::cout << "** Hi! My name is SDPM v1.2-2412 **" << std::endl; std::cout << "** ULiege 2023-2024 **" << std::endl; std::cout << "*******************************************************************************" << std::endl; diff --git a/sdpm/src/sdpmSolver.h b/sdpm/src/sdpmSolver.h index ee6d5649538c1c48bd155049a4c1097d4cd7280b..ab5cc32eb10585b3df7a5e30664b7230fff81ba6 100644 --- a/sdpm/src/sdpmSolver.h +++ b/sdpm/src/sdpmSolver.h @@ -39,7 +39,7 @@ protected: int _vrb; ///< verbosity level // AICs size_t _nP; ///< number of body panels - std::map<Element *, int> _rows; ///< map linking an element to a matrix cell + std::map<Element *, int> _rows; ///< map linking an element to a matrix entry sdpmMatrixXd _A0; ///< zero-frequency body-body doublet matrix sdpmMatrixXd _B0; ///< zero-frequency body-body source matrix std::vector<sdpmMatrixXcd> _A; ///< unsteady body-body doublet matrix diff --git a/sdpm/src/sdpmSolverTransonic.h b/sdpm/src/sdpmSolverTransonic.h index f69da67e2102f3855b1340518f6f5f39cbd2f053..e803db7fa67cef56bc4054eb138499d84385feaa 100644 --- a/sdpm/src/sdpmSolverTransonic.h +++ b/sdpm/src/sdpmSolverTransonic.h @@ -31,7 +31,7 @@ namespace sdpm */ class SDPM_API SolverTransonic : public Solver { - std::map<Node *, int> _rowsN; ///< map linking a node to a matrix cell + std::map<Node *, int> _rowsN; ///< map linking a node to a matrix entry sdpmVectorXd _dCorr; ///< transonic correction terms public: