MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / airflowNetworkSurface

Method airflowNetworkSurface

src/model/Surface.cpp:1991–2009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1989 }
1990
1991 boost::optional<AirflowNetworkSurface> Surface_Impl::airflowNetworkSurface() const {
1992 std::vector<AirflowNetworkSurface> myAFNSurfs =
1993 getObject<ModelObject>().getModelObjectSources<AirflowNetworkSurface>(AirflowNetworkSurface::iddObjectType());
1994 boost::optional<Surface> other = adjacentSurface();
1995 if (other) {
1996 std::vector<AirflowNetworkSurface> adjAFNSurfs =
1997 other.get().getImpl<detail::Surface_Impl>()->getObject<ModelObject>().getModelObjectSources<AirflowNetworkSurface>(
1998 AirflowNetworkSurface::iddObjectType());
1999 myAFNSurfs.insert(myAFNSurfs.end(), adjAFNSurfs.begin(), adjAFNSurfs.end());
2000 }
2001 auto count = myAFNSurfs.size();
2002 if (count == 1) {
2003 return myAFNSurfs[0];
2004 } else if (count > 1) {
2005 LOG(Warn, briefDescription() << " has more than one AirflowNetwork Surface attached, returning first.");
2006 return myAFNSurfs[0];
2007 }
2008 return boost::none;
2009 }
2010
2011 boost::optional<FoundationKiva> Surface_Impl::adjacentFoundation() const {
2012 return getObject<ModelObject>().getModelObjectTarget<FoundationKiva>(OS_SurfaceFields::OutsideBoundaryConditionObject);

Callers 2

TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 6

beginMethod · 0.80
iddObjectTypeFunction · 0.70
getMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36