Commit d6f6a2b1 authored by Lukas Aspöck's avatar Lukas Aspöck

implemented method to return surface area of walls in room model

parent fcccddc8
......@@ -2656,8 +2656,10 @@ classdef itaRavenProject < handle
function S = getMaterialSurfaceArea(obj, materialName)
%S = getRoomSurfaceArea(roomID)
%
% returns the total surface area of the current room.
% returns the surface area of the current material.
%
% WARNING: NOT IMPLEMENTED!
%
if nargin < 2
error('Please provide a material name.');
end
......@@ -2680,7 +2682,7 @@ classdef itaRavenProject < handle
end
end
% get all materials in room
% return surface area of given material
S = roommodel.getMaterialSurface(materialName);
end
......
......@@ -289,7 +289,27 @@ classdef load_ac3d
function S = getSurface(obj)
S = obj.totalSurface;
end
function SMat = getMaterialSurface(obj,materialName)
% sometimes multiple materials with the same name are defined. in this case, sum up all of them
matchingMatIDs = [];
SMat = 0;
for matID = 1:length(obj.bcGroups)
if (strcmp(obj.bcGroups{matID}.name, materialName))
matchingMatIDs = [matchingMatIDs matID];
SMat = SMat + obj.bcGroups{matID}.surface;
end
end
if isempty(matchingMatIDs)
error(['Material "' materialName '" is not part of the model. Please check materialname and or your *.ac file']);
end
end
function [A, S] = getEquivalentAbsorptionArea_sabine(obj, material_path, portal_surface_materials)
if nargin < 2
material_path = '..\RavenDatabase\MaterialDatabase';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment