List of all functions

These are all functions that are available in the package, which can roughly be divided into two groups (running & reading LaMEM)

Running LaMEM

LaMEM.Run.remove_popup_messages_mac — Method
remove_popup_messages_mac()

On a Mac with firewall enabled, running LaMEM will result in a popup window that says: "Accept incoming connections" which you should Allow or Deny. This is a bit annoying, so this julia script fixes that. Note that you must have administrator rights on your machine as we need to run "sudo"

Run this script from the terminal with

julia> remove_popup_messages_mac()

You need to do this once (every time a new version is installed)

LaMEM.Run.run_lamem — Function
run_lamem(ParamFile::String, cores::Int64=1, args:String=""; wait=true)

This starts a LaMEM simulation, for using the parameter file ParamFile on cores number of cores. Optional additional command-line parameters can be specified with args.

Example:

You can call LaMEM with:

julia> using LaMEM
julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
julia> run_lamem(ParamFile)

Do the same on 2 cores with a command-line argument as:

julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
julia> run_lamem(ParamFile, 2, "-nstep_max = 1")
LaMEM.Run.run_lamem_save_grid — Function
ProcessorPartFile = run_lamem_save_grid(ParamFile::String, cores::Int64=1; verbose=true)

This calls LaMEM simulation, for using the parameter file ParamFile and creates processor partitioning file "ProcessorPartitioningcorescpuX.Y.Z.bin" for cores number of cores.

Example:

julia> using LaMEM
julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
julia> ProcessorPartFile = run_lamem_save_grid(ParamFile, 2)
LaMEM.Run.show_paths_LaMEM — Method
show_paths_LaMEM()

The downloaded LaMEM binaries can also be called from outside julia (directly from the terminal). In that case, you will need to set load correct dynamic libraries (such as PETSc) and call the correct binaries.

This function shows this for your system.

Reading LaMEM output back into julia

LaMEM.IO_functions.ReadField_3D_pVTR — Method
output, isCell = ReadField_3D_pVTR(data, FieldName::String)

Extracts a 3D data field from a pVTR data structure data

Input:

  • data: Data structure obtained with ReadVTRFile
  • FieldName: Exact name of the field as specified in the *.vtr file

Output:

  • data_field, isCell: 3D field with data, and a flag that indicates whether it is Cell data (PointData otherwise) data_field is a tuple of size 1, or 3 depending on whether it is a scalar or vector field
LaMEM.IO_functions.ReadField_3D_pVTU — Method
output, isCell = ReadField_3D_pVTU(data, FieldName::String)

Extracts a 3D data field from a pVTU data structure data Input:

  • data: Data structure obtained with ReadVTRFile
  • FieldName: Exact name of the field as specified in the *.vtr file

Output:

  • data_field: Array with data, data_field is a tuple of size 1, 3 or 9 depending on whether it is a scalar, vector or tensor field
LaMEM.IO_functions.Read_LaMEM_PVTR_File — Method
data_output = Read_LaMEM_PVTR_File(DirName, FileName; fields=nothing)

Reads a 3D LaMEM timestep from VTR file FileName, located in directory DirName. By default, it will read all fields. If you want you can only read a specific field. See the function fieldnames to get a list with all available fields in the file.

It will return data_output which is a CartData output structure.

LaMEM.IO_functions.Read_LaMEM_PVTS_File — Method
data_output = Read_LaMEM_PVTS_File(DirName, FileName; field=nothing)

Reads a 3D LaMEM timestep from VTS file FileName, located in directory DirName. Typically this is done to read passive tracers back into julia. By default, it will read all fields. If you want you can only read a specific field. See the function fieldnames to get a list with all available fields in the file.

It will return data_output which is a CartData output structure.

LaMEM.IO_functions.Read_LaMEM_PVTU_File — Method
data_output = Read_LaMEM_PVTU_File(DirName, FileName; fields=nothing)

Reads a 3D LaMEM timestep from VTU file FileName, located in directory DirName. Typically this is done to read passive tracers back into julia. By default, it will read all fields. If you want you can only read a specific field. See the function fieldnames to get a list with all available fields in the file.

It will return data_output which is a CartData output structure.

LaMEM.IO_functions.Read_LaMEM_fieldnames — Function
Read_LaMEM_fieldnames(FileName::String, DirName_base::String=""; phase=false, surf=false, tracers=false)

Returns the names of the datasets stored in FileName

LaMEM.IO_functions.Read_LaMEM_simulation — Function
Timestep, FileNames, Time = Read_LaMEM_simulation(FileName::String, DirName::String=""; phase=false, surf=false, passive_tracers=false)

Reads a LaMEM simulation FileName in directory DirName and returns the timesteps, times and filenames of that simulation.

LaMEM.IO_functions.Read_LaMEM_timestep — Function
data, time = Read_LaMEM_timestep(FileName::String, TimeStep::Int64=0, DirName::String=""; fields=nothing, phase=false, surf=false, last=false)

This reads a LaMEM timestep.

Input Arguments:

  • FileName: name of the simulation, w/out extension
  • Timestep: timestep to be read, unless last=true in which case we read the last one
  • DirName: name of the main directory (i.e. where the *.pvd files are located)
  • fields: Tuple with optional fields; if not specified all will be loaded
  • phase: Loads the phase information of LaMEM if true
  • surf: Loads the free surface of LaMEM if true
  • passive_tracers: Loads passive tracers if true
  • last: Loads the last timestep

Output:

  • data: Cartesian data struct with LaMEM output
  • time: The time of the timestep
LaMEM.IO_functions.readPVD — Method
FileNames, Time, Timestep = readPVD(FileName::String)

This reads a PVD file & returns the FileNames, Time and Timesteps