Skip to content
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ julia = "1.6"

[extras]
ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ADNLPModels", "NLPModels", "NLPModelsJuMP", "Test"]
test = ["ADNLPModels", "Distributed", "NLPModels", "NLPModelsJuMP", "Test"]
37 changes: 37 additions & 0 deletions data/clean_tetra_file.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Usage:
# julia clean_tetra_file.jl tetra_hook.jl tetra_hook_clean.jl

if length(ARGS) < 2
println("Usage: julia flatten_hook_file.jl input.jl output.jl")
exit(1)
end

input_file = ARGS[1]
output_file = ARGS[2]

# Load data in a temporary module
mod = Module(:Tmp)
Base.include(mod, input_file)

# Get the matrices
_TETS_hook = getfield(mod, :_TETS_hook)
_xe_hook = getfield(mod, :_xe_hook)

# Remove the first column
_TETS_hook = _TETS_hook[:, 2:end]
_xe_hook = _xe_hook[:, 2:end]

# Flatten directly into 1-D arrays
TETS_hook = vec(_TETS_hook)
xe_hook = vec(_xe_hook)

# Write new file
open(output_file, "w") do io
println(io, "# Flattened data extracted from $input_file")
println(io, "# First column removed; already flat vectors\n")

println(io, "const TETS_hook = ", repr(TETS_hook))
println(io, "const xe_hook = ", repr(xe_hook))
end

println("✅ Wrote flattened file to: $output_file")
38 changes: 38 additions & 0 deletions data/clean_triangle_file.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# flatten_turtle_file.jl
# Usage:
# julia flatten_turtle_file.jl triangle_turtle.jl triangle_turtle_flat.jl

if length(ARGS) < 2
println("Usage: julia flatten_turtle_file.jl input.jl output.jl")
exit(1)
end

input_file = ARGS[1]
output_file = ARGS[2]

# Load data in a temporary module
mod = Module(:Tmp)
Base.include(mod, input_file)

# Get the matrices
_TRIS_turtle = getfield(mod, :_TRIS_turtle)
_xe_turtle = getfield(mod, :_xe_turtle)

# Remove the first column
_TRIS_turtle = _TRIS_turtle[:, 2:end]
_xe_turtle = _xe_turtle[:, 2:end]

# Flatten directly into 1-D arrays
TRIS_turtle = vec(_TRIS_turtle)
xe_turtle = vec(_xe_turtle)

# Write new file
open(output_file, "w") do io
println(io, "# Flattened data extracted from $input_file")
println(io, "# First column removed; already flat vectors\n")

println(io, "const TRIS_turtle = ", repr(TRIS_turtle))
println(io, "const xe_turtle = ", repr(xe_turtle))
end

println("✅ Wrote flattened file to: $output_file")
112,918 changes: 89,490 additions & 23,428 deletions data/tetra_duct12.jl

Large diffs are not rendered by default.

53,568 changes: 42,422 additions & 11,146 deletions data/tetra_duct15.jl

Large diffs are not rendered by default.

24,800 changes: 19,622 additions & 5,178 deletions data/tetra_duct20.jl

Large diffs are not rendered by default.

29,595 changes: 23,404 additions & 6,191 deletions data/tetra_foam5.jl

Large diffs are not rendered by default.

19,056 changes: 15,067 additions & 3,989 deletions data/tetra_gear.jl

Large diffs are not rendered by default.

28,149 changes: 22,276 additions & 5,873 deletions data/tetra_hook.jl

Large diffs are not rendered by default.

Loading
Loading