function u0 = Init_Solution_mult(model, u_wall, u_fluid, u_air) mesh = model.Mesh; nodes = mesh.Nodes; elements = mesh.Elements; Nnodes = size(nodes,2); Nelems = size(elements,2); u0 = zeros(Nnodes,1); %initialize solution vector regions = zeros(Nelems,1); regions(findElements(mesh,'region','Face',1)) = 1; regions(findElements(mesh,'region','Face',2)) = 2; regions(findElements(mesh,'region','Face',3)) = 3; % Creates a boolean array to ensure each node is assigned a temperture only once nodeAssigned = false(Nnodes,1); for e = 1:Nelems vert = elements(:,e); %current element switch regions(e) %determines which temperature to assign case 1 u_val = u_wall; case 2 u_val = u_fluid; case 3 u_val = u_air; end %loops over the three nodes of the current element % if a node has not been assinged -> u_val andmarks assigned in the % boolean vector for k = 1:3 i = vert(k); if ~nodeAssigned(i) u0(i) = u_val; nodeAssigned(i) = true; end end end end