LCOV - code coverage report
Current view: top level - EnergyPlus - DataSystemVariables.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 1 43 2.3 %
Date: 2023-01-17 19:17:23 Functions: 2 3 66.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 DataSystemVariables_hh_INCLUDED
      49             : #define DataSystemVariables_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <string>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/EnergyPlusData.hh>
      56             : #include <EnergyPlus/EnergyPlus.hh>
      57             : #include <EnergyPlus/FileSystem.hh>
      58             : #include <EnergyPlus/IOFiles.hh>
      59             : 
      60             : namespace EnergyPlus {
      61             : 
      62             : // Forward declarations
      63             : struct EnergyPlusData;
      64             : 
      65             : namespace DataSystemVariables {
      66             : 
      67             :     int constexpr iUnicode_end = 0; // endline value when Unicode file
      68             : 
      69             :     // Shading methods
      70             :     enum class ShadingMethod
      71             :     {
      72             :         Invalid = -1,
      73             :         PolygonClipping,
      74             :         PixelCounting,
      75             :         Scheduled,
      76             :         Imported,
      77             :         Num
      78             :     };
      79             : 
      80             :     // Functions
      81             : 
      82             :     // Helper to try and locate a file in common folders if it's not found directly (such as when passed as a filename only). Looks in current
      83             :     // working folder, programs folder, etc.
      84             :     // Returns an empty path if not found.
      85             :     [[nodiscard]] fs::path CheckForActualFilePath(EnergyPlusData &state,
      86             :                                                   fs::path const &originalInputFilePath, // path (or filename only) as input for object
      87             :                                                   const std::string &contextString = std::string());
      88             : 
      89             :     void processEnvironmentVariables(EnergyPlusData &state);
      90             : 
      91             : } // namespace DataSystemVariables
      92             : 
      93        1542 : struct SystemVarsData : BaseGlobalStruct
      94             : {
      95             :     bool firstTime = true;
      96             : 
      97             :     DataSystemVariables::ShadingMethod shadingMethod = DataSystemVariables::ShadingMethod::PolygonClipping; // defines the shading method used
      98             : 
      99             :     bool DDOnly = false;             // TRUE if design days (sizingperiod:*) only are to be run.
     100             :     bool ReverseDD = false;          // TRUE if reverse design days (reordering sizingperiod:*) are to be run.
     101             :     bool DisableGLHECaching = false; // TRUE if caching is to be disabled, for example, during unit tests.
     102             :     bool FullAnnualRun = false;      // TRUE if full annual simulation is to be run.
     103             :     bool DeveloperFlag = false;      // TRUE if developer flag is turned on. (turns on more displays to console)
     104             :     bool TimingFlag = false;         // TRUE if timing flag is turned on. (turns on more timing displays to console)
     105             : 
     106             :     bool SutherlandHodgman = true;                 // TRUE if SutherlandHodgman algorithm for polygon clipping is to be used.
     107             :     bool SlaterBarsky = false;                     // TRUE if SlaterBarsky algorithm for polygon clipping is to be used for vertical polygons.
     108             :     bool DetailedSkyDiffuseAlgorithm = false;      // use detailed diffuse shading algorithm for sky (shading transmittance varies)
     109             :     bool DetailedSolarTimestepIntegration = false; // when true, use detailed timestep integration for all solar,shading, etc.
     110             : 
     111             :     bool ReportExtShadingSunlitFrac = false; // when true, the sunlit fraction for all surfaces are exported as a csv format output
     112             :     bool DisableGroupSelfShading = false;    // when true, defined shadowing surfaces group is ignored when calculating sunlit fraction
     113             :     bool DisableAllSelfShading = false;      // when true, all external shadowing surfaces is ignored when calculating sunlit fraction
     114             : 
     115             :     bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC
     116             :     //  controller on each air loop
     117             :     bool TraceAirLoopEnvFlag = false; // If TRUE generates a trace file with the converged solutions of all
     118             :     // HVAC controllers on each air loop at each call to SimAirLoop()
     119             :     bool TraceHVACControllerEnvFlag = false; // If TRUE generates a trace file for each individual HVAC
     120             :     // controller with all controller iterations
     121             : 
     122             :     bool ReportDuringWarmup = false;                      // True when the report outputs even during warmup
     123             :     bool ReportDuringHVACSizingSimulation = false;        // true when reporting outputs during HVAC sizing Simulation
     124             :     bool ReportDetailedWarmupConvergence = false;         // True when the detailed warmup convergence is requested
     125             :     bool UpdateDataDuringWarmupExternalInterface = false; // variable sets in the external interface.
     126             : 
     127             :     // This update the value during the warmup added for FMI
     128             :     Real64 Elapsed_Time = 0.0;      // For showing elapsed time at end of run
     129             :     Real64 Time_Start = 0.0;        // Call to CPU_Time for start time of simulation
     130             :     Real64 Time_Finish = 0.0;       // Call to CPU_Time for end time of simulation
     131             :     std::string MinReportFrequency; // String for minimum reporting frequency
     132             :     bool SortedIDD = true;          // after processing, use sorted IDD to obtain Defs, etc.
     133             :     bool lMinimalShadowing = false; // TRUE if Minimal is to override Solar Distribution flag
     134             :     fs::path envinputpath1;
     135             :     fs::path envinputpath2;
     136             :     bool TestAllPaths = false;
     137             :     int iEnvSetThreads = 0;
     138             :     bool lEnvSetThreadsInput = false;
     139             :     int iepEnvSetThreads = 0;
     140             :     bool lepSetThreadsInput = false;
     141             :     int iIDFSetThreads = 0;
     142             :     bool lIDFSetThreadsInput = false;
     143             :     int inumActiveSims = 1;
     144             :     bool lnumActiveSims = false;
     145             :     int MaxNumberOfThreads = 1;
     146             :     int NumberIntRadThreads = 1;
     147             :     int iNominalTotSurfaces = 0;
     148             :     bool Threading = false;
     149             : 
     150           0 :     void clear_state() override
     151             :     {
     152           0 :         shadingMethod = DataSystemVariables::ShadingMethod::PolygonClipping;
     153           0 :         DDOnly = false;
     154           0 :         ReverseDD = false;
     155           0 :         DisableGLHECaching = false;
     156           0 :         FullAnnualRun = false;
     157           0 :         DeveloperFlag = false;
     158           0 :         TimingFlag = false;
     159             : 
     160           0 :         firstTime = true;
     161             : 
     162           0 :         SutherlandHodgman = true;
     163           0 :         SlaterBarsky = false;
     164           0 :         DetailedSkyDiffuseAlgorithm = false;
     165           0 :         DetailedSolarTimestepIntegration = false;
     166             : 
     167           0 :         ReportExtShadingSunlitFrac = false;
     168           0 :         DisableGroupSelfShading = false;
     169           0 :         DisableAllSelfShading = false;
     170             : 
     171           0 :         TrackAirLoopEnvFlag = false;
     172           0 :         TraceAirLoopEnvFlag = false;
     173           0 :         TraceHVACControllerEnvFlag = false;
     174             : 
     175           0 :         ReportDuringWarmup = false;
     176           0 :         ReportDuringHVACSizingSimulation = false;
     177           0 :         ReportDetailedWarmupConvergence = false;
     178           0 :         UpdateDataDuringWarmupExternalInterface = false;
     179             : 
     180           0 :         Elapsed_Time = 0.0;
     181           0 :         Time_Start = 0.0;
     182           0 :         Time_Finish = 0.0;
     183           0 :         SortedIDD = true;
     184           0 :         lMinimalShadowing = false;
     185           0 :         TestAllPaths = false;
     186           0 :         iEnvSetThreads = 0;
     187           0 :         lEnvSetThreadsInput = false;
     188           0 :         iepEnvSetThreads = 0;
     189           0 :         lepSetThreadsInput = false;
     190           0 :         iIDFSetThreads = 0;
     191           0 :         lIDFSetThreadsInput = false;
     192           0 :         inumActiveSims = 1;
     193           0 :         lnumActiveSims = false;
     194           0 :         MaxNumberOfThreads = 1;
     195           0 :         NumberIntRadThreads = 1;
     196           0 :         iNominalTotSurfaces = 0;
     197           0 :         Threading = false;
     198           0 :     }
     199             : };
     200             : 
     201             : } // namespace EnergyPlus
     202             : 
     203             : #endif

Generated by: LCOV version 1.13