You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Hdf5ElementForceBeam.m
    path of file: ./repos/NASTRAN_CoFE/nastran_cofe/hdf5_output_processors
    
    the code of the file until where you have to start completion: %Hdf5ElementForceBeam HDF5 data class for CBEAM element force data.

% <dataset name="BEAM">
% <field name="EID" type="integer" description="Element identification number"/>
% <field name="FORCE" type="BEAM_FORCE" size="11" description="Element force structure for BEA
    
function obj = constructFromElementOutputData(elementOutputData,domainIDs)
            % Function to convert element force output data to HDF5
            %
            % INPUTS
            % elementOutputData [nElements,1 ElementOutputData] element force output data
            % domainIDs [nVectors,1 unit32] HDF5 domain ID numbers
            %
            obj = Hdf5ElementForceBeam();
            nElements = size(elementOutputData,1);
            nVectors = size(elementOutputData(1).values,2);
            
            nineZeros=[0.,0.,0.,0.,0.,0.,0.,0.,0.];
            blockZeros = repmat(nineZeros,[nVectors,1]);
            eid = [];
            grid0 = [];
            sd = zeros(nElements*nVectors,11); sd(:,11)=1.0;
            bm1 = [];
            bm2 = [];
            ts1 = [];
            ts2 = [];
            ttrq = [];
            af = [];
            domain_id = [];
            for i = 1:nElements
                
                eid = [eid;...
                       repmat(elementOutputData(i).elementID,[nVectors,1])];
                
                grid0 = [grid0;...
                    uint32(elementOutputData(i).values(13,:)).',...
                    blockZeros,...
                    uint32(elementOutputData(i).values(14,:)).'];
                
                bm1   = [bm1;...
                    elementOutputData(i).values(6,:).',...
                    blockZeros,...
                    elementOutputData(i).values(12,:).'];
                
                bm2   = [bm2;...
                    elementOutputData(i).values(5,:).',...
                    blockZeros,...
                    elementOutputData(i).values(11,:).'];
                
                ts2   = [ts2;...
                    elementOutputData(i).values(3,:).',...
                    blockZeros,...
                    elementOutputData(i).values(9,:).'];
                
                ts1   = [ts1;...
                    elementOutputData(i).values(2,:).',...
                    blockZeros,...
                    elementOutputData(i).values(8,:).'];
                
                ttrq = [ttrq;...
                    elementOutputData(i).values(4,:).',...
                    blockZeros,...
                    elementOutputData(i).values(10,:).'];
                
                af    = [af;...
                    elementOutputData(i).values(1,:).',...
                    blockZeros,...
                    elementOutputData(i).values(7,:).'];
                
                domain_id = [domain_id,domainIDs];
                
            end