| 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); |