Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Custom Blocks in Foundation Kiva #3567

Merged
merged 27 commits into from Sep 5, 2019
Merged

Use Custom Blocks in Foundation Kiva #3567

merged 27 commits into from Sep 5, 2019

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Jun 7, 2019

@joseph-robertson joseph-robertson self-assigned this Jun 7, 2019
@joseph-robertson joseph-robertson added the Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. label Jun 19, 2019
@joseph-robertson
Copy link
Collaborator Author

joseph-robertson commented Jun 20, 2019

I pulled the windows installer from ci and tested it against our residential workflow. It works:

  • CustomBlock can be created via addCustomBlock(...), addCustomBlocks(...), or CustomBlock.new(...)
  • customBlocks, numberofCustomBlocks, removeCustomBlock(index), removeAllCustomBlocks all work
  • correct warning when you try to add more than 10 custom blocks
  • writing CustomBlock object to output stream works correctly
  • depth, xPosition, zPosition getters for CustomBlocks working correctly
  • kiva-related warnings (material undefined but depth/width defined) are removed
  • exposed foundation perimeter warning (value set with wrong method) removed

@macumber @shorowit

@shorowit
Copy link
Contributor

@joseph-robertson Can you send me the installer? I'll test it on a branch of one of my repos that is going to use it.

@shorowit shorowit added this to the OpenStudio 2.9.0 milestone Jun 28, 2019
@macumber macumber added this to In progress in OpenStudio via automation Jul 1, 2019
@@ -6339,21 +6340,24 @@ OS:Foundation:Kiva,
\type real
\minimum> 0.0
\default 0.3
N10, \field Number of Custom Blocks
\minimum 0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be formatted as an integer (no decimal point), also can be autocalculated. See OS:Surface Number of Vertices

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was using OS:Generator:FuelSupply as a guide. It has \minimum=0.0 and \maximum=12.0. But yes I will take a look at OS:Surface Number of Vertices.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Decided to remove this field from the idd.

return numExtensibleGroups();
}

bool FoundationKiva_Impl::setNumberofCustomBlocks(unsigned int numberofCustomBlocks) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove this method

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

return result;
}

void FoundationKiva_Impl::resetNumberofCustomBlocks() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove this method

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

return addCustomBlock(customBlock);
}

bool FoundationKiva_Impl::removeCustomBlock(unsigned groupIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I have tended to not include this method, it is hard to use. I think its easier to just clear all the blocks and then set all of them with a vector. If you keep this method it should have a lot of tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Decided to keep this method and have a lot of tests.


//should fail since only 10 allowed
ASSERT_FALSE(kiva.addCustomBlock(material, 1, 1, 1));
kiva.removeCustomBlock(9);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you would need to check that removing block i correctly moves other blocks around, that you get the right blocks back from customBlocks, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added tests for this.

kiva.removeCustomBlock(0);
EXPECT_EQ(0, kiva.numberofCustomBlocks().get());

CustomBlock customBlock(material, 0.5, 1, -1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need more tests for customBlocks and setCustomBlocks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added addCustomBlocks(...) method and tests.

@macumber
Copy link
Contributor

Thanks for making these updates @joseph-robertson !

@macumber macumber merged commit b5e5465 into develop Sep 5, 2019
OpenStudio automation moved this from In progress to Done Sep 5, 2019
@joseph-robertson joseph-robertson deleted the kiva-enhancements branch March 16, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
No open projects
OpenStudio
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants