@@ -4557,8 +4557,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45574557 TotalMinCoordZ = 1E10 , TotalMaxCoordX = -1E10 , TotalMaxCoordY = -1E10 , TotalMaxCoordZ = -1E10 ;
45584558 su2double TotalPositiveXArea = 0.0 , TotalPositiveYArea = 0.0 , TotalPositiveZArea = 0.0 , TotalWettedArea = 0.0 , AxiFactor;
45594559
4560- bool axisymmetric = config->GetAxisymmetric ();
4561- bool fea = (( config->GetKind_Solver () == FEM_ELASTICITY) || (config-> GetKind_Solver () == DISC_ADJ_FEM) );
4560+ const bool axisymmetric = config->GetAxisymmetric ();
4561+ const bool fea = config->GetStructuralProblem ( );
45624562
45634563 PositiveXArea = 0.0 ;
45644564 PositiveYArea = 0.0 ;
@@ -4569,12 +4569,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45694569 Boundary = config->GetMarker_All_KindBC (iMarker);
45704570 Monitoring = config->GetMarker_All_Monitoring (iMarker);
45714571
4572- if ((((Boundary == EULER_WALL) ||
4573- (Boundary == HEAT_FLUX) ||
4574- (Boundary == ISOTHERMAL) ||
4575- (Boundary == LOAD_BOUNDARY) ||
4576- (Boundary == DISPLACEMENT_BOUNDARY)) && (Monitoring == YES))
4577- || (fea))
4572+ if (((config->GetSolid_Wall (iMarker) || Boundary == LOAD_BOUNDARY ||
4573+ Boundary == DISPLACEMENT_BOUNDARY) && Monitoring == YES) || fea) {
45784574
45794575 for (iVertex = 0 ; iVertex < nVertex[iMarker]; iVertex++) {
45804576 iPoint = vertex[iMarker][iVertex]->GetNode ();
@@ -4588,8 +4584,7 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45884584 if (axisymmetric) AxiFactor = 2.0 *PI_NUMBER*nodes->GetCoord (iPoint, 1 );
45894585 else AxiFactor = 1.0 ;
45904586
4591- if (nDim == 2 ) WettedArea = AxiFactor * GeometryToolbox::Norm (nDim, Normal);
4592- if (nDim == 3 ) WettedArea = GeometryToolbox::Norm (nDim, Normal);
4587+ WettedArea += AxiFactor * GeometryToolbox::Norm (nDim, Normal);
45934588
45944589 if (Normal[0 ] < 0 ) PositiveXArea -= Normal[0 ];
45954590 if (Normal[1 ] < 0 ) PositiveYArea -= Normal[1 ];
@@ -4605,10 +4600,9 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
46054600 if (CoordZ < MinCoordZ) MinCoordZ = CoordZ;
46064601 if (CoordZ > MaxCoordZ) MaxCoordZ = CoordZ;
46074602 }
4608-
46094603 }
46104604 }
4611-
4605+ }
46124606 }
46134607
46144608 SU2_MPI::Allreduce (&PositiveXArea, &TotalPositiveXArea, 1 , MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm ());
@@ -4627,80 +4621,54 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
46274621
46284622 /* --- Set a reference area if no value is provided ---*/
46294623
4624+ const string L = (config->GetSystemMeasurements () == SI)? " m" : " ft" ;
4625+ const string A = (config->GetSystemMeasurements () == SI)? " m^2" : " ft^2" ;
4626+ const bool D3 = (nDim == 3 );
4627+
46304628 if (config->GetRefArea () == 0.0 ) {
46314629
4632- if (nDim == 3 ) config->SetRefArea (TotalPositiveZArea);
4630+ if (D3 ) config->SetRefArea (TotalPositiveZArea);
46334631 else config->SetRefArea (TotalPositiveYArea);
46344632
46354633 if (rank == MASTER_NODE) {
4636- if (nDim == 3 ) {
4637- cout << " Reference area = " << TotalPositiveZArea;
4638- if (config->GetSystemMeasurements () == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl;
4639- }
4640- else {
4641- cout << " Reference length = " << TotalPositiveYArea;
4642- if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4643- }
4634+ if (D3) cout << " Reference area = " << TotalPositiveZArea << A << " .\n " ;
4635+ else cout << " Reference length = " << TotalPositiveYArea << L << " .\n " ;
46444636 }
4645-
46464637 }
46474638
46484639 /* --- Set a semi-span value if no value is provided ---*/
46494640
46504641 if (config->GetSemiSpan () == 0.0 ) {
46514642
4652- if (nDim == 3 ) config->SetSemiSpan (fabs (TotalMaxCoordY));
4643+ if (D3 ) config->SetSemiSpan (fabs (TotalMaxCoordY));
46534644 else config->SetSemiSpan (1.0 );
46544645
4655- if ((nDim == 3 ) && (rank == MASTER_NODE)) {
4656- cout << " Semi-span length = " << TotalMaxCoordY;
4657- if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4646+ if (D3 && (rank == MASTER_NODE)) {
4647+ cout << " Semi-span length = " << TotalMaxCoordY << L << " .\n " ;
46584648 }
4659-
46604649 }
46614650
46624651 if (rank == MASTER_NODE) {
46634652
46644653 if (fea) cout << " Surface area = " << TotalWettedArea;
46654654 else cout << " Wetted area = " << TotalWettedArea;
4666-
4667- if ((nDim == 3 ) || (axisymmetric)) { if (config->GetSystemMeasurements () == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl; }
4668- else { if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl; }
4669-
4670- cout << " Area projection in the x-plane = " << TotalPositiveXArea;
4671- if (nDim == 3 ) { if (config->GetSystemMeasurements () == SI) cout <<" m^2," ; else cout <<" ft^2," ; }
4672- else { if (config->GetSystemMeasurements () == SI) cout <<" m," ; else cout <<" ft," ; }
4673-
4674- cout << " y-plane = " << TotalPositiveYArea;
4675- if (nDim == 3 ) { if (config->GetSystemMeasurements () == SI) cout <<" m^2," ; else cout <<" ft^2," ; }
4676- else { if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl; }
4677-
4678- if (nDim == 3 ) { cout << " z-plane = " << TotalPositiveZArea;
4679- if (config->GetSystemMeasurements () == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl; }
4680-
4681- cout << " Max. coordinate in the x-direction = " << TotalMaxCoordX;
4682- if (config->GetSystemMeasurements () == SI) cout <<" m," ; else cout <<" ft," ;
4683-
4684- cout << " y-direction = " << TotalMaxCoordY;
4685- if (config->GetSystemMeasurements () == SI) cout <<" m" ; else cout <<" ft" ;
4686-
4687- if (nDim == 3 ) {
4688- cout << " , z-direction = " << TotalMaxCoordZ;
4689- if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4690- }
4691- else cout << " ." << endl;
4692-
4693- cout << " Min. coordinate in the x-direction = " << TotalMinCoordX;
4694- if (config->GetSystemMeasurements () == SI) cout <<" m," ; else cout <<" ft" ;
4695-
4696- cout << " y-direction = " << TotalMinCoordY;
4697- if (config->GetSystemMeasurements () == SI) cout <<" m" ; else cout <<" ft" ;
4698-
4699- if (nDim == 3 ) {
4700- cout << " , z-direction = " << TotalMinCoordZ;
4701- if (config->GetSystemMeasurements () == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4702- }
4703- else cout << " ." << endl;
4655+ if (D3 || axisymmetric) cout << A << " .\n " ;
4656+ else cout << L << " .\n " ;
4657+
4658+ cout << " Area projection in the x-plane = " << TotalPositiveXArea << (D3? A : L);
4659+ cout << " , y-plane = " << TotalPositiveYArea << (D3? A : L);
4660+ if (D3) cout << " , z-plane = " << TotalPositiveZArea << A;
4661+ cout << " .\n " ;
4662+
4663+ cout << " Max. coordinate in the x-direction = " << TotalMaxCoordX << L;
4664+ cout << " , y-direction = " << TotalMaxCoordY << L;
4665+ if (D3) cout << " , z-direction = " << TotalMaxCoordZ << L;
4666+ cout << " .\n " ;
4667+
4668+ cout << " Min. coordinate in the x-direction = " << TotalMinCoordX << L;
4669+ cout << " , y-direction = " << TotalMinCoordY << L;
4670+ if (D3) cout << " , z-direction = " << TotalMinCoordZ << L;
4671+ cout << " ." << endl;
47044672
47054673 }
47064674
0 commit comments