text: //
  // nekRS User Defined File
  //
  #include <math.h>
  #include "udf.hpp"
  
  static int ciMode = 0;
  #include "lowMach_ci.h"
  #include "casedata.h"
  
  static occa::kernel userQKernel;
  static occa::kernel userVpKernel;
  
  void userq(ins_t *ins, dfloat time, occa::memory o_S, occa::memory o_FS)
  {
    cds_t *cds   = ins->cds;
    mesh_t *mesh = cds->mesh;
    userQKernel(mesh->Nelements, mesh->o_x, o_FS);
  }
  
  void uservp(ins_t *ins, dfloat time, occa::memory o_U, occa::memory o_S,
              occa::memory o_UProp, occa::memory o_SProp)
  {
    mesh_t *mesh = ins->mesh;
  
    userVpKernel(mesh->Nelements, ins->fieldOffset, ins->cds->fieldOffset, 
                 o_S, o_UProp, o_SProp);
  }
  
  /* UDF Functions */                                                      
  
  void UDF_LoadKernels(ins_t *ins)
  {
    occa::properties& kernelInfo = *ins->kernelInfo;
    kernelInfo["defines/p_DELTA"] = P_DELTA;
    userQKernel = udfBuildKernel(ins, "userQ");
    userVpKernel = udfBuildKernel(ins, "userVp");
  }
  
  void UDF_Setup0(MPI_Comm comm, setupAide &options)
  {
    options.getArgs("CI-MODE", ciMode);
    if (ciMode) ciSetup(comm, options);
  }
  
  void UDF_Setup(ins_t *ins)
  {
    // get IC from nek
    if (!ins->readRestartFile) nek_copyTo(ins, ins->startTime);
  
    udf.sEqnSource = &userq;
    udf.properties = &uservp;
    //udf.qtl        = &userqtl;
  }
  
  void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep)
  {
    if (ins->isOutputStep) nek_userchk();
    if (ciMode) ciTestErrors(ins, time, tstep);
  }
  