function[y]=multiplyB(Mesh, Data, x, in) % multiplyB: Implements the mutiplication between B and a vector x and % stores the result in y % INPUT: % Mesh: Structure containing all the mesh parameters % Data: Structure containing all the data parameters % x: Vector or matrix % in: Parameter specifiying whether the input is a vector or a matrix % OUTPUT: % y: Result of the multiplication of B with x if strcmp(in, 'vec') x=reshape(x, Mesh.nb_dof_local, []); end y=zeros(Data.nf,1); y1=-x*Data.body{1}.interface_mass; y2=(x*Data.R21')*Data.body{2}.interface_mass; y(Data.body{1}.indx_local)=y1(:); y(Data.body{2}.indx_local)=y2(:); end