| 884 | } |
| 885 | |
| 886 | boost::optional<SurfacePropertyLocalEnvironment> Surface_Impl::surfacePropertyLocalEnvironment() const { |
| 887 | |
| 888 | std::vector<SurfacePropertyLocalEnvironment> result; |
| 889 | for (auto& localEnv : model().getConcreteModelObjects<SurfacePropertyLocalEnvironment>()) { |
| 890 | if (auto surface_ = localEnv.exteriorSurfaceAsSurface()) { |
| 891 | if (surface_->handle() == handle()) { |
| 892 | result.push_back(localEnv); |
| 893 | } |
| 894 | } |
| 895 | } |
| 896 | if (result.empty()) { |
| 897 | return boost::none; |
| 898 | } else if (result.size() == 1) { |
| 899 | return result.at(0); |
| 900 | } else { |
| 901 | LOG(Error, "More than one SurfacePropertyLocalEnvironment points to this Surface"); |
| 902 | return boost::none; |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | boost::optional<SurfacePropertyOtherSideCoefficients> Surface_Impl::surfacePropertyOtherSideCoefficients() const { |
| 907 | return getObject<Surface>().getModelObjectTarget<SurfacePropertyOtherSideCoefficients>(OS_SurfaceFields::OutsideBoundaryConditionObject); |