function[y]=multiplyB_tilde(Mesh, Data, x, out) % multiplyB_tilde: Implements the mutiplication between B_tilde 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 % out: Parameter specifying whether the output should be a vector or % a matrix % OUTPUT: % y: Result of the multiplication of B_tilde with x % Retrive mesh parameters % Number of local degrees of freedom d=Mesh.nb_dof_local; w1=reshape(x(Data.body{1}.indx_local,:), d, []); w2=reshape(x(Data.body{2}.indx_local,:), d, []); w2=multiplyR12(Data, w2')'; y=w1-w2; if strcmp(out, 'vec') y=y(:); end end