LCOV - code coverage report
Current view: top level - EnergyPlus - SurfaceGeometry.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 10 43 23.3 %
Date: 2023-01-17 19:17:23 Functions: 12 14 85.7 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef SurfaceGeometry_hh_INCLUDED
      49             : #define SurfaceGeometry_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1S.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/DataSurfaces.hh>
      56             : #include <EnergyPlus/DataVectorTypes.hh>
      57             : #include <EnergyPlus/DataViewFactorInformation.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : #include <EnergyPlus/HeatBalanceKivaManager.hh>
      60             : #include <EnergyPlus/Vectors.hh>
      61             : 
      62             : // C++ Headers
      63             : #include <map>
      64             : 
      65             : namespace EnergyPlus {
      66             : 
      67             : // Forward declarations
      68             : struct EnergyPlusData;
      69             : 
      70             : namespace SurfaceGeometry {
      71             : 
      72             :     // Using/Aliasing
      73             :     using DataSurfaces::SurfaceClass;
      74             :     using DataSurfaces::SurfaceData;
      75             :     using DataVectorTypes::Vector;
      76             : 
      77             :     enum enclosureType
      78             :     {
      79             :         RadiantEnclosures,
      80             :         SolarEnclosures
      81             :     };
      82             : 
      83             :     void SetupZoneGeometry(EnergyPlusData &state, bool &ErrorsFound);
      84             : 
      85             :     void AllocateSurfaceArrays(EnergyPlusData &state);
      86             : 
      87             :     void AllocateSurfaceWindows(EnergyPlusData &state, int NumSurfaces);
      88             : 
      89             :     void GetSurfaceData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
      90             : 
      91             :     void CreateMissingSpaces(EnergyPlusData &state, Array1D<SurfaceGeometry::SurfaceData> &Surfaces);
      92             : 
      93             :     void createSpaceSurfaceLists(EnergyPlusData &state, bool &ErrorsFound);
      94             : 
      95             :     void checkSubSurfAzTiltNorm(EnergyPlusData &state,
      96             :                                 SurfaceData &baseSurface, // Base surface data (in)
      97             :                                 SurfaceData &subSurface,  // Subsurface data (in)
      98             :                                 bool &surfaceError        // True if there is subsurface error that requires a fatal
      99             :     );
     100             : 
     101             :     void GetGeometryParameters(EnergyPlusData &state, bool &ErrorsFound); // set to true if errors found during input
     102             : 
     103             :     void GetDetShdSurfaceData(EnergyPlusData &state,
     104             :                               bool &ErrorsFound,          // Error flag indicator (true if errors found)
     105             :                               int &SurfNum,               // Count of Current SurfaceNumber
     106             :                               int const TotDetachedFixed, // Number of Fixed Detached Shading Surfaces to obtain
     107             :                               int const TotDetachedBldg   // Number of Building Detached Shading Surfaces to obtain
     108             :     );
     109             : 
     110             :     void GetRectDetShdSurfaceData(EnergyPlusData &state,
     111             :                                   bool &ErrorsFound,              // Error flag indicator (true if errors found)
     112             :                                   int &SurfNum,                   // Count of Current SurfaceNumber
     113             :                                   int const TotRectDetachedFixed, // Number of Fixed Detached Shading Surfaces to obtain
     114             :                                   int const TotRectDetachedBldg   // Number of Building Detached Shading Surfaces to obtain
     115             :     );
     116             : 
     117             :     void GetHTSurfaceData(EnergyPlusData &state,
     118             :                           bool &ErrorsFound,                 // Error flag indicator (true if errors found)
     119             :                           int &SurfNum,                      // Count of Current SurfaceNumber
     120             :                           int const TotHTSurfs,              // Number of Heat Transfer Base Surfaces to obtain
     121             :                           int const TotDetailedWalls,        // Number of Wall:Detailed items to obtain
     122             :                           int const TotDetailedRoofs,        // Number of RoofCeiling:Detailed items to obtain
     123             :                           int const TotDetailedFloors,       // Number of Floor:Detailed items to obtain
     124             :                           const Array1D_string &BaseSurfCls, // Valid Classes for Base Surfaces
     125             :                           const Array1D<SurfaceClass> &BaseSurfIDs,
     126             :                           int &NeedToAddSurfaces // Number of surfaces to add, based on unentered IZ surfaces
     127             :     );
     128             : 
     129             :     void GetRectSurfaces(EnergyPlusData &state,
     130             :                          bool &ErrorsFound,                        // Error flag indicator (true if errors found)
     131             :                          int &SurfNum,                             // Count of Current SurfaceNumber
     132             :                          int const TotRectExtWalls,                // Number of Exterior Walls to obtain
     133             :                          int const TotRectIntWalls,                // Number of Adiabatic Walls to obtain
     134             :                          int const TotRectIZWalls,                 // Number of Interzone Walls to obtain
     135             :                          int const TotRectUGWalls,                 // Number of Underground to obtain
     136             :                          int const TotRectRoofs,                   // Number of Roofs to obtain
     137             :                          int const TotRectCeilings,                // Number of Adiabatic Ceilings to obtain
     138             :                          int const TotRectIZCeilings,              // Number of Interzone Ceilings to obtain
     139             :                          int const TotRectGCFloors,                // Number of Floors with Ground Contact to obtain
     140             :                          int const TotRectIntFloors,               // Number of Adiabatic Walls to obtain
     141             :                          int const TotRectIZFloors,                // Number of Interzone Floors to obtain
     142             :                          const Array1D<SurfaceClass> &BaseSurfIDs, // ID Assignments for valid surface classes
     143             :                          int &NeedToAddSurfaces                    // Number of surfaces to add, based on unentered IZ surfaces
     144             :     );
     145             : 
     146             :     void MakeRectangularVertices(EnergyPlusData &state,
     147             :                                  int const SurfNum,
     148             :                                  Real64 const XCoord,
     149             :                                  Real64 const YCoord,
     150             :                                  Real64 const ZCoord,
     151             :                                  Real64 const Length,
     152             :                                  Real64 const Height,
     153             :                                  bool const SurfWorldCoordSystem);
     154             : 
     155             :     void GetHTSubSurfaceData(EnergyPlusData &state,
     156             :                              bool &ErrorsFound,                       // Error flag indicator (true if errors found)
     157             :                              int &SurfNum,                            // Count of Current SurfaceNumber
     158             :                              int const TotHTSubs,                     // Number of Heat Transfer SubSurfaces to obtain
     159             :                              const Array1D_string &SubSurfCls,        // Valid Classes for Sub Surfaces
     160             :                              const Array1D<SurfaceClass> &SubSurfIDs, // ID Assignments for valid sub surface classes
     161             :                              int &AddedSubSurfaces,                   // Subsurfaces added when windows reference Window5
     162             :                              int &NeedToAddSurfaces                   // Number of surfaces to add, based on unentered IZ surfaces
     163             :     );
     164             : 
     165             :     void GetRectSubSurfaces(EnergyPlusData &state,
     166             :                             bool &ErrorsFound,                       // Error flag indicator (true if errors found)
     167             :                             int &SurfNum,                            // Count of Current SurfaceNumber
     168             :                             int const TotWindows,                    // Number of Window SubSurfaces to obtain
     169             :                             int const TotDoors,                      // Number of Door SubSurfaces to obtain
     170             :                             int const TotGlazedDoors,                // Number of Glass Door SubSurfaces to obtain
     171             :                             int const TotIZWindows,                  // Number of Interzone Window SubSurfaces to obtain
     172             :                             int const TotIZDoors,                    // Number of Interzone Door SubSurfaces to obtain
     173             :                             int const TotIZGlazedDoors,              // Number of Interzone Glass Door SubSurfaces to obtain
     174             :                             const Array1D<SurfaceClass> &SubSurfIDs, // ID Assignments for valid sub surface classes
     175             :                             int &AddedSubSurfaces,                   // Subsurfaces added when windows reference Window5
     176             :                             int &NeedToAddSubSurfaces                // Number of surfaces to add, based on unentered IZ surfaces
     177             :     );
     178             : 
     179             :     void CheckWindowShadingControlFrameDivider(EnergyPlusData &state,
     180             :                                                std::string_view const cRoutineName, // routine name calling this one (for error messages)
     181             :                                                bool &ErrorsFound,                   // true if errors have been found or are found here
     182             :                                                int const SurfNum,                   // current surface number
     183             :                                                int const FrameField                 // field number for frame/divider
     184             :     );
     185             : 
     186             :     void CheckSubSurfaceMiscellaneous(EnergyPlusData &state,
     187             :                                       std::string_view const cRoutineName,       // routine name calling this one (for error messages)
     188             :                                       bool &ErrorsFound,                         // true if errors have been found or are found here
     189             :                                       int const SurfNum,                         // current surface number
     190             :                                       std::string const &SubSurfaceName,         // name of the surface
     191             :                                       std::string const &SubSurfaceConstruction, // name of the construction
     192             :                                       int &AddedSubSurfaces);
     193             : 
     194             :     void MakeRelativeRectangularVertices(EnergyPlusData &state,
     195             :                                          int const BaseSurfNum, // Base surface
     196             :                                          int const SurfNum,
     197             :                                          Real64 const XCoord,
     198             :                                          Real64 const ZCoord,
     199             :                                          Real64 const Length,
     200             :                                          Real64 const Height);
     201             : 
     202             :     void MakeEquivalentRectangle(EnergyPlusData &state,
     203             :                                  int const SurfNum, // Surface number
     204             :                                  bool &ErrorsFound  // Error flag indicator (true if errors found)
     205             :     );
     206             : 
     207             :     void GetAttShdSurfaceData(EnergyPlusData &state,
     208             :                               bool &ErrorsFound,   // Error flag indicator (true if errors found)
     209             :                               int &SurfNum,        // Count of Current SurfaceNumber
     210             :                               int const TotShdSubs // Number of Attached Shading SubSurfaces to obtain
     211             :     );
     212             : 
     213             :     void GetSimpleShdSurfaceData(EnergyPlusData &state,
     214             :                                  bool &ErrorsFound,                // Error flag indicator (true if errors found)
     215             :                                  int &SurfNum,                     // Count of Current SurfaceNumber
     216             :                                  int const TotOverhangs,           // Number of Overhangs to obtain
     217             :                                  int const TotOverhangsProjection, // Number of Overhangs (projection) to obtain
     218             :                                  int const TotFins,                // Number of Fins to obtain
     219             :                                  int const TotFinsProjection       // Number of Fins (projection) to obtain
     220             :     );
     221             : 
     222             :     void GetIntMassSurfaceData(EnergyPlusData &state,
     223             :                                bool &ErrorsFound, // Error flag indicator (true if errors found)
     224             :                                int &SurfNum       // Count of Current SurfaceNumber
     225             :     );
     226             : 
     227             :     int GetNumIntMassSurfaces(EnergyPlusData &state); // Number of Internal Mass Surfaces to obtain
     228             : 
     229             :     void GetShadingSurfReflectanceData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     230             : 
     231             :     void GetSurfaceSrdSurfsData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     232             : 
     233             :     void GetSurfaceLocalEnvData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     234             : 
     235             :     void GetHTSurfExtVentedCavityData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     236             : 
     237             :     void GetSurfaceHeatTransferAlgorithmOverrides(EnergyPlusData &state, bool &ErrorsFound);
     238             : 
     239             :     void GetSurfaceGroundSurfsData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     240             : 
     241        1542 :     class ExposedFoundationPerimeter
     242             :     {
     243             :     public:
     244             :         void getData(EnergyPlusData &state, bool &ErrorsFound);
     245         115 :         struct Data
     246             :         {
     247             :             double exposedFraction = -1; // hush up cppcheck
     248             :             std::vector<bool> isExposedPerimeter;
     249             :             bool useDetailedExposedPerimeter;
     250             :         };
     251             :         std::map<int, Data> surfaceMap;
     252             :     };
     253             : 
     254             :     void GetVertices(EnergyPlusData &state,
     255             :                      int const SurfNum,             // Current surface number
     256             :                      int const NSides,              // Number of sides to figure
     257             :                      Array1S<Real64> const Vertices // Vertices, in specified order
     258             :     );
     259             : 
     260             :     void ReverseAndRecalculate(EnergyPlusData &state,
     261             :                                int const SurfNum,   // Surface number for the surface
     262             :                                int const NSides,    // number of sides to surface
     263             :                                Real64 &SurfAzimuth, // Surface Facing angle (will be 0 for roofs/floors)
     264             :                                Real64 &SurfTilt     // Surface tilt (
     265             :     );
     266             : 
     267             :     void MakeMirrorSurface(EnergyPlusData &state, int &SurfNum); // In=>Surface to Mirror, Out=>new Surface index
     268             : 
     269             :     void GetWindowShadingControlData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     270             : 
     271             :     void InitialAssociateWindowShadingControlFenestration(EnergyPlusData &state, bool &ErrorsFound, int &SurfNum);
     272             : 
     273             :     void FinalAssociateWindowShadingControlFenestration(EnergyPlusData &state, bool &ErrorsFound);
     274             : 
     275             :     void CheckWindowShadingControlSimilarForWindow(EnergyPlusData &state, bool &ErrorsFound);
     276             : 
     277             :     bool isWindowShadingControlSimilar(EnergyPlusData &state, int a, int b);
     278             : 
     279             :     void GetStormWindowData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     280             : 
     281             :     void GetWindowGapAirflowControlData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     282             : 
     283             :     void GetOSCData(EnergyPlusData &state, bool &ErrorsFound);
     284             : 
     285             :     void GetOSCMData(EnergyPlusData &state, bool &ErrorsFound);
     286             : 
     287             :     void GetFoundationData(EnergyPlusData &state, bool &ErrorsFound);
     288             : 
     289             :     void GetMovableInsulationData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     290             : 
     291             :     void CalculateZoneVolume(EnergyPlusData &state, const Array1D_bool &CeilingHeightEntered);
     292             : 
     293      128963 :     struct EdgeOfSurf
     294             :     {
     295             :         int surfNum = 0;
     296             :         Vector start;
     297             :         Vector end;
     298             :         std::vector<int> otherSurfNums;
     299             :         int count = 0;
     300       20425 :         EdgeOfSurf() : start(Vector(0., 0., 0.)), end(Vector(0., 0., 0.))
     301             :         {
     302       20425 :         }
     303             : 
     304             :         bool operator==(const EdgeOfSurf &other) const;
     305             :         bool operator!=(const EdgeOfSurf &other) const;
     306             :         bool containsPoints(const Vector &vertex) const;
     307             :         double length() const;
     308             :     };
     309             : 
     310             :     bool isEnclosedVolume(DataVectorTypes::Polyhedron const &zonePoly, std::vector<EdgeOfSurf> &edgeNot2);
     311             : 
     312             :     std::vector<EdgeOfSurf> edgesInBoth(std::vector<EdgeOfSurf> edges1, std::vector<EdgeOfSurf> edges2);
     313             : 
     314             :     bool edgesEqualOnSameSurface(EdgeOfSurf a, EdgeOfSurf b);
     315             : 
     316             :     std::vector<EdgeOfSurf> edgesNotTwoForEnclosedVolumeTest(DataVectorTypes::Polyhedron const &zonePoly, std::vector<Vector> const &uniqueVertices);
     317             : 
     318             :     std::vector<Vector> makeListOfUniqueVertices(DataVectorTypes::Polyhedron const &zonePoly);
     319             : 
     320             :     DataVectorTypes::Polyhedron updateZonePolygonsForMissingColinearPoints(DataVectorTypes::Polyhedron const &zonePoly,
     321             :                                                                            std::vector<Vector> const &uniqVertices);
     322             : 
     323             :     bool areFloorAndCeilingSame(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     324             : 
     325             :     bool areWallHeightSame(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     326             : 
     327             :     std::tuple<bool, bool, bool> areSurfaceHorizAndVert(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     328             : 
     329             :     bool areOppositeWallsSame(EnergyPlusData &state,
     330             :                               DataVectorTypes::Polyhedron const &zonePoly,
     331             :                               Real64 &oppositeWallArea,
     332             :                               Real64 &distanceBetweenOppositeWalls);
     333             : 
     334             :     std::vector<int> listOfFacesFacingAzimuth(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly, Real64 azimuth);
     335             : 
     336             :     int findPossibleOppositeFace(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly, int faceIndex);
     337             : 
     338             :     bool areCornersEquidistant(DataVectorTypes::Polyhedron const &zonePoly, int faceIndex, int opFaceIndex, Real64 &distanceBetween);
     339             : 
     340             :     bool isAlmostEqual3dPt(DataVectorTypes::Vector v1, DataVectorTypes::Vector v2);
     341             : 
     342             :     bool isAlmostEqual2dPt(DataVectorTypes::Vector_2d v1, DataVectorTypes::Vector_2d v2);
     343             : 
     344             :     int findIndexOfVertex(DataVectorTypes::Vector vertexToFind, std::vector<DataVectorTypes::Vector> listOfVertices);
     345             : 
     346             :     Real64 distance(DataVectorTypes::Vector v1, DataVectorTypes::Vector v2);
     347             : 
     348             :     Real64 distanceFromPointToLine(DataVectorTypes::Vector start, DataVectorTypes::Vector end, DataVectorTypes::Vector test);
     349             : 
     350             :     bool isPointOnLineBetweenPoints(DataVectorTypes::Vector start, DataVectorTypes::Vector end, DataVectorTypes::Vector test);
     351             : 
     352             :     void ProcessSurfaceVertices(EnergyPlusData &state, int const ThisSurf, bool &ErrorsFound);
     353             : 
     354             :     void CalcCoordinateTransformation(EnergyPlusData &state,
     355             :                                       int const SurfNum,            // Surface Number
     356             :                                       Vector &CompCoordTranslVector // Coordinate Translation Vector
     357             :     );
     358             : 
     359             :     void CreateShadedWindowConstruction(EnergyPlusData &state,
     360             :                                         int const SurfNum,          // Surface number
     361             :                                         int const WSCPtr,           // Pointer to WindowShadingControl for SurfNum
     362             :                                         int const ShDevNum,         // Shading device material number for WSCptr
     363             :                                         int const shadeControlIndex // index to the Surface().windowShadingControlList,
     364             :                                                                     // Surface().shadedConstructionList, and Surface().shadedStormWinConstructionList
     365             :     );
     366             : 
     367             :     void CreateStormWindowConstructions(EnergyPlusData &state);
     368             : 
     369             :     int createAirMaterialFromDistance(EnergyPlusData &state, Real64 distance, std::string namePrefix); // return new material number
     370             : 
     371             :     // create a new construction with storm based on an old construction and storm and gap materials
     372             :     int createConstructionWithStorm(EnergyPlusData &state, int oldConstruction, std::string name, int stormMaterial, int gapMaterial);
     373             : 
     374             :     void ModifyWindow(EnergyPlusData &state,
     375             :                       int const SurfNum,    // SurfNum has construction of glazing system from Window5 Data File;
     376             :                       bool &ErrorsFound,    // Set to true if errors found
     377             :                       int &AddedSubSurfaces // Subsurfaces added when window references a
     378             :     );
     379             : 
     380             :     void AddWindow(EnergyPlusData &state,
     381             :                    int const SurfNum,    // SurfNum has construction of glazing system from Window5 Data File;
     382             :                    bool &ErrorsFound,    // Set to true if errors found
     383             :                    int &AddedSubSurfaces // Subsurfaces added when window references a
     384             :     );
     385             : 
     386             :     void TransformVertsByAspect(EnergyPlusData &state,
     387             :                                 int const SurfNum, // Current surface number
     388             :                                 int const NSides   // Number of sides to figure
     389             :     );
     390             : 
     391             :     void CalcSurfaceCentroid(EnergyPlusData &state);
     392             : 
     393             :     void SetupShadeSurfacesForSolarCalcs(EnergyPlusData &state);
     394             : 
     395             :     void
     396             :     SetupEnclosuresAndAirBoundaries(EnergyPlusData &state,
     397             :                                     EPVector<DataViewFactorInformation::EnclosureViewFactorInformation> &Enclosures, // Radiant or Solar Enclosures
     398             :                                     SurfaceGeometry::enclosureType EnclosureType,                                    // Radiant or Solar
     399             :                                     bool &ErrorsFound);                                                              // Set to true if errors found
     400             : 
     401             :     void CheckConvexity(EnergyPlusData &state,
     402             :                         int const SurfNum, // Current surface number
     403             :                         int const NSides   // Number of sides to figure
     404             :     );
     405             : 
     406             :     bool isRectangle(EnergyPlusData &state, int const ThisSurf // Current surface number
     407             :     );
     408             : 
     409             :     void CheckForReversedLayers(EnergyPlusData &state,
     410             :                                 bool &RevLayerDiffs,    // true when differences are discovered in interzone constructions
     411             :                                 int const ConstrNum,    // construction index
     412             :                                 int const ConstrNumRev, // construction index for reversed construction
     413             :                                 int const TotalLayers   // total layers for construction definition
     414             :     );
     415             : 
     416             : } // namespace SurfaceGeometry
     417             : 
     418         771 : struct SurfaceGeometryData : BaseGlobalStruct
     419             : {
     420             : 
     421             :     Real64 CosBldgRelNorth = 0.0;    // Cosine of the building rotation (relative north) (includes appendix G rotation)
     422             :     Real64 SinBldgRelNorth = 0.0;    // Sine of the building rotation (relative north)   (includes appendix G rotation)
     423             :     Real64 CosBldgRotAppGonly = 0.0; // Cosine of the building rotation for appendix G only(relative north)
     424             :     Real64 SinBldgRotAppGonly = 0.0; // Sine of the building rotation for appendix G only (relative north)
     425             :     Array1D<Real64> CosZoneRelNorth; // Cosine of the zone rotation (relative north)
     426             :     Array1D<Real64> SinZoneRelNorth; // Sine of the zone rotation (relative north)
     427             : 
     428             :     bool NoGroundTempObjWarning = true;   // This will cause a warning to be issued if surfaces with "Ground"
     429             :                                           // outside environment are used but no ground temperature object was input.
     430             :     bool NoFCGroundTempObjWarning = true; // This will cause a warning to be issued if surfaces with "GroundFCfactorMethod"
     431             :                                           // outside environment are used but no FC ground temperatures was input.
     432             :     bool RectSurfRefWorldCoordSystem =
     433             :         false;             // GlobalGeometryRules:Field Rectangular Surface Coordinate System (A5) = World (true) or Relative (false)
     434             :     int Warning1Count = 0; // counts of Modify Window 5/6 windows
     435             :     int Warning2Count = 0; // counts of overriding exterior windows with Window 5/6 glazing systems
     436             :     int Warning3Count = 0; // counts of overriding interior windows with Window 5/6 glazing systems
     437             : 
     438             :     bool ProcessSurfaceVerticesOneTimeFlag = true;
     439             :     int checkSubSurfAzTiltNormErrCount = 0;
     440             :     Array1D<Real64> Xpsv;
     441             :     Array1D<Real64> Ypsv;
     442             :     Array1D<Real64> Zpsv;
     443             : 
     444             :     bool GetSurfaceDataOneTimeFlag = false;
     445             :     std::unordered_map<std::string, std::string> UniqueSurfaceNames;
     446             :     bool firstTime = true;
     447             :     bool noTransform = true;
     448             :     bool CheckConvexityFirstTime = true;
     449             : 
     450             :     Array1D_string const BaseSurfCls;
     451             :     Array1D_string const SubSurfCls;
     452             :     Array1D<DataSurfaces::SurfaceClass> const BaseSurfIDs;
     453             :     Array1D<DataSurfaces::SurfaceClass> const SubSurfIDs;
     454             :     Array1D<SurfaceGeometry::SurfaceData> SurfaceTmp; // Allocated/Deallocated during input processing
     455             :     HeatBalanceKivaManager::KivaManager kivaManager;
     456             :     SurfaceGeometry::ExposedFoundationPerimeter exposedFoundationPerimeter;
     457             : 
     458             :     int ErrCount = 0;
     459             :     bool WarningDisplayed = false;
     460             :     int ErrCount2 = 0;
     461             :     int ErrCount3 = 0;
     462             :     int ErrCount4 = 0; // counts of interzone area mismatches.
     463             :     bool ShowZoneSurfaceHeaders = true;
     464             :     int ErrCount5 = 0;
     465             :     Real64 OldAspectRatio = 0.0;
     466             :     Real64 NewAspectRatio = 0.0;
     467             :     std::string transformPlane;
     468             :     Array1D<Vectors::Vector> Triangle1 = Array1D<Vectors::Vector>(3); // working struct for a 3-sided surface
     469             :     Array1D<Vectors::Vector> Triangle2 = Array1D<Vectors::Vector>(3); // working struct for a 3-sided surface
     470             :     Array1D<Real64> X;                                                // containers for x,y,z vertices of the surface
     471             :     Array1D<Real64> Y;
     472             :     Array1D<Real64> Z;
     473             :     Array1D<Real64> A; // containers for convexity test
     474             :     Array1D<Real64> B;
     475             :     int VertSize = 0; // size of X,Y,Z,A,B arrays
     476             : 
     477           0 :     void clear_state() override
     478             :     {
     479           0 :         ProcessSurfaceVerticesOneTimeFlag = true;
     480           0 :         checkSubSurfAzTiltNormErrCount = 0;
     481           0 :         Xpsv.deallocate();
     482           0 :         Ypsv.deallocate();
     483           0 :         Zpsv.deallocate();
     484             :         // Following are used only during getting vertices, so are module variables here.
     485           0 :         CosBldgRelNorth = 0.0;
     486           0 :         SinBldgRelNorth = 0.0;
     487           0 :         CosBldgRotAppGonly = 0.0;
     488           0 :         SinBldgRotAppGonly = 0.0;
     489           0 :         CosZoneRelNorth.deallocate();
     490           0 :         SinZoneRelNorth.deallocate();
     491           0 :         NoGroundTempObjWarning = true;
     492           0 :         NoFCGroundTempObjWarning = true;
     493           0 :         RectSurfRefWorldCoordSystem = false;
     494           0 :         Warning1Count = 0;
     495           0 :         Warning2Count = 0;
     496           0 :         Warning3Count = 0;
     497           0 :         SurfaceTmp.deallocate();
     498           0 :         GetSurfaceDataOneTimeFlag = false;
     499           0 :         UniqueSurfaceNames.clear();
     500           0 :         kivaManager = HeatBalanceKivaManager::KivaManager();
     501           0 :         firstTime = true;
     502           0 :         noTransform = true;
     503           0 :         CheckConvexityFirstTime = true;
     504           0 :         ErrCount = 0;
     505           0 :         WarningDisplayed = false;
     506           0 :         ErrCount2 = 0;
     507           0 :         ErrCount3 = 0;
     508           0 :         ErrCount4 = 0;
     509           0 :         ErrCount5 = 0;
     510           0 :         ShowZoneSurfaceHeaders = true;
     511           0 :     }
     512             : 
     513             :     // Default Constructor
     514         771 :     SurfaceGeometryData()
     515         771 :         : BaseSurfCls(3, {"WALL", "FLOOR", "ROOF"}),
     516             :           SubSurfCls(6, {"WINDOW", "DOOR", "GLASSDOOR", "SHADING", "TUBULARDAYLIGHTDOME", "TUBULARDAYLIGHTDIFFUSER"}),
     517             :           BaseSurfIDs(3, {DataSurfaces::SurfaceClass::Wall, DataSurfaces::SurfaceClass::Floor, DataSurfaces::SurfaceClass::Roof}),
     518             :           SubSurfIDs(6,
     519             :                      {DataSurfaces::SurfaceClass::Window,
     520             :                       DataSurfaces::SurfaceClass::Door,
     521             :                       DataSurfaces::SurfaceClass::GlassDoor,
     522             :                       DataSurfaces::SurfaceClass::Shading,
     523             :                       DataSurfaces::SurfaceClass::TDD_Dome,
     524         771 :                       DataSurfaces::SurfaceClass::TDD_Diffuser})
     525             :     {
     526         771 :     }
     527             : };
     528             : } // namespace EnergyPlus
     529             : 
     530             : #endif

Generated by: LCOV version 1.13