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: initialize.m
    path of file: ./repos/Isogeometric-Analysis/models/phase_field_new/1d_brittle_fracture_lmm_version4
    
    the code of the file until where you have to start completion: %--------------------------------------------------------------------------
%  Author: Isaac J. Lee (ijlee2@ices.utexas.edu)
%  
%  
%  Summary:
%  
%  This routine initializes the coefficients for the displacement and
%  phase field. The coefficients are set to be the values of the exact
%  solutions at the nodes.
%  
%  
%  Instructions:
%  
%  Type the following in a code,
%  
%      initialize(order, path_to_assembly_directory, path_to_results_directory)
%  
%  where,
%  
%      order is the order of the phase field theory (2, 4, 6, 8)
%      path_to_assembly_directory is the path to the assembly files directory
%      path_to_results_directory is the path to the results directory
%  
%  
%  Output:
%  
%  1. Coefficients for the displacement and phase fields (.mat files)
%--------------------------------------------------------------------------
function initialize(order, path_to_assembly_directory, path_to_results_directory)
    % Load the global assembly file
    load(sprintf('%sfile_assembly_global', path_to_assembly_directory), ...
         'numPatches', ...
         'numDOFs'   , ...
         ...
         'material_ell_0');
    
    % Load the patch assembly file
  
    
function initialize(order, path_to_assembly_directory, path_to_results_directory)
    % Load the global assembly file
    load(sprintf('%sfile_assembly_global', path_to_assembly_directory), ...
         'numPatches', ...
         'numDOFs'   , ...
         ...
         'material_ell_0');
    
    % Load the patch assembly file
    load(sprintf('%sfile_assembly_patch%d', path_to_assembly_directory, 1), ...
         'elementType' , ...
         'p1'          , ...
         'nodes'       , ...
         'numElements1', ...
         'IEN_array');
    
    % Load the BCs
    load(sprintf('%sfile_bc', path_to_assembly_directory), ...
         'LM_array1' , 'LM_array2' , ...
         'BCU_array1', 'BCU_array2', ...
         'u_L');
    
    
    
    %----------------------------------------------------------------------
    % ---------------------------------------------------------------------
    %   Begin: Loop over elements (e = e1)
    % ---------------------------------------------------------------------
    %----------------------------------------------------------------------
    % Some useful constant
    constant_p1p1 = p1 + 1;
    
    % Initialize the solution vectors
    u1 = zeros(numDOFs, 1);
    u2 = zeros(numDOFs, 1);
    
    % Index that was last used to set the entry of u
    lastIndex_for_u = 0;
    
    
    for e = 1 : numElements1
        %------------------------------------------------------------------
        %  Evaluate the exact solutions
        %------------------------------------------------------------------
        % Find the positions of the nodes
        if (e == 1)
            x = nodes(IEN_array(:, e), :);
        else
            x = setdiff(nodes(IEN_array(:, e), :), nodes_em1);
        end