Skip to content

Commit

Permalink
precompile (#245)
Browse files Browse the repository at this point in the history
* precompile
  • Loading branch information
eahenle authored Jun 26, 2024
1 parent 7d9e812 commit 00b2ea4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 73 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
PrecompileSignatures = "91cefc8d-f054-46dc-8f8c-26e11d7c5411"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -34,6 +35,7 @@ JLD2 = "0.4.22"
OffsetArrays = "1"
Optim = "1"
Polynomials = "3"
PrecompileSignatures = "3.0"
ProgressMeter = "1"
Reexport = "1"
Roots = "2"
Expand Down
99 changes: 26 additions & 73 deletions src/PorousMaterials.jl
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
module PorousMaterials

using CSV,
DataFrames,
Distributed,
FIGlet,
Graphs,
JLD2,
LinearAlgebra,
OffsetArrays,
Optim,
Polynomials,
Printf,
ProgressMeter,
Roots,
SpecialFunctions,
Statistics,
StatsBase
using CSV, DataFrames, Distributed, FIGlet, Graphs, JLD2, LinearAlgebra, OffsetArrays, Optim,
Polynomials, Printf, ProgressMeter, Roots, SpecialFunctions, Statistics, StatsBase

# extend Xtals
using Reexport
@reexport using Xtals
import Xtals.Cart, Xtals.Frac, Xtals.write_xyz
using PrecompileSignatures: @precompile_signatures

# physical constants
const UNIV_GAS_CONST = 8.3144598e-5 # m³-bar/(K-mol)
Expand All @@ -46,93 +33,59 @@ function __init__()
rc[:paths][:molecules] = ""
rc[:paths][:grids] = ""
rc[:paths][:simulations] = ""
set_paths(joinpath(pwd(), "data"); no_warn=true)
return append_atomic_masses()
set_paths(joinpath(pwd(), "data"), no_warn=true)
append_atomic_masses()
end

function banner()
font_num = 579
FIGlet.render("Porous", FIGlet.availablefonts()[font_num])
return FIGlet.render("Materials", FIGlet.availablefonts()[font_num])
FIGlet.render("Materials", FIGlet.availablefonts()[font_num])
end


export
# isotherm_fitting.jl
fit_adsorption_isotherm,

# molecule.jl
Molecule,
translate_by!,
translate_to!,
random_rotation!,
random_rotation_matrix,
ion,
distortion,
Molecule, translate_by!, translate_to!, random_rotation!, random_rotation_matrix, ion, distortion,

# forcefield.jl
LJForceField,
replication_factors,
forcefield_coverage,
LJForceField, replication_factors, forcefield_coverage,

# energy_utilities.jl
PotentialEnergy,
SystemPotentialEnergy,
PotentialEnergy, SystemPotentialEnergy,

# vdw_energetics.jl
lennard_jones,
vdw_energy,
vdw_energy_no_PBC,
lennard_jones, vdw_energy, vdw_energy_no_PBC,

# electrostatics.jl
electrostatic_potential_energy,
precompute_kvec_wts,
setup_Ewald_sum,
total,
Eikr,
total_electrostatic_potential_energy,
electrostatic_potential_energy, precompute_kvec_wts,
setup_Ewald_sum, total, Eikr, total_electrostatic_potential_energy,

# mc_helpers.jl
random_insertion!,
remove_molecule!,
random_translation!,
random_reinsertion!,
needs_rotations,
random_insertion!, remove_molecule!, random_translation!, random_reinsertion!, needs_rotations,
AdaptiveTranslationStepSize,

# Grid.jl
apply_periodic_boundary_condition!,
Grid,
write_cube,
read_cube,
energy_grid,
compute_accessibility_grid,
accessible,
required_n_pts,
xf_to_id,
id_to_xf,
update_density!,
find_energy_minimum,
origin,

Grid, write_cube, read_cube, energy_grid, compute_accessibility_grid, accessible,
required_n_pts, xf_to_id, id_to_xf, update_density!, find_energy_minimum, origin,

# EOS.jl
calculate_properties,
PengRobinsonFluid,
VdWFluid,
calculate_properties, PengRobinsonFluid, VdWFluid,

# gcmc.jl
μVT_sim,
adsorption_isotherm,
stepwise_adsorption_isotherm,
μVT_output_filename,
GCMCstats,
MarkovCounts,
isotherm_sim_results_to_dataframe,

μVT_sim, adsorption_isotherm, stepwise_adsorption_isotherm,
μVT_output_filename, GCMCstats, MarkovCounts, isotherm_sim_results_to_dataframe,

# henry.jl
henry_coefficient,
henry_result_savename,
henry_coefficient, henry_result_savename,

# energy_min.jl
find_energy_minimum,
find_energy_minimum_gridsearch
find_energy_minimum, find_energy_minimum_gridsearch

@precompile_signatures(PorousMaterials)

end

0 comments on commit 00b2ea4

Please sign in to comment.