Skip to content

Commit

Permalink
epJSON cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Jun 11, 2021
1 parent b7abee8 commit d718ebd
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 70 deletions.
28 changes: 14 additions & 14 deletions src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1562,19 +1562,19 @@ namespace HeatBalanceManager {
MaterNum = 0;

// Regular Materials
auto &IP(state.dataInputProcessing->inputProcessor);
auto &ip = state.dataInputProcessing->inputProcessor;

state.dataHeatBalMgr->CurrentModuleObject = "Material";
auto const instances = IP->epJSON.find(state.dataHeatBalMgr->CurrentModuleObject);
if (instances != IP->epJSON.end()) {
auto const &objectSchemaProps = IP->getObjectSchemaProps(state, state.dataHeatBalMgr->CurrentModuleObject);
auto const instances = ip->epJSON.find(state.dataHeatBalMgr->CurrentModuleObject);
if (instances != ip->epJSON.end()) {
auto const &objectSchemaProps = ip->getObjectSchemaProps(state, state.dataHeatBalMgr->CurrentModuleObject);

int counter = 0;
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &objectFields = instance.value();
auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
IP->markObjectAsUsed(state.dataHeatBalMgr->CurrentModuleObject, instance.key());
ip->markObjectAsUsed(state.dataHeatBalMgr->CurrentModuleObject, instance.key());
std::string materialName = thisObjectName;

if (GlobalNames::VerifyUniqueInterObjectName(state,
Expand All @@ -1587,25 +1587,25 @@ namespace HeatBalanceManager {
}
// For incoming idf, maintain object order
++counter;
MaterNum = IP->getIDFObjNum(state, state.dataHeatBalMgr->CurrentModuleObject, counter);
MaterNum = ip->getIDFObjNum(state, state.dataHeatBalMgr->CurrentModuleObject, counter);

// Load the material derived type from the input data.
auto &thisMaterial = state.dataMaterial->Material(MaterNum);
thisMaterial.Group = RegularMaterial;
thisMaterial.Name = materialName;

std::string roughness = IP->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness");
std::string roughness = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness");
ValidateMaterialRoughness(state, MaterNum, roughness, ErrorsFound);

thisMaterial.Thickness = IP->getRealFieldValue(objectFields, objectSchemaProps, "thickness");
thisMaterial.Conductivity = IP->getRealFieldValue(objectFields, objectSchemaProps, "conductivity");
thisMaterial.Density = IP->getRealFieldValue(objectFields, objectSchemaProps, "density");
thisMaterial.SpecHeat = IP->getRealFieldValue(objectFields, objectSchemaProps, "specific_heat");
thisMaterial.AbsorpThermal = IP->getRealFieldValue(objectFields, objectSchemaProps, "thermal_absorptance");
thisMaterial.Thickness = ip->getRealFieldValue(objectFields, objectSchemaProps, "thickness");
thisMaterial.Conductivity = ip->getRealFieldValue(objectFields, objectSchemaProps, "conductivity");
thisMaterial.Density = ip->getRealFieldValue(objectFields, objectSchemaProps, "density");
thisMaterial.SpecHeat = ip->getRealFieldValue(objectFields, objectSchemaProps, "specific_heat");
thisMaterial.AbsorpThermal = ip->getRealFieldValue(objectFields, objectSchemaProps, "thermal_absorptance");
thisMaterial.AbsorpThermalInput = thisMaterial.AbsorpThermal;
thisMaterial.AbsorpSolar = IP->getRealFieldValue(objectFields, objectSchemaProps, "solar_absorptance");
thisMaterial.AbsorpSolar = ip->getRealFieldValue(objectFields, objectSchemaProps, "solar_absorptance");
thisMaterial.AbsorpSolarInput = thisMaterial.AbsorpSolar;
thisMaterial.AbsorpVisible = IP->getRealFieldValue(objectFields, objectSchemaProps, "visible_absorptance");
thisMaterial.AbsorpVisible = ip->getRealFieldValue(objectFields, objectSchemaProps, "visible_absorptance");
thisMaterial.AbsorpVisibleInput = thisMaterial.AbsorpVisible;

if (thisMaterial.Conductivity > 0.0) {
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/SystemAvailabilityManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1351,23 +1351,23 @@ namespace SystemAvailabilityManager {

bool ErrorsFound = false;
std::string cCurrentModuleObject = "AvailabilityManagerAssignmentList";
auto &IP(state.dataInputProcessing->inputProcessor);
auto &ip = state.dataInputProcessing->inputProcessor;

state.dataSystemAvailabilityManager->NumAvailManagerLists = IP->getNumObjectsFound(state, cCurrentModuleObject);
state.dataSystemAvailabilityManager->NumAvailManagerLists = ip->getNumObjectsFound(state, cCurrentModuleObject);

if (state.dataSystemAvailabilityManager->NumAvailManagerLists > 0) {

state.dataSystemAvailabilityManager->SysAvailMgrListData.allocate(state.dataSystemAvailabilityManager->NumAvailManagerLists);
auto const instances = IP->epJSON.find(cCurrentModuleObject);
auto const &objectSchemaProps = IP->getObjectSchemaProps(state, cCurrentModuleObject);
auto const instances = ip->epJSON.find(cCurrentModuleObject);
auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject);

auto &instancesValue = instances.value();
int Item = 0;
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
++Item;
auto const &objectFields = instance.value();
auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
IP->markObjectAsUsed(cCurrentModuleObject, instance.key());
ip->markObjectAsUsed(cCurrentModuleObject, instance.key());
state.dataSystemAvailabilityManager->SysAvailMgrListData(Item).Name = thisObjectName;

auto extensibles = objectFields.find("managers");
Expand All @@ -1389,9 +1389,9 @@ namespace SystemAvailabilityManager {
for (auto extensibleInstance : extensiblesArray) {
++listItem;
state.dataSystemAvailabilityManager->SysAvailMgrListData(Item).AvailManagerName(listItem) =
IP->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_name");
ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_name");
std::string availManagerObjType =
IP->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_object_type");
ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_object_type");
state.dataSystemAvailabilityManager->SysAvailMgrListData(Item).cAvailManagerType(listItem) = availManagerObjType;
state.dataSystemAvailabilityManager->SysAvailMgrListData(Item).AvailManagerType(listItem) =
ValidateAndSetSysAvailabilityManagerType(state, availManagerObjType);
Expand Down

5 comments on commit d718ebd

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epJSONhelpers (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3129 of 3130 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 741
  • Failed: 1

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epJSONhelpers (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (3089 of 3090 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1143
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epJSONhelpers (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1644 of 1644 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epJSONhelpers (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2339 of 2339 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epJSONhelpers (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (726 of 726 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.