Documentation a537f1bdf2
Loading...
Searching...
No Matches
CDriverBase.hpp
Go to the documentation of this file.
1/*!
2 * \file CDriverBase.hpp
3 * \brief Base class for all drivers.
4 * \author H. Patel, A. Gastaldi
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include <limits>
31#include "../../../Common/include/CConfig.hpp"
32#include "../../../Common/include/containers/CPyWrapperMatrixView.hpp"
33#include "../numerics/CNumerics.hpp"
34#include "../output/COutput.hpp"
35#include "../solvers/CSolver.hpp"
36
37/*!
38 * \class CDriverBase
39 * \ingroup Drivers
40 * \brief Base class for all drivers.
41 * \author H. Patel, A. Gastaldi
42 */
44 protected:
45 int rank, /*!< \brief MPI Rank. */
46 size; /*!< \brief MPI Size. */
47 char* config_file_name; /*!< \brief Configuration file name of the problem. */
48
49 su2double StartTime, /*!< \brief Start point of the timer for performance benchmarking. */
50 StopTime, /*!< \brief Stop point of the timer for performance benchmarking. */
51 UsedTimePreproc, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking preprocessing
52 phase. */
53 UsedTimeCompute, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking compute phase. */
54 UsedTime; /*!< \brief Elapsed time between Start and Stop point of the timer. */
55
56 unsigned long TimeIter;
57 unsigned short selected_zone = ZONE_0; /*!< \brief Selected zone for the driver. Defaults to ZONE_0 */
58 unsigned short iMesh, /*!< \brief Iterator on mesh levels. */
59 iZone, /*!< \brief Iterator on zones. */
60 nZone, /*!< \brief Total number of zones in the problem. */
61 nDim, /*!< \brief Number of dimensions. */
62 iInst, /*!< \brief Iterator on instance levels. */
63 *nInst; /*!< \brief Total number of instances in the problem (per zone). */
64
65 CConfig* driver_config = nullptr; /*!< \brief Definition of the driver configuration. */
66 COutput* driver_output = nullptr; /*!< \brief Definition of the driver output. */
67
68 CConfig** config_container; /*!< \brief Definition of the particular problem. */
69 COutput** output_container; /*!< \brief Pointer to the COutput class. */
70 CGeometry**** geometry_container; /*!< \brief Geometrical definition of the problem. */
71 CSolver***** solver_container; /*!< \brief Container vector with all the solutions. */
72 CNumerics****** numerics_container; /*!< \brief Description of the numerical method (the way in which the equations
73 are solved). */
74 CSurfaceMovement** surface_movement; /*!< \brief Surface movement classes of the problem. */
75 CVolumetricMovement*** grid_movement; /*!< \brief Volume grid movement classes of the problem. */
76
77 CConfig* main_config = nullptr; /*!< \brief Reference to base (i.e. ZONE 0) configuration (used in driver API). */
78 CGeometry* main_geometry = nullptr; /*!< \brief Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API). */
79
80 public:
81 /*!
82 * \brief Constructor of the class.
83 * \param[in] confFile - Configuration file name.
84 * \param[in] val_nZone - Total number of zones.
85 * \param[in] MPICommunicator - MPI communicator for SU2.
86 */
87 CDriverBase(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);
88
89 /*!
90 * \brief Destructor of the class.
91 */
92 virtual ~CDriverBase(void);
93
94 /*!
95 * \brief A virtual member.
96 */
97 virtual void Run(){}
98
99 /*!
100 * \brief A virtual member.
101 */
102 virtual void Finalize(){}
103
104/// \addtogroup PySU2
105/// @{
106
107 /*!
108 * \brief Get the list of available outputs.
109 * \return List of output names.
110 */
111 inline vector<string> GetOutputNames() const { return output_container[MESH_0]->GetHistoryOutputList(); }
112
113 /*!
114 * \brief Get the value of one of the available history outputs.
115 * \return Value of the output.
116 */
117 inline passivedouble GetOutputValue(const std::string& output_name) const {
118 return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValue(output_name));
119 }
120
121 /*!
122 * \brief Get the list of available surface outputs on **both** MARKER_MONITORING and MARKER_ANALYZE.
123 * \return List of surface output names.
124 */
125 inline vector<string> GetMarkerOutputNames() const {
127 }
128
129 /*!
130 * \brief Get the value of one of the available surface outputs at a given MARKER_MONITORING.
131 * \return Value of the output.
132 */
133 inline passivedouble GetMarkerMonitoringOutputValue(const std::string& output_name,
134 const std::string& marker_monitoring) const {
135 for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Monitoring(); ++iMarker) {
136 if (marker_monitoring == main_config->GetMarker_Monitoring_TagBound(iMarker))
137 return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker));
138 }
139 SU2_MPI::Error(marker_monitoring + " is not in MARKER_MONITORING.", CURRENT_FUNCTION);
140 return 0;
141 }
142
143 /*!
144 * \brief Get the value of one of the available surface outputs at a given MARKER_ANALYZE.
145 * \return Value of the output.
146 */
147 inline passivedouble GetMarkerAnalyzeOutputValue(const std::string& output_name,
148 const std::string& marker_analyze) const {
149 for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Analyze(); ++iMarker) {
150 if (marker_analyze == main_config->GetMarker_Analyze_TagBound(iMarker))
151 return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker));
152 }
153 SU2_MPI::Error(marker_analyze + " is not in MARKER_ANALYZE.", CURRENT_FUNCTION);
154 return 0;
155 }
156
157 /*!
158 * \brief Get the number of design variables.
159 * \return Number of design variables.
160 */
161 unsigned short GetNumberDesignVariables() const;
162
163 /*!
164 * \brief Get the number of FFD boxes.
165 * \return Number of FFD boxes.
166 */
167 unsigned short GetNumberFFDBoxes() const;
168
169 /*!
170 * \brief Get the number of dimensions of the mesh.
171 * \return Number of dimensions.
172 */
173 unsigned long GetNumberDimensions() const;
174
175 /*!
176 * \brief Get the number of elements in the mesh.
177 * \return Number of elements.
178 */
179 unsigned long GetNumberElements() const;
180
181 /*!
182 * \brief Get the global index of a mesh element.
183 * \param[in] iElem - Mesh element index.
184 * \return Global element index.
185 */
186 unsigned long GetElementGlobalIndex(unsigned long iElem) const;
187
188 /*!
189 * \brief Get the node indices of a mesh element.
190 * \param[in] iElem - Mesh element index.
191 * \return Element node indices (nNode).
192 */
193 vector<unsigned long> GetElementNodes(unsigned long iElem) const;
194
195 /*!
196 * \brief Get the number of nodes in the mesh (including halos).
197 * \return Number of nodes.
198 */
199 unsigned long GetNumberNodes() const;
200
201 /*!
202 * \brief Get the number of halo nodes in the mesh.
203 * \return Number of halo nodes.
204 */
205 unsigned long GetNumberHaloNodes() const;
206
207 /*!
208 * \brief Get the global node index.
209 * \param[in] iPoint - Mesh node index.
210 * \return Global node index.
211 */
212 unsigned long GetNodeGlobalIndex(unsigned long iPoint) const;
213
214 /*!
215 * \brief Get the halo flag of a mesh node.
216 * \param[in] iPoint - Mesh node index.
217 * \return Node domain flag.
218 */
219 bool GetNodeDomain(unsigned long iPoint) const;
220
221 /*!
222 * \brief Get a read-only view of the initial (undeformed) coordinates of all mesh nodes.
223 */
225 if (!main_config->GetDeform_Mesh()) {
226 SU2_MPI::Error("Initial coordinates are only available with DEFORM_MESH= YES", CURRENT_FUNCTION);
227 }
228 auto* coords =
230 return CPyWrapperMatrixView(*coords, "InitialCoordinates", true);
231 }
232
233 /*!
234 * \brief Get a read-only view of the initial (undeformed) coordinates of the mesh nodes of a marker.
235 */
236 inline CPyWrapperMarkerMatrixView MarkerInitialCoordinates(unsigned short iMarker) const {
237 if (!main_config->GetDeform_Mesh()) {
238 SU2_MPI::Error("Initial coordinates are only available with DEFORM_MESH= YES", CURRENT_FUNCTION);
239 }
240 if (iMarker >= GetNumberMarkers()) SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION);
241
242 auto* coords =
244 return CPyWrapperMarkerMatrixView(*coords, main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
245 "MarkerInitialCoordinates", true);
246 }
247
248 /*!
249 * \brief Get a read/write view of the current coordinates of all mesh nodes.
250 */
252 auto& coords = const_cast<su2activematrix&>(main_geometry->nodes->GetCoord());
253 return CPyWrapperMatrixView(coords, "Coordinates", false);
254 }
255
256 /*!
257 * \brief Get a read/write view of the current coordinates of the mesh nodes of a marker.
258 */
259 inline CPyWrapperMarkerMatrixView MarkerCoordinates(unsigned short iMarker) {
260 if (iMarker >= GetNumberMarkers()) SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION);
261 auto& coords = const_cast<su2activematrix&>(main_geometry->nodes->GetCoord());
262 return CPyWrapperMarkerMatrixView(coords, main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
263 "MarkerCoordinates", false);
264 }
265
266 /*!
267 * \brief Get the number of markers in the mesh.
268 * \return Number of markers.
269 */
270 unsigned short GetNumberMarkers() const;
271
272 /*!
273 * \brief Get all the boundary markers tags with their associated indices.
274 * \return Map of boundary markers tags to their indices.
275 */
276 map<string, unsigned short> GetMarkerIndices() const;
277
278 /*!
279 * \brief Get all the boundary markers tags with their associated types.
280 * \return Map of boundary markers tags to their types.
281 */
282 map<string, string> GetMarkerTypes() const;
283
284 /*!
285 * \brief Get all the boundary marker tags.
286 * \return List of boundary markers tags.
287 */
288 vector<string> GetMarkerTags() const;
289
290 /*!
291 * \brief Get all the deformable boundary marker tags.
292 * \return List of deformable boundary markers tags.
293 */
294 vector<string> GetDeformableMarkerTags() const;
295
296 /*!
297 * \brief Get all the CHT boundary marker tags.
298 * \return List of CHT boundary markers tags.
299 */
300 vector<string> GetCHTMarkerTags() const;
301
302 /*!
303 * \brief Get all the inlet boundary marker tags.
304 * \return List of inlet boundary markers tags.
305 */
306 vector<string> GetInletMarkerTags() const;
307
308 /*!
309 * \brief Get the number of elements in the marker.
310 * \param[in] iMarker - Marker index.
311 * \return Number of elements.
312 */
313 unsigned long GetNumberMarkerElements(unsigned short iMarker) const;
314
315 /*!
316 * \brief Get the global index of a marker element.
317 * \param[in] iMarker - Marker index.
318 * \param[in] iElem - Marker element index.
319 * \return Global element index.
320 */
321 unsigned long GetMarkerElementGlobalIndex(unsigned short iMarker, unsigned long iElem) const;
322
323 /*!
324 * \brief Get the node indices of a marker element.
325 * \param[in] iMarker - Marker index.
326 * \param[in] iElem - Marker element index.
327 * \return Element node indices.
328 */
329 vector<unsigned long> GetMarkerElementNodes(unsigned short iMarker, unsigned long iElem) const;
330
331 /*!
332 * \brief Get the number of nodes in the marker.
333 * \param[in] iMarker - Marker index.
334 * \return Number of nodes.
335 */
336 unsigned long GetNumberMarkerNodes(unsigned short iMarker) const;
337
338 /*!
339 * \brief Get the node index of a marker.
340 * \param[in] iMarker - Marker index.
341 * \param[in] iVertex - Marker vertex index.
342 * \return Marker vertex.
343 */
344 unsigned long GetMarkerNode(unsigned short iMarker, unsigned long iVertex) const;
345
346 /*!
347 * \brief Get the normal vector of a marker vertex.
348 * \param[in] iMarker - Marker index.
349 * \param[in] iVertex - Marker vertex index.
350 * \param[in] normalize - If true, the unit (i.e. normalized) normal vector is returned.
351 * \return Node normal vector (nDim).
352 */
353 vector<passivedouble> GetMarkerVertexNormals(unsigned short iMarker, unsigned long iVertex,
354 bool normalize = false) const;
355
356 /*!
357 * \brief Get the displacements currently imposed of a marker vertex.
358 * \param[in] iMarker - Marker index.
359 * \param[in] iVertex - Marker vertex index.
360 * \return Node displacements (nDim).
361 */
362 inline vector<passivedouble> GetMarkerDisplacement(unsigned short iMarker, unsigned long iVertex) const {
363 vector<passivedouble> disp(GetNumberDimensions(), 0.0);
364 const auto iPoint = GetMarkerNode(iMarker, iVertex);
365 auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes();
366
367 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
368 disp[iDim] = SU2_TYPE::GetValue(nodes->GetBound_Disp(iPoint, iDim));
369 }
370 return disp;
371 }
372
373 /*!
374 * \brief Set the mesh displacements of a marker vertex.
375 * \note This can be the input of the flow solver in an FSI setting.
376 * \param[in] iMarker - Marker index.
377 * \param[in] iVertex - Marker vertex index.
378 * \param[in] values - Node displacements (nDim).
379 */
380 inline void SetMarkerCustomDisplacement(unsigned short iMarker, unsigned long iVertex, vector<passivedouble> values) {
381 const auto iPoint = GetMarkerNode(iMarker, iVertex);
382 auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes();
383
384 for (auto iDim = 0u; iDim < GetNumberDimensions(); iDim++) {
385 nodes->SetBound_Disp(iPoint, iDim, values[iDim]);
386 }
387 }
388
389 /*!
390 * \brief Get the mesh velocities currently imposed on a marker vertex.
391 * \param[in] iMarker - Marker index.
392 * \param[in] iVertex - Marker vertex index.
393 * \return Node velocities (nDim).
394 */
395 inline vector<passivedouble> GetMarkerMeshVelocity(unsigned short iMarker, unsigned long iVertex) const {
396 vector<passivedouble> vel(GetNumberDimensions(), 0.0);
397 const auto iPoint = GetMarkerNode(iMarker, iVertex);
398 auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes();
399
400 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
401 vel[iDim] = SU2_TYPE::GetValue(nodes->GetBound_Vel(iPoint, iDim));
402 }
403 return vel;
404 }
405
406 /*!
407 * \brief Set the velocities of a marker vertex.
408 * \note This can be the input of the flow solver in an unsteady FSI setting.
409 * \param[in] iMarker - Marker index.
410 * \param[in] iVertex - Marker vertex index.
411 * \param[in] values - Node velocities (nDim).
412 */
413 inline void SetMarkerCustomMeshVelocity(unsigned short iMarker, unsigned long iVertex, vector<passivedouble> values) {
414 const auto iPoint = GetMarkerNode(iMarker, iVertex);
415 auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes();
416
417 for (auto iDim = 0u; iDim < GetNumberDimensions(); iDim++) {
418 nodes->SetBound_Vel(iPoint, iDim, values[iDim]);
419 }
420 }
421
422 /*!
423 * \brief Communicate the boundary mesh displacements.
424 */
426
427 /*!
428 * \brief Get all the active solver names with their associated indices (which can be used to access their data).
429 */
430 map<string, unsigned short> GetSolverIndices() const;
431
432 /*!
433 * \brief Get the structural solver solution variable names with their associated indices.
434 * These correspond to the column indices in the matrix returned by e.g. Solution().
435 */
436 map<string, unsigned short> GetFEASolutionIndices() const;
437
438 /*!
439 * \brief Get a read/write view of the current solution on all mesh nodes of a solver.
440 */
441 inline CPyWrapperMatrixView Solution(unsigned short iSolver) {
442 auto* solver = GetSolverAndCheckMarker(iSolver);
443 return CPyWrapperMatrixView(solver->GetNodes()->GetSolution(), "Solution of " + solver->GetSolverName(), false);
444 }
445
446 /*!
447 * \brief Get read/write view of the gradients of a solver variable in a point.
448 */
449 inline CPyWrapper3DMatrixView Gradient(unsigned short iSolver) {
450 auto* solver = GetSolverAndCheckMarker(iSolver);
451 return CPyWrapper3DMatrixView(solver->GetNodes()->GetGradient(), "Gradient of " + solver->GetSolverName(), false);
452 }
453
454 /*!
455 * \brief Get a read/write view of the user defined source on all mesh nodes of a solver.
456 */
457 inline CPyWrapperMatrixView UserDefinedSource(unsigned short iSolver) {
458 auto* solver = GetSolverAndCheckMarker(iSolver);
460 solver->GetNodes()->GetUserDefinedSource(), "User Defined Source of " + solver->GetSolverName(), false);
461 }
462
463 /*!
464 * \brief Get a read/write view of the current solution on the mesh nodes of a marker.
465 */
466 inline CPyWrapperMarkerMatrixView MarkerSolution(unsigned short iSolver, unsigned short iMarker) {
467 auto* solver = GetSolverAndCheckMarker(iSolver, iMarker);
469 solver->GetNodes()->GetSolution(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
470 "MarkerSolution of " + solver->GetSolverName(), false);
471 }
472
473 /*!
474 * \brief Get a read/write view of the solution at time N on all mesh nodes of a solver.
475 */
476 inline CPyWrapperMatrixView SolutionTimeN(unsigned short iSolver) {
477 auto* solver = GetSolverAndCheckMarker(iSolver);
479 solver->GetNodes()->GetSolution_time_n(), "SolutionTimeN of " + solver->GetSolverName(), false);
480 }
481
482 /*!
483 * \brief Get a read/write view of the solution at time N on the mesh nodes of a marker.
484 */
485 inline CPyWrapperMarkerMatrixView MarkerSolutionTimeN(unsigned short iSolver, unsigned short iMarker) {
486 auto* solver = GetSolverAndCheckMarker(iSolver, iMarker);
488 solver->GetNodes()->GetSolution_time_n(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
489 "MarkerSolutionTimeN of " + solver->GetSolverName(), false);
490 }
491
492 /*!
493 * \brief Get a read/write view of the solution at time N-1 on all mesh nodes of a solver.
494 */
495 inline CPyWrapperMatrixView SolutionTimeN1(unsigned short iSolver) {
496 auto* solver = GetSolverAndCheckMarker(iSolver);
498 solver->GetNodes()->GetSolution_time_n1(), "SolutionTimeN1 of " + solver->GetSolverName(), false);
499 }
500
501 /*!
502 * \brief Get a read/write view of the solution at time N-1 on the mesh nodes of a marker.
503 */
504 inline CPyWrapperMarkerMatrixView MarkerSolutionTimeN1(unsigned short iSolver, unsigned short iMarker) {
505 auto* solver = GetSolverAndCheckMarker(iSolver, iMarker);
507 solver->GetNodes()->GetSolution_time_n1(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
508 "MarkerSolutionTimeN1 of " + solver->GetSolverName(), false);
509 }
510
511 /*!
512 * \brief Get the flow solver primitive variable names with their associated indices.
513 * These correspond to the column indices in the matrix returned by Primitives.
514 */
515 map<string, unsigned short> GetPrimitiveIndices() const;
516
517 /*!
518 * \brief Get a read/write view of the current primitive variables on all mesh nodes of the flow solver.
519 * \warning Primitive variables are only available for flow solvers.
520 */
522 auto* solver = GetSolverAndCheckMarker(FLOW_SOL);
523 return CPyWrapperMatrixView(const_cast<su2activematrix&>(solver->GetNodes()->GetPrimitive()), "Primitives", false);
524 }
525
526 /*!
527 * \brief Get a read/write view of the current primitive variables on the mesh nodes of a marker.
528 * \warning Primitive variables are only available for flow solvers.
529 */
530 inline CPyWrapperMarkerMatrixView MarkerPrimitives(unsigned short iMarker) {
531 auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker);
533 const_cast<su2activematrix&>(solver->GetNodes()->GetPrimitive()), main_geometry->vertex[iMarker],
534 main_geometry->GetnVertex(iMarker), "MarkerPrimitives", false);
535 }
536
537 /*!
538 * \brief Get a read-only view of the geometry sensitivity of a discrete adjoint solver.
539 */
540 inline CPyWrapperMatrixView Sensitivity(unsigned short iSolver) {
541 auto* solver = GetSolverAndCheckMarker(iSolver);
542 auto& sensitivity = const_cast<su2activematrix&>(solver->GetNodes()->GetSensitivity());
543 return CPyWrapperMatrixView(sensitivity, "Sensitivity", true);
544 }
545
546 /*!
547 * \brief Set the temperature of a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
548 * \note This can be the input of a heat or flow solver in a CHT setting.
549 * \param[in] iMarker - Marker identifier.
550 * \param[in] iVertex - Vertex identifier.
551 * \param[in] WallTemp - Value of the temperature.
552 */
553 inline void SetMarkerCustomTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble WallTemp) {
554 main_geometry->SetCustomBoundaryTemperature(iMarker, iVertex, WallTemp);
555 }
556
557 /*!
558 * \brief Set the wall normal heat flux at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
559 * \note This can be the input of a heat or flow solver in a CHT setting.
560 * \param[in] iMarker - Marker identifier.
561 * \param[in] iVertex - Vertex identifier.
562 * \param[in] WallHeatFlux - Value of the normal heat flux.
563 */
564 inline void SetMarkerCustomNormalHeatFlux(unsigned short iMarker, unsigned long iVertex, passivedouble WallHeatFlux) {
565 main_geometry->SetCustomBoundaryHeatFlux(iMarker, iVertex, WallHeatFlux);
566 }
567
568 /*!
569 * \brief Set the wall normal scalar values at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
570 * \note This can be the input of a scalar transport equation.
571 * \param[in] iMarker - Marker identifier.
572 * \param[in] iVertex - Vertex identifier.
573 * \param[in] WallScalar - Value of the normal heat flux.
574 */
575 inline void SetMarkerCustomScalar(unsigned short iMarker, unsigned long iVertex, vector<passivedouble> WallScalar) {
577 solver->SetCustomBoundaryScalar(iMarker, iVertex, WallScalar);
578 }
579
580 /*!
581 * \brief Selects zone to be used for python driver operations.
582 * \param[in] iZone - Zone identifier.
583 */
584 inline void SelectZone(unsigned short iZone) {
585 if (iZone >= nZone) SU2_MPI::Error("Zone index out of range", CURRENT_FUNCTION);
589 }
590
591 /*!
592 * \brief Returns the index of the zone selected for python driver operations.
593 */
594 inline unsigned short SelectedZone() const { return selected_zone; }
595
596 /*!
597 * \brief Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver.
598 * \note This can be the output of a heat or flow solver in a CHT setting.
599 * \param[in] iSolver - Solver identifier, should be either a flow solver or the heat solver.
600 * \param[in] iMarker - Marker identifier.
601 * \param[in] iVertex - Vertex identifier.
602 * \return Wall normal component of the heat flux at the vertex.
603 */
604 inline passivedouble GetMarkerNormalHeatFlux(unsigned short iSolver, unsigned short iMarker, unsigned long iVertex) const {
605 if (iSolver != HEAT_SOL && iSolver != FLOW_SOL) {
606 SU2_MPI::Error("Normal heat flux is only available for flow or heat solvers.", CURRENT_FUNCTION);
607 }
608 return SU2_TYPE::GetValue(GetSolverAndCheckMarker(iSolver, iMarker)->GetHeatFlux(iMarker, iVertex));
609 }
610
611 /*!
612 * \brief Sets the nodal force for the structural solver at a vertex of a marker.
613 * \note This can be the input of the FEA solver in an FSI setting.
614 * \param[in] iMarker - Marker identifier.
615 * \param[in] iVertex - Vertex identifier.
616 * \param[in] force - Force vector.
617 */
618 inline void SetMarkerCustomFEALoad(unsigned short iMarker, unsigned long iVertex, std::vector<passivedouble> force) {
619 auto* solver = GetSolverAndCheckMarker(FEA_SOL, iMarker);
620 std::array<su2double, 3> load{};
621 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) load[iDim] = force[iDim];
622 const auto iPoint = GetMarkerNode(iMarker, iVertex);
623 solver->GetNodes()->Set_FlowTraction(iPoint, load.data());
624 }
625
626 /*!
627 * \brief Get the fluid force at a vertex of a solid wall marker of the flow solver.
628 * \note This can be the output of the flow solver in an FSI setting to then apply it to a structural solver.
629 * \param[in] iMarker - Marker identifier.
630 * \param[in] iVertex - Vertex identifier.
631 * \return Vector of loads.
632 */
633 inline vector<passivedouble> GetMarkerFlowLoad(unsigned short iMarker, unsigned long iVertex) const {
634 vector<passivedouble> FlowLoad(GetNumberDimensions(), 0.0);
635 const auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker);
636
637 if (main_config->GetSolid_Wall(iMarker)) {
638 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
639 FlowLoad[iDim] = SU2_TYPE::GetValue(solver->GetVertexTractions(iMarker, iVertex, iDim));
640 }
641 }
642 return FlowLoad;
643 }
644
645 /*!
646 * \brief Set the adjoint of the flow tractions of the flow solver.
647 * \note This can be the input of the flow solver in an adjoint FSI setting.
648 * \param[in] iMarker - Marker identifier.
649 * \param[in] iVertex - Vertex identifier.
650 * \param[in] adjointLoad - Vector of adjoint loads.
651 */
652 inline void SetMarkerCustomFlowLoadAdjoint(unsigned short iMarker, unsigned long iVertex,
653 vector<passivedouble> adjointLoad) {
654 auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker);
655 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
656 solver->StoreVertexTractionsAdjoint(iMarker, iVertex, iDim, adjointLoad[iDim]);
657 }
658 }
659
660 /*!
661 * \brief Get the sensitivities of the displacements of the mesh boundary vertices.
662 * \note This can be the output of the flow solver in an adjoint FSI setting.
663 * \param[in] iMarker - Marker identifier.
664 * \param[in] iVertex - Vertex identifier.
665 * \return Vector of sensitivities.
666 */
667 inline vector<passivedouble> GetMarkerDisplacementSensitivity(unsigned short iMarker, unsigned long iVertex) const {
668 const auto nDim = GetNumberDimensions();
669 const auto iPoint = GetMarkerNode(iMarker, iVertex);
671
672 vector<passivedouble> sens(nDim, 0.0);
673 for (auto iDim = 0u; iDim < nDim; ++iDim) {
674 sens[iDim] = SU2_TYPE::GetValue(nodes->GetBoundDisp_Sens(iPoint, iDim));
675 }
676 return sens;
677 }
678
679 /*!
680 * \brief Get the sensitivity of the FEA loads of the structural solver (via the adjoint structural solver).
681 * \note This can be the output of the FEA solver in an adjoint FSI setting.
682 * \param[in] iMarker - Marker identifier.
683 * \param[in] iVertex - Vertex identifier.
684 * \returns Vector of sensitivities.
685 */
686 inline vector<passivedouble> GetMarkerFEALoadSensitivity(unsigned short iMarker, unsigned long iVertex) const {
687 const auto nDim = GetNumberDimensions();
688 const auto iPoint = GetMarkerNode(iMarker, iVertex);
690
691 vector<passivedouble> sens(nDim, 0.0);
692 for (auto iDim = 0u; iDim < nDim; ++iDim) {
693 sens[iDim] = SU2_TYPE::GetValue(nodes->GetFlowTractionSensitivity(iPoint, iDim));
694 }
695 return sens;
696 }
697
698 /*!
699 * \brief Set the adjoint of the structural displacements.
700 * \note This can be the input of the FEA solver in an adjoint FSI setting.
701 * \param[in] iMarker - Marker identifier.
702 * \param[in] iVertex - Vertex identifier.
703 * \param[in] adjointDisplacement - Vector of adjoint displacements.
704 */
705 inline void SetMarkerCustomFEADisplacementAdjoint(unsigned short iMarker, unsigned long iVertex,
706 vector<passivedouble> adjointDisplacement) {
707 const auto iPoint = GetMarkerNode(iMarker, iVertex);
709
710 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
711 nodes->SetSourceTerm_DispAdjoint(iPoint, iDim, adjointDisplacement[iDim]);
712 }
713 }
714
715 /*!
716 * \brief Set the adjoint of the structural velocities.
717 * \note This can be the input of the FEA solver in an unsteady adjoint FSI setting.
718 * \param[in] iMarker - Marker identifier.
719 * \param[in] iVertex - Vertex identifier.
720 * \param[in] adjointVelocity - Vector of adjoint velocities.
721 */
722 inline void SetMarkerCustomFEAVelocityAdjoint(unsigned short iMarker, unsigned long iVertex,
723 vector<passivedouble> adjointVelocity) {
724 const auto iPoint = GetMarkerNode(iMarker, iVertex);
726
727 for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) {
728 nodes->SetSourceTerm_VelAdjoint(iPoint, iDim, adjointVelocity[iDim]);
729 }
730 }
731
732 /*!
733 * \brief Set the first variable in MARKER_INLET (usually temperature).
734 * \param[in] iMarker - Marker index.
735 * \param[in] iVertex - Marker vertex index.
736 * \param[in] value - Value of the variable.
737 */
738 void SetMarkerCustomInletFlowVar0(unsigned short iMarker, unsigned long iVertex, passivedouble value) {
739 GetSolverAndCheckMarker(FLOW_SOL, iMarker)->SetInletTtotal(iMarker, iVertex, value);
740 }
741
742 /*!
743 * \brief Set the second variable in MARKER_INLET (usually total pressure).
744 * \param[in] iMarker - Marker index.
745 * \param[in] iVertex - Marker vertex index.
746 * \param[in] value - Value of the variable.
747 */
748 void SetMarkerCustomInletFlowVar1(unsigned short iMarker, unsigned long iVertex, passivedouble value) {
749 GetSolverAndCheckMarker(FLOW_SOL, iMarker)->SetInletPtotal(iMarker, iVertex, value);
750 }
751
752 /*!
753 * \brief Set the flow direction vector (does not need to be a unit vector).
754 * \param[in] iMarker - Marker index.
755 * \param[in] iVertex - Marker vertex index.
756 * \param[in] values - Flow direction vector.
757 */
758 void SetMarkerCustomInletFlowDirection(unsigned short iMarker, unsigned long iVertex, std::vector<passivedouble> values) {
759 auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker);
760 for (auto iDim = 0ul; iDim < GetNumberDimensions(); ++iDim) {
761 solver->SetInletFlowDir(iMarker, iVertex, iDim, values[iDim]);
762 }
763 }
764
765/// \}
766
767 protected:
768 /*!
769 * \brief Automates some boilerplate of accessing solution fields for the python wrapper.
770 */
771 inline CSolver* GetSolverAndCheckMarker(unsigned short iSolver,
772 unsigned short iMarker = std::numeric_limits<unsigned short>::max()) const {
773 if (iMarker < std::numeric_limits<unsigned short>::max() && iMarker > GetNumberMarkers()) {
774 SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION);
775 }
776 auto* solver = solver_container[selected_zone][INST_0][MESH_0][iSolver];
777 if (solver == nullptr) SU2_MPI::Error("The selected solver does not exist.", CURRENT_FUNCTION);
778 return solver;
779 }
780
781 /*!
782 * \brief Initialize containers.
783 */
785
786 /*!
787 * \brief Delete containers.
788 */
789 void CommonFinalize();
790
791 /*!
792 * \brief Read in the config and mesh files.
793 * \param[in] config - Definition of the particular problem.
794 * \param[in] driver_config - Definition of the driver configuration.
795 */
797
798 /*!
799 * \brief Construction of the edge-based data structure and the multi-grid structure.
800 * \param[in] config - Definition of the particular problem.
801 * \param[in] geometry - Geometrical definition of the problem.
802 * \param[in] dummy - Definition of the dummy driver.
803 */
804 void InitializeGeometry(CConfig* config, CGeometry**& geometry, bool dummy);
805
806 /*!
807 * \brief Definition and allocation of all solution classes.
808 * \param[in] config - Definition of the particular problem.
809 * \param[in] geometry - Geometrical definition of the problem.
810 * \param[in] solver - Container vector with all the solutions.
811 */
812 void InitializeSolver(CConfig* config, CGeometry** geometry, CSolver***& solver);
813
814 /*!
815 * \brief Definition and allocation of all solver classes.
816 * \param[in] config - Definition of the particular problem.
817 * \param[in] geometry - Geometrical definition of the problem.
818 * \param[in] solver - Container vector with all the solutions.
819 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
820 */
821 void InitializeNumerics(CConfig* config, CGeometry** geometry, CSolver*** solver, CNumerics****& numerics) const;
822
823 /*!
824 * \brief Preprocess the output container.
825 * \param[in] config - Definition of the particular problem.
826 * \param[in] driver_config - Definition of the driver configuration.
827 * \param[in] output_container - Container vector with all the outputs.
828 * \param[in] driver_output - Definition of the driver output.
829 */
832};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
static void Error(const std::string &ErrorMsg, const std::string &FunctionName)
Definition mpi_structure.cpp:131
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
bool GetSolid_Wall(unsigned short iMarker) const
Determines whether a marker with index iMarker is a solid boundary.
Definition CConfig.cpp:8630
unsigned short GetnMarker_Analyze(void) const
Get the total number of moving markers.
Definition CConfig.hpp:3303
string GetMarker_Monitoring_TagBound(unsigned short val_marker) const
Get the name of the surface defined in the geometry file.
Definition CConfig.hpp:3521
string GetMarker_Analyze_TagBound(unsigned short val_marker) const
Get the name of the surface defined in the geometry file.
Definition CConfig.hpp:7288
unsigned short GetnMarker_Monitoring(void) const
Get the total number of monitoring markers.
Definition CConfig.hpp:3267
bool GetDeform_Mesh(void) const
Get information about whether the mesh will be deformed using pseudo linear elasticity.
Definition CConfig.hpp:4599
Base class for all drivers.
Definition CDriverBase.hpp:43
CSolver ***** solver_container
Container vector with all the solutions.
Definition CDriverBase.hpp:71
void InputPreprocessing(CConfig **&config, CConfig *&driver_config)
Read in the config and mesh files.
virtual ~CDriverBase(void)
Destructor of the class.
CNumerics ****** numerics_container
Description of the numerical method (the way in which the equations are solved).
Definition CDriverBase.hpp:72
CConfig ** config_container
Definition of the particular problem.
Definition CDriverBase.hpp:68
char * config_file_name
Configuration file name of the problem.
Definition CDriverBase.hpp:47
su2double UsedTime
Elapsed time between Start and Stop point of the timer.
Definition CDriverBase.hpp:54
virtual void Run()
A virtual member.
Definition CDriverBase.hpp:97
COutput * driver_output
Definition of the driver output.
Definition CDriverBase.hpp:66
CConfig * driver_config
Definition of the driver configuration.
Definition CDriverBase.hpp:65
su2double UsedTimeCompute
Elapsed time between Start and Stop point of the timer for tracking compute phase.
Definition CDriverBase.hpp:53
CVolumetricMovement *** grid_movement
Volume grid movement classes of the problem.
Definition CDriverBase.hpp:75
CSurfaceMovement ** surface_movement
Surface movement classes of the problem.
Definition CDriverBase.hpp:74
virtual void Finalize()
A virtual member.
Definition CDriverBase.hpp:102
void InitializeContainers()
Initialize containers.
Definition CDriverBase.cpp:67
unsigned short iMesh
Iterator on mesh levels.
Definition CDriverBase.hpp:58
unsigned short nZone
Total number of zones in the problem.
Definition CDriverBase.hpp:60
CGeometry * main_geometry
Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API).
Definition CDriverBase.hpp:78
unsigned short nDim
Number of dimensions.
Definition CDriverBase.hpp:61
su2double UsedTimePreproc
Elapsed time between Start and Stop point of the timer for tracking preprocessing phase.
Definition CDriverBase.hpp:52
unsigned long TimeIter
Definition CDriverBase.hpp:56
unsigned short selected_zone
Selected zone for the driver. Defaults to ZONE_0.
Definition CDriverBase.hpp:57
int size
MPI Size.
Definition CDriverBase.hpp:46
int rank
MPI Rank.
Definition CDriverBase.hpp:45
CSolver * GetSolverAndCheckMarker(unsigned short iSolver, unsigned short iMarker=std::numeric_limits< unsigned short >::max()) const
Automates some boilerplate of accessing solution fields for the python wrapper.
Definition CDriverBase.hpp:771
void InitializeSolver(CConfig *config, CGeometry **geometry, CSolver ***&solver)
Definition and allocation of all solution classes.
void OutputPreprocessing(CConfig **config, CConfig *driver_config, COutput **&output_container, COutput *&driver_output)
Preprocess the output container.
su2double StopTime
Stop point of the timer for performance benchmarking.
Definition CDriverBase.hpp:50
void InitializeNumerics(CConfig *config, CGeometry **geometry, CSolver ***solver, CNumerics ****&numerics) const
Definition and allocation of all solver classes.
unsigned short * nInst
Total number of instances in the problem (per zone).
Definition CDriverBase.hpp:63
su2double StartTime
Start point of the timer for performance benchmarking.
Definition CDriverBase.hpp:49
void CommonFinalize()
Delete containers.
Definition CDriverBase.cpp:87
unsigned short iInst
Iterator on instance levels.
Definition CDriverBase.hpp:62
CConfig * main_config
Reference to base (i.e. ZONE 0) configuration (used in driver API).
Definition CDriverBase.hpp:77
void InitializeGeometry(CConfig *config, CGeometry **&geometry, bool dummy)
Construction of the edge-based data structure and the multi-grid structure.
CGeometry **** geometry_container
Geometrical definition of the problem.
Definition CDriverBase.hpp:70
unsigned short iZone
Iterator on zones.
Definition CDriverBase.hpp:59
COutput ** output_container
Pointer to the COutput class.
Definition CDriverBase.hpp:69
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
unsigned long GetnVertex(unsigned short val_marker) const
Get number of vertices.
Definition CGeometry.hpp:637
void SetCustomBoundaryTemperature(unsigned short val_marker, unsigned long val_vertex, su2double val_customBoundaryTemperature)
Set the value of the customized temperature at a specified vertex on a specified marker.
Definition CGeometry.hpp:1749
void SetCustomBoundaryHeatFlux(unsigned short val_marker, unsigned long val_vertex, su2double val_customBoundaryHeatFlux)
Set the value of the customized normal heat flux at a specified vertex on a specified marker.
Definition CGeometry.hpp:1769
CPoint * nodes
Node vector (dual grid information).
Definition CGeometry.hpp:253
CVertex *** vertex
Boundary Vertex vector (dual grid information).
Definition CGeometry.hpp:255
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Class for writing the convergence history and to write solution data to file.
Definition COutput.hpp:68
const vector< string > & GetHistoryOutputList() const
Get the list of all output fields.
Definition COutput.hpp:554
const vector< string > & GetHistoryOutputPerSurfaceList() const
Get the list of all per-surface fields.
Definition COutput.hpp:562
su2double GetCoord(unsigned long iPoint, unsigned long iDim) const
Get the coordinates dor the control volume.
Definition CPoint.hpp:158
This class wraps C3DDoubleMatrix for the python wrapper matrix interface. It is generaly used to wrap...
Definition CPyWrapperMatrixView.hpp:176
This class wraps su2activematrix for the python wrapper matrix interface restricting it to the vertic...
Definition CPyWrapperMatrixView.hpp:125
This class wraps su2activematrix for the python wrapper matrix interface. It is generaly used to wrap...
Definition CPyWrapperMatrixView.hpp:85
Definition CSolver.hpp:71
virtual void SetCustomBoundaryScalar(unsigned short val_marker, unsigned long val_vertex, vector< passivedouble > val_customBoundaryScalar)
Set the value of the customized normal scalar values/flux at a specified vertex on a specified marker...
Definition CSolver.hpp:2942
virtual void SetInletPtotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ptotal)
A virtual member.
Definition CSolver.hpp:2962
CVariable * GetNodes()
Allow outside access to the nodes of the solver, containing conservatives, primitives,...
Definition CSolver.hpp:229
virtual void SetInletTtotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ttotal)
A virtual member.
Definition CSolver.hpp:2952
Class for moving the surface numerical grid.
Definition CSurfaceMovement.hpp:38
virtual void SetSourceTerm_VelAdjoint(unsigned long iPoint, unsigned long iDim, su2double val)
Definition CVariable.hpp:2361
virtual void SetBound_Disp(unsigned long iPoint, const su2double *val_BoundDisp)
A virtual member. Set the boundary displacement.
Definition CVariable.hpp:2149
virtual void SetSourceTerm_DispAdjoint(unsigned long iPoint, unsigned long iDim, su2double val)
Set the source term applied into the displacement adjoint coming from external solvers.
Definition CVariable.hpp:2360
virtual void SetBound_Vel(unsigned long iPoint, const su2double *val_BoundVel)
A virtual member. Set the boundary velocity.
Definition CVariable.hpp:2155
virtual su2double GetMesh_Coord(unsigned long iPoint, unsigned long iDim) const
A virtual member. Get the value of the undeformed coordinates.
Definition CVariable.hpp:2090
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
double passivedouble
Definition code_config.hpp:129
passivedouble su2double
Definition code_config.hpp:181
void SetMarkerCustomScalar(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > WallScalar)
Set the wall normal scalar values at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
Definition CDriverBase.hpp:575
CPyWrapperMatrixView Sensitivity(unsigned short iSolver)
Get a read-only view of the geometry sensitivity of a discrete adjoint solver.
Definition CDriverBase.hpp:540
vector< passivedouble > GetMarkerDisplacement(unsigned short iMarker, unsigned long iVertex) const
Get the displacements currently imposed of a marker vertex.
Definition CDriverBase.hpp:362
vector< string > GetOutputNames() const
Get the list of available outputs.
Definition CDriverBase.hpp:111
unsigned long GetNumberMarkerElements(unsigned short iMarker) const
Get the number of elements in the marker.
Definition CDriverBase.cpp:337
void SetMarkerCustomFEALoad(unsigned short iMarker, unsigned long iVertex, std::vector< passivedouble > force)
Sets the nodal force for the structural solver at a vertex of a marker.
Definition CDriverBase.hpp:618
void SetMarkerCustomInletFlowDirection(unsigned short iMarker, unsigned long iVertex, std::vector< passivedouble > values)
Set the flow direction vector (does not need to be a unit vector).
Definition CDriverBase.hpp:758
vector< unsigned long > GetMarkerElementNodes(unsigned short iMarker, unsigned long iElem) const
Get the node indices of a marker element.
Definition CDriverBase.cpp:351
vector< string > GetInletMarkerTags() const
Get all the inlet boundary marker tags.
Definition CDriverBase.cpp:322
void CommunicateMeshDisplacements(void)
Communicate the boundary mesh displacements.
Definition CDriverBase.cpp:394
unsigned long GetElementGlobalIndex(unsigned long iElem) const
Get the global index of a mesh element.
Definition CDriverBase.cpp:169
void SetMarkerCustomTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble WallTemp)
Set the temperature of a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
Definition CDriverBase.hpp:553
unsigned long GetMarkerNode(unsigned short iMarker, unsigned long iVertex) const
Get the node index of a marker.
Definition CDriverBase.cpp:371
vector< passivedouble > GetMarkerDisplacementSensitivity(unsigned short iMarker, unsigned long iVertex) const
Get the sensitivities of the displacements of the mesh boundary vertices.
Definition CDriverBase.hpp:667
unsigned short GetNumberMarkers() const
Get the number of markers in the mesh.
Definition CDriverBase.cpp:209
CPyWrapperMarkerMatrixView MarkerCoordinates(unsigned short iMarker)
Get a read/write view of the current coordinates of the mesh nodes of a marker.
Definition CDriverBase.hpp:259
map< string, unsigned short > GetMarkerIndices() const
Get all the boundary markers tags with their associated indices.
Definition CDriverBase.cpp:211
CPyWrapperMarkerMatrixView MarkerSolutionTimeN(unsigned short iSolver, unsigned short iMarker)
Get a read/write view of the solution at time N on the mesh nodes of a marker.
Definition CDriverBase.hpp:485
map< string, unsigned short > GetFEASolutionIndices() const
Get the structural solver solution variable names with their associated indices. These correspond to ...
Definition CDriverBase.cpp:411
vector< passivedouble > GetMarkerFlowLoad(unsigned short iMarker, unsigned long iVertex) const
Get the fluid force at a vertex of a solid wall marker of the flow solver.
Definition CDriverBase.hpp:633
passivedouble GetMarkerAnalyzeOutputValue(const std::string &output_name, const std::string &marker_analyze) const
Get the value of one of the available surface outputs at a given MARKER_ANALYZE.
Definition CDriverBase.hpp:147
unsigned short SelectedZone() const
Returns the index of the zone selected for python driver operations.
Definition CDriverBase.hpp:594
void SetMarkerCustomNormalHeatFlux(unsigned short iMarker, unsigned long iVertex, passivedouble WallHeatFlux)
Set the wall normal heat flux at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
Definition CDriverBase.hpp:564
CPyWrapperMatrixView Solution(unsigned short iSolver)
Get a read/write view of the current solution on all mesh nodes of a solver.
Definition CDriverBase.hpp:441
unsigned long GetNumberNodes() const
Get the number of nodes in the mesh (including halos).
Definition CDriverBase.cpp:189
void SetMarkerCustomFlowLoadAdjoint(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointLoad)
Set the adjoint of the flow tractions of the flow solver.
Definition CDriverBase.hpp:652
map< string, unsigned short > GetPrimitiveIndices() const
Get the flow solver primitive variable names with their associated indices. These correspond to the c...
Definition CDriverBase.cpp:432
CPyWrapperMatrixView Coordinates()
Get a read/write view of the current coordinates of all mesh nodes.
Definition CDriverBase.hpp:251
CPyWrapperMatrixView SolutionTimeN1(unsigned short iSolver)
Get a read/write view of the solution at time N-1 on all mesh nodes of a solver.
Definition CDriverBase.hpp:495
unsigned long GetNumberElements() const
Get the number of elements in the mesh.
Definition CDriverBase.cpp:167
void SelectZone(unsigned short iZone)
Selects zone to be used for python driver operations.
Definition CDriverBase.hpp:584
void SetMarkerCustomFEAVelocityAdjoint(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointVelocity)
Set the adjoint of the structural velocities.
Definition CDriverBase.hpp:722
vector< passivedouble > GetMarkerMeshVelocity(unsigned short iMarker, unsigned long iVertex) const
Get the mesh velocities currently imposed on a marker vertex.
Definition CDriverBase.hpp:395
CPyWrapper3DMatrixView Gradient(unsigned short iSolver)
Get read/write view of the gradients of a solver variable in a point.
Definition CDriverBase.hpp:449
vector< string > GetCHTMarkerTags() const
Get all the CHT boundary marker tags.
Definition CDriverBase.cpp:307
passivedouble GetMarkerNormalHeatFlux(unsigned short iSolver, unsigned short iMarker, unsigned long iVertex) const
Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver.
Definition CDriverBase.hpp:604
CPyWrapperMarkerMatrixView MarkerSolutionTimeN1(unsigned short iSolver, unsigned short iMarker)
Get a read/write view of the solution at time N-1 on the mesh nodes of a marker.
Definition CDriverBase.hpp:504
void SetMarkerCustomFEADisplacementAdjoint(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointDisplacement)
Set the adjoint of the structural displacements.
Definition CDriverBase.hpp:705
unsigned long GetNumberMarkerNodes(unsigned short iMarker) const
Get the number of nodes in the marker.
Definition CDriverBase.cpp:364
void SetMarkerCustomInletFlowVar1(unsigned short iMarker, unsigned long iVertex, passivedouble value)
Set the second variable in MARKER_INLET (usually total pressure).
Definition CDriverBase.hpp:748
unsigned long GetNumberDimensions() const
Get the number of dimensions of the mesh.
Definition CDriverBase.cpp:165
bool GetNodeDomain(unsigned long iPoint) const
Get the halo flag of a mesh node.
Definition CDriverBase.cpp:202
CPyWrapperMatrixView SolutionTimeN(unsigned short iSolver)
Get a read/write view of the solution at time N on all mesh nodes of a solver.
Definition CDriverBase.hpp:476
CPyWrapperMarkerMatrixView MarkerSolution(unsigned short iSolver, unsigned short iMarker)
Get a read/write view of the current solution on the mesh nodes of a marker.
Definition CDriverBase.hpp:466
vector< string > GetMarkerTags() const
Get all the boundary marker tags.
Definition CDriverBase.cpp:287
map< string, string > GetMarkerTypes() const
Get all the boundary markers tags with their associated types.
Definition CDriverBase.cpp:221
unsigned long GetNodeGlobalIndex(unsigned long iPoint) const
Get the global node index.
Definition CDriverBase.cpp:195
void SetMarkerCustomInletFlowVar0(unsigned short iMarker, unsigned long iVertex, passivedouble value)
Set the first variable in MARKER_INLET (usually temperature).
Definition CDriverBase.hpp:738
vector< string > GetMarkerOutputNames() const
Get the list of available surface outputs on both MARKER_MONITORING and MARKER_ANALYZE.
Definition CDriverBase.hpp:125
vector< string > GetDeformableMarkerTags() const
Get all the deformable boundary marker tags.
Definition CDriverBase.cpp:297
vector< unsigned long > GetElementNodes(unsigned long iElem) const
Get the node indices of a mesh element.
Definition CDriverBase.cpp:176
void SetMarkerCustomDisplacement(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > values)
Set the mesh displacements of a marker vertex.
Definition CDriverBase.hpp:380
CPyWrapperMarkerMatrixView MarkerInitialCoordinates(unsigned short iMarker) const
Get a read-only view of the initial (undeformed) coordinates of the mesh nodes of a marker.
Definition CDriverBase.hpp:236
CPyWrapperMarkerMatrixView MarkerPrimitives(unsigned short iMarker)
Get a read/write view of the current primitive variables on the mesh nodes of a marker.
Definition CDriverBase.hpp:530
unsigned short GetNumberDesignVariables() const
Get the number of design variables.
Definition CDriverBase.cpp:161
CPyWrapperMatrixView Primitives()
Get a read/write view of the current primitive variables on all mesh nodes of the flow solver.
Definition CDriverBase.hpp:521
map< string, unsigned short > GetSolverIndices() const
Get all the active solver names with their associated indices (which can be used to access their data...
Definition CDriverBase.cpp:399
CPyWrapperMatrixView UserDefinedSource(unsigned short iSolver)
Get a read/write view of the user defined source on all mesh nodes of a solver.
Definition CDriverBase.hpp:457
vector< passivedouble > GetMarkerFEALoadSensitivity(unsigned short iMarker, unsigned long iVertex) const
Get the sensitivity of the FEA loads of the structural solver (via the adjoint structural solver).
Definition CDriverBase.hpp:686
passivedouble GetOutputValue(const std::string &output_name) const
Get the value of one of the available history outputs.
Definition CDriverBase.hpp:117
CPyWrapperMatrixView InitialCoordinates() const
Get a read-only view of the initial (undeformed) coordinates of all mesh nodes.
Definition CDriverBase.hpp:224
passivedouble GetMarkerMonitoringOutputValue(const std::string &output_name, const std::string &marker_monitoring) const
Get the value of one of the available surface outputs at a given MARKER_MONITORING.
Definition CDriverBase.hpp:133
unsigned long GetNumberHaloNodes() const
Get the number of halo nodes in the mesh.
Definition CDriverBase.cpp:191
vector< passivedouble > GetMarkerVertexNormals(unsigned short iMarker, unsigned long iVertex, bool normalize=false) const
Get the normal vector of a marker vertex.
Definition CDriverBase.cpp:378
void SetMarkerCustomMeshVelocity(unsigned short iMarker, unsigned long iVertex, vector< passivedouble > values)
Set the velocities of a marker vertex.
Definition CDriverBase.hpp:413
unsigned long GetMarkerElementGlobalIndex(unsigned short iMarker, unsigned long iElem) const
Get the global index of a marker element.
Definition CDriverBase.cpp:344
unsigned short GetNumberFFDBoxes() const
Get the number of FFD boxes.
Definition CDriverBase.cpp:163
int SU2_Comm
Definition mpi_structure.hpp:619
#define CURRENT_FUNCTION
Definition mpi_structure.hpp:59
passivedouble GetValue(const su2double &data)
Get the (primitive) value of the datatype (needs to be specialized for active types).
Definition datatype_structure.hpp:113
const unsigned int INST_0
Definition of the first instance per grid level.
Definition option_structure.hpp:92
const unsigned int MESH_0
Definition of the finest grid level.
Definition option_structure.hpp:88
@ SPECIES_SOL
Position of the species solver.
Definition option_structure.hpp:588
@ MESH_SOL
Position of the mesh solver.
Definition option_structure.hpp:586
@ ADJFEA_SOL
Position of the continuous adjoint Finite Element flow solution in the solver container array.
Definition option_structure.hpp:591
@ HEAT_SOL
Position of the heat equation in the solution solver array.
Definition option_structure.hpp:582
@ FLOW_SOL
Position of the mean flow solution in the solver container array.
Definition option_structure.hpp:577
@ FEA_SOL
Position of the Finite Element flow solution in the solver container array.
Definition option_structure.hpp:590
@ ADJMESH_SOL
Position of the adjoint of the mesh solver.
Definition option_structure.hpp:587
const unsigned int ZONE_0
Definition of the first grid domain.
Definition option_structure.hpp:90