Skip to content

Commit

Permalink
Merge branch 'develop' into 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tijcolem committed May 22, 2023
2 parents 9ee7894 + 1c6fe48 commit bb94815
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 23 deletions.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,18 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clan
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=undefined")
endif()

option(ENABLE_NORECOVER_SANITIZER "When any sanitizer that supports it report an error, exit with non zero" OFF)
if(ENABLE_NORECOVER_SANITIZER)
add_definitions(-fno-sanitize-recover=all)
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fno-sanitize-recover=all")
endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")


mark_as_advanced(ENABLE_COVERAGE ENABLE_THREAD_SANITIZER ENABLE_ADDRESS_SANITIZER ENABLE_UNDEFINED_SANITIZER)
mark_as_advanced(ENABLE_COVERAGE ENABLE_THREAD_SANITIZER ENABLE_ADDRESS_SANITIZER ENABLE_UNDEFINED_SANITIZER ENABLE_NORECOVER_SANITIZER)

endif()

Expand Down Expand Up @@ -515,6 +521,9 @@ if(UNIX)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# DLM: had to add this due to issues with boost optional and gcc, may be resolved if we move to std::optional
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized")
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized")
endif()
endif()
endif()

Expand Down
3 changes: 2 additions & 1 deletion ProjectMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ macro(CREATE_TEST_TARGETS BASE_NAME SRC DEPENDENCIES)

# Tell cmake to discover tests by calling test_exe --gtest_list_tests
gtest_discover_tests(${BASE_NAME}_tests
PROPERTIES TIMEOUT 660
PROPERTIES TIMEOUT 660 # Test execution
DISCOVERY_TIMEOUT 60 # Time to wait for the test to enumerate available tests (default is 5s, which can fail for us especially in Debug with Sanitizers)
)

if(TARGET "${BASE_NAME}_resources")
Expand Down
2 changes: 1 addition & 1 deletion src/model/AirConditionerVariableRefrigerantFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlow_Impl::autosizedResistiveDefrostHeaterCapacity() const {
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "");
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "W");
}

boost::optional<double> AirConditionerVariableRefrigerantFlow_Impl::autosizedWaterCondenserVolumeFlowRate() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::autosizedRatedEvaporativeCapacity() {
return getAutosizedValue("Design Size Rated Evaporative Capacity", "W");
// EPLUS-SQL-INCONSISTENCY + NOT IN SQL AT ALL
return getAutosizedValue("Design Size Rated Evaporative Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

double AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::ratedCompressorPowerPerUnitofRatedEvaporativeCapacity() const {
Expand Down Expand Up @@ -501,7 +502,8 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::autosizedResistiveDefrostHeaterCapacity() {
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

double AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::maximumOutdoorDrybulbTemperatureforDefrostOperation() const {
Expand Down Expand Up @@ -905,11 +907,13 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::autosizedGrossRatedTotalCoolingCapacity() const {
return getAutosizedValue("Design Size Rated Total Cooling Capacity (gross)", "W");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Rated Total Cooling Capacity (gross)", "W", "AirConditioner:VariableRefrigerantFlow");
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::autosizedGrossRatedHeatingCapacity() const {
return getAutosizedValue("Design Size Rated Total Heating Capacity", "W");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Rated Total Heating Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

ComponentType AirConditionerVariableRefrigerantFlowFluidTemperatureControl_Impl::componentType() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::autosizedRatedEvaporativeCapacity() {
return getAutosizedValue("Design Size Rated Evaporative Capacity", "W");
// EPLUS-SQL-INCONSISTENCY + NOT IN SQL AT ALL
return getAutosizedValue("Design Size Rated Evaporative Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

double AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::ratedCompressorPowerPerUnitofRatedEvaporativeCapacity() const {
Expand Down Expand Up @@ -560,7 +561,8 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::autosizedResistiveDefrostHeaterCapacity() {
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

double AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::maximumOutdoorDrybulbTemperatureforDefrostOperation() const {
Expand Down Expand Up @@ -1175,11 +1177,13 @@ namespace model {
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::autosizedGrossRatedTotalCoolingCapacity() const {
return getAutosizedValue("Design Size Rated Total Cooling Capacity (gross)", "W");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Rated Total Cooling Capacity (gross)", "W", "AirConditioner:VariableRefrigerantFlow");
}

boost::optional<double> AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::autosizedGrossRatedHeatingCapacity() const {
return getAutosizedValue("Design Size Rated Total Heating Capacity", "W");
// EPLUS-SQL-INCONSISTENCY
return getAutosizedValue("Design Size Rated Total Heating Capacity", "W", "AirConditioner:VariableRefrigerantFlow");
}

ComponentType AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR_Impl::componentType() const {
Expand Down
10 changes: 4 additions & 6 deletions src/model/test/AirflowNetworkExternalNode_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ TEST_F(ModelFixture, AirflowNetwork_ExternalNode) {
Model model;

AirflowNetworkExternalNode extnode0(model);
Curve curve0 = extnode0.windPressureCoefficientCurve();
auto* cpt = static_cast<CurveLinear*>(&curve0);
//CurveLinear *cpt = dynamic_cast<CurveLinear*>(&curve0);
//ASSERT_NE(nullptr, cpt);
EXPECT_EQ(1.0, cpt->coefficient1Constant());
EXPECT_EQ(0.0, cpt->coefficient2x());
auto cpt_ = extnode0.windPressureCoefficientCurve().optionalCast<CurveLinear>();
ASSERT_TRUE(cpt_);
EXPECT_EQ(1.0, cpt_->coefficient1Constant());
EXPECT_EQ(0.0, cpt_->coefficient2x());

EXPECT_TRUE(extnode0.isExternalNodeHeightDefaulted());
EXPECT_TRUE(extnode0.isSymmetricWindPressureCoefficientCurveDefaulted());
Expand Down
8 changes: 3 additions & 5 deletions src/utilities/floorspace/FSModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,11 @@ boost::optional<FSVertex> FSDaylightingControl::vertex() const {
return m_vertex;
}

const Point3d& FSDaylightingControl::point() const {
Point3d FSDaylightingControl::point() const {
if (m_vertex.has_value() && m_definition.has_value()) {
return *new Point3d(m_vertex->x(), m_vertex->y(), m_definition->height());
} else {

return *new Point3d(0, 0, 0);
return {m_vertex->x(), m_vertex->y(), m_definition->height()};
}
return {0.0, 0.0, 0.0};
}

boost::optional<FSDaylightingControlDefinition> FSDaylightingControl::definition() const {
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/floorspace/FSModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ class UTILITIES_API FSDaylightingControl : public FSBase
void Accept(FSVisitor& visitor) const override;

boost::optional<FSVertex> vertex() const;
const Point3d& point() const;
boost::optional<FSDaylightingControlDefinition> definition() const;
Point3d point() const;

private:
boost::optional<FSVertex> m_vertex;
Expand Down

0 comments on commit bb94815

Please sign in to comment.