Skip to content

Commit fbcca58

Browse files
author
Nicola-Fonzi
committed
Better initialisation of variables
1 parent 96e23ea commit fbcca58

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,13 +637,13 @@ void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passiv
637637
passivedouble LoadY, passivedouble LoadZ) {
638638

639639
unsigned long iPoint;
640-
vector<su2double> NodalForce (3,0.0);
640+
su2double NodalForce[3] = {0.0,0.0,0.0};
641641
NodalForce[0] = LoadX;
642642
NodalForce[1] = LoadY;
643643
NodalForce[2] = LoadZ;
644644

645645
iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode();
646-
solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce.data());
646+
solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce);
647647

648648
}
649649

@@ -817,15 +817,15 @@ void CDriver::SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iV
817817
void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) {
818818

819819
unsigned long iPoint;
820-
vector<su2double> MeshDispl (3,0.0);
820+
su2double MeshDispl[3] = {0.0,0.0,0.0};
821821

822822
MeshDispl[0] = DispX;
823823
MeshDispl[1] = DispY;
824824
MeshDispl[2] = DispZ;
825825

826826
iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode();
827827

828-
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl.data());
828+
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl);
829829

830830
}
831831

0 commit comments

Comments
 (0)