From ea490176700e26a299d2b7340882719f76c0f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 17:41:19 +0200 Subject: [PATCH 1/7] New sub-module --- src/ComputationalModels/BoundaryConditions.jl | 4 - src/ComputationalModels/FaceLabeling.jl | 14 -- src/DiscreteModeling/CartesianTags.jl | 156 ++++++++++++++++++ src/DiscreteModeling/DiscreteModeling.jl | 20 +++ .../EvolutionFunctions.jl | 0 src/DiscreteModeling/FaceLabeling.jl | 28 ++++ src/DiscreteModeling/MeshDescriptor.jl | 88 ++++++++++ src/Exports.jl | 7 +- src/HyperFEM.jl | 2 +- 9 files changed, 298 insertions(+), 21 deletions(-) delete mode 100644 src/ComputationalModels/FaceLabeling.jl create mode 100644 src/DiscreteModeling/CartesianTags.jl create mode 100644 src/DiscreteModeling/DiscreteModeling.jl rename src/{ComputationalModels => DiscreteModeling}/EvolutionFunctions.jl (100%) create mode 100644 src/DiscreteModeling/FaceLabeling.jl create mode 100644 src/DiscreteModeling/MeshDescriptor.jl diff --git a/src/ComputationalModels/BoundaryConditions.jl b/src/ComputationalModels/BoundaryConditions.jl index 78de4df..393099a 100644 --- a/src/ComputationalModels/BoundaryConditions.jl +++ b/src/ComputationalModels/BoundaryConditions.jl @@ -12,10 +12,6 @@ end getindex(bc::MultiFieldBC, i) = bc.BoundaryCondition[i] -include("EvolutionFunctions.jl") -include("CartesianTags.jl") -include("FaceLabeling.jl") - struct MultiFieldTC{A} <: TimedependentCondition vh::A # could be a multifield or single field diff --git a/src/ComputationalModels/FaceLabeling.jl b/src/ComputationalModels/FaceLabeling.jl deleted file mode 100644 index 399a8d3..0000000 --- a/src/ComputationalModels/FaceLabeling.jl +++ /dev/null @@ -1,14 +0,0 @@ - -""" -Create a new tag from a geometry and a coordinate-based filter function. -The filter function takes in vertex coordinates and returns a boolean values. A geometrical -entity is tagged if all its vertices pass the filter. - -# See also -- `Gridap.Geometry.face_labeling_from_vertex_filter` -- `Gridap.Geometry.merge!` -""" -function add_tag_from_vertex_filter!(labels::Gridap.Geometry.FaceLabeling, geometry::Gridap.Geometry.DiscreteModel, tag::String, filter::Function) - new_labels = Gridap.Geometry.face_labeling_from_vertex_filter(geometry.grid_topology, tag, filter) - merge!(labels, new_labels) -end diff --git a/src/DiscreteModeling/CartesianTags.jl b/src/DiscreteModeling/CartesianTags.jl new file mode 100644 index 0000000..dc119de --- /dev/null +++ b/src/DiscreteModeling/CartesianTags.jl @@ -0,0 +1,156 @@ + +"Shortcuts for the tags of cartesian discrete models." +module CartesianTags + +# --- Face tags --- + +"Tags indicating the face at plane X0." +const face0YZ = [25] + +"Tags indicating the face at plane X1." +const face1YZ = [26] + +"Tags indicating the face at plane Y0." +const faceX0Z = [23] + +"Tags indicating the face at plane Y1." +const faceX1Z = [24] + +"Tags indicating the face at plane Z0." +const faceXY0 = [21] + +"Tags indicating the face at plane Z1." +const faceXY1 = [22] + +# --- Edge tags --- + +"Tag indicating the edge at X, Y0, Z0." +const edgeX00 = [9] + +"Tag indicating the edge at X, Y1, Z0." +const edgeX10 = [10] + +"Tag indicating the edge at X, Y0, Z1." +const edgeX01 = [11] + +"Tag indicating the edge at X, Y1, Z1." +const edgeX11 = [12] + +"Tag indicating the edge at X0, Y, Z0." +const edge0Y0 = [13] + +"Tag indicating the edge at X1, Y, Z0." +const edge1Y0 = [14] + +"Tag indicating the edge at X0, Y, Z1." +const edge0Y1 = [15] + +"Tag indicating the edge at X1, Y, Z1." +const edge1Y1 = [16] + +"Tag indicating the edge at X0, Y0, Z." +const edge00Z = [17] + +"Tag indicating the edge at X1, Y0, Z." +const edge10Z = [18] + +"Tag indicating the edge at X0, Y1, Z." +const edge01Z = [19] + +"Tag indicating the edge at X1, Y1, Z." +const edge11Z = [20] + +# --- Corner tags --- + +"Tag indicating the point at corner X0, Y0, Z0." +const corner000 = [1] + +"Tag indicating the point at corner X1, Y0, Z0." +const corner100 = [2] + +"Tag indicating the point at corner X0, Y1, Z0." +const corner010 = [3] + +"Tag indicating the point at corner X1, Y1, Z0." +const corner110 = [4] + +"Tag indicating the point at corner X0, Y0, Z1." +const corner001 = [5] + +"Tag indicating the point at corner X1, Y0, Z1." +const corner101 = [6] + +"Tag indicating the point at corner X0, Y1, Z1." +const corner011 = [7] + +"Tag indicating the point at corner X1, Y1, Z1." +const corner111 = [8] + +# --- Edge & corner tags --- + +"Tags indicating points and edge at X, Y0, Z0." +const edgeX00⁺ = [edgeX00; corner000; corner100] + +"Tags indicating points and edge at X, Y1, Z0." +const edgeX10⁺ = [edgeX10; corner010; corner110] + +"Tags indicating points and edge at X, Y0, Z1." +const edgeX01⁺ = [edgeX01; corner001; corner101] + +"Tags indicating points and edge at X, Y1, Z1." +const edgeX11⁺ = [edgeX11; corner011; corner111] + +"Tags indicating points and edge at X0, Y, Z0." +const edge0Y0⁺ = [edge0Y0; corner000; corner010] + +"Tags indicating points and edge at X1, Y, Z0." +const edge1Y0⁺ = [edge1Y0; corner100; corner110] + +"Tags indicating points and edge at X0, Y, Z1." +const edge0Y1⁺ = [edge0Y1; corner001; corner011] + +"Tags indicating points and edge at X1, Y, Z1." +const edge1Y1⁺ = [edge1Y1; corner101; corner111] + +"Tags indicating points and edge at X0, Y0, Z." +const edge00Z⁺ = [edge00Z; corner000; corner001] + +"Tags indicating points and edge at X1, Y0, Z." +const edge10Z⁺ = [edge10Z; corner100; corner101] + +"Tags indicating points and edge at X0, Y1, Z." +const edge01Z⁺ = [edge01Z; corner010; corner011] + +"Tags indicating points and edge at X1, Y1, Z." +const edge11Z⁺ = [edge11Z; corner110; corner111] + +# --- Face & edge & corner tags --- + +"Tags indicating points, edges and faces at plane X0." +const face0YZ⁺ = [face0YZ; edge00Z⁺; edge01Z⁺; edge0Y0⁺; edge0Y1⁺] + +"Tags indicating points, edges and faces at plane X1." +const face1YZ⁺ = [face1YZ; edge10Z⁺; edge11Z⁺; edge1Y0⁺; edge1Y1⁺] + +"Tags indicating points, edges and faces at plane Y0." +const faceX0Z⁺ = [faceX0Z; edgeX00⁺; edgeX01⁺; edge00Z⁺; edge10Z⁺] + +"Tags indicating points, edges and faces at plane Y1." +const faceX1Z⁺ = [faceX1Z; edgeX10⁺; edgeX11⁺; edge01Z⁺; edge11Z⁺] + +"Tags indicating points, edges and faces at plane Z0." +const faceXY0⁺ = [faceXY0; edgeX00⁺; edgeX10⁺; edge0Y0⁺; edge1Y0⁺] + +"Tags indicating points, edges and faces at plane Z1." +const faceXY1⁺ = [faceXY1; edgeX01⁺; edgeX11⁺; edge0Y1⁺; edge1Y1⁺] + +# --- Deprecations --- + +Base.@deprecate_binding faceX0 face0YZ +Base.@deprecate_binding faceX1 face1YZ +Base.@deprecate_binding faceY0 faceX0Z +Base.@deprecate_binding faceY1 faceX1Z +Base.@deprecate_binding faceZ0 faceXY0 +Base.@deprecate_binding faceZ1 faceXY1 + +end diff --git a/src/DiscreteModeling/DiscreteModeling.jl b/src/DiscreteModeling/DiscreteModeling.jl new file mode 100644 index 0000000..c6fd435 --- /dev/null +++ b/src/DiscreteModeling/DiscreteModeling.jl @@ -0,0 +1,20 @@ + +""" +A bundle of helper tools to work with discrete models in space/time. +""" +module DiscreteModeling + +using Gridap + +export CartesianTags +export EvolutionFunctions +export add_tag_from_vertex_filter! +export aspect_ratio +export element_size + +include("CartesianTags.jl") +include("EvolutionFunctions.jl") +include("FaceLabeling.jl") +include("MeshDescriptor.jl") + +end diff --git a/src/ComputationalModels/EvolutionFunctions.jl b/src/DiscreteModeling/EvolutionFunctions.jl similarity index 100% rename from src/ComputationalModels/EvolutionFunctions.jl rename to src/DiscreteModeling/EvolutionFunctions.jl diff --git a/src/DiscreteModeling/FaceLabeling.jl b/src/DiscreteModeling/FaceLabeling.jl new file mode 100644 index 0000000..a321807 --- /dev/null +++ b/src/DiscreteModeling/FaceLabeling.jl @@ -0,0 +1,28 @@ + +""" +Create a new tag from a geometry and a coordinate-based filter function. +The filter function takes in vertex coordinates and returns a boolean values. A geometrical +entity is tagged if all its vertices pass the filter. + +# See also +- `Gridap.Geometry.face_labeling_from_vertex_filter` +- `Gridap.Geometry.merge!` +""" +function add_tag_from_vertex_filter!( + labels::Gridap.Geometry.FaceLabeling, + tag::String, + geometry::Gridap.Geometry.DiscreteModel, + filter::Function) + new_labels = Gridap.Geometry.face_labeling_from_vertex_filter(geometry.grid_topology, tag, filter) + merge!(labels, new_labels) +end + + +function add_tag_from_vertex_filter!( + labels::Gridap.Geometry.FaceLabeling, + geometry::Gridap.Geometry.DiscreteModel, + tag::String, + filter::Function) + @warn "This method is deprecated. Call the function with: (labels, tag, geometry, filter)" + add_tag_from_vertex_filter!(labels, tag, geometry, filter) +end diff --git a/src/DiscreteModeling/MeshDescriptor.jl b/src/DiscreteModeling/MeshDescriptor.jl new file mode 100644 index 0000000..d446ac6 --- /dev/null +++ b/src/DiscreteModeling/MeshDescriptor.jl @@ -0,0 +1,88 @@ + +""" +Return the aspect ratio of the underlying cartesian elements as a string. +This function is only available for an underlying `CartesianGrid`. + +# Example + aspect_ratio(Ω) # "51:51:5" + aspect_ratio(Ω, tol=0.05) # "10:10:1" + aspect_ratio(uh⁺, tol=0.1) # "10:10:1" +""" +function aspect_ratio(grid::CartesianGrid; tol=1e-6) + descriptor = Gridap.Geometry.get_cartesian_descriptor(grid) + sizes = descriptor.sizes + + rel = sizes ./ minimum(sizes) + best = nothing + best_error = Inf + best_complexity = Inf + + for d in 0:20 + candidate = round.(Int, rel .* d) + any(candidate .== 0) && continue + approx = candidate ./ d + err = maximum(abs.(approx .- rel) ./ rel) + if err < best_error + complexity = max(candidate...) + if complexity < best_complexity + best = candidate + best_error = err + best_complexity = complexity + end + end + end + + if best_error > tol # exact fallback + denominators = denominator.(rationalize.(sizes)) + least_mult = lcm(denominators...) + best = round.(Int, sizes .* least_mult) + end + + join(best, ":") +end + +function aspect_ratio(model::CartesianDiscreteModel; kwargs...) + aspect_ratio(get_grid(model); kwargs...) +end + +function aspect_ratio(triangulation::Triangulation; kwargs...) + aspect_ratio(get_background_model(triangulation); kwargs...) +end + +function aspect_ratio(f::CellField; kwargs...) + aspect_ratio(get_triangulation(f); kwargs...) +end + + +""" +Return the element size for a cartesian mesh. +This function is only available for an underlying `CartesianGrid`. + +# Example + element_size(model) # Compute the diagonal + element_size(uh, :x) # Get the x-size of the underlying grid +""" +function element_size(grid::CartesianGrid) + descriptor = Gridap.Geometry.get_cartesian_descriptor(grid) + sizes = descriptor.sizes + sqrt(sum(abs2, sizes)) +end + +function element_size(grid::CartesianGrid, direction) + descriptor = Gridap.Geometry.get_cartesian_descriptor(grid) + direction_indices = Dict(:x => 1, :y => 2, :z => 3) + index = direction_indices[direction] + descriptor.sizes[index] +end + +function element_size(model::CartesianDiscreteModel, args...) + element_size(get_grid(model), args...) +end + +function element_size(triangulation::Triangulation, args...) + element_size(get_background_model(triangulation), args...) +end + +function element_size(f::CellField, args...) + element_size(get_triangulation(f), args...) +end diff --git a/src/Exports.jl b/src/Exports.jl index 824bbc4..9e7d964 100644 --- a/src/Exports.jl +++ b/src/Exports.jl @@ -152,8 +152,11 @@ end @publish ComputationalModels TrialFESpace! # Exporting internal function of Gridap @publish ComputationalModels L2_Projection -# Note: the files FaceLabeling, CartesianTags and Evolution functions should be moved to a module different than ComputationalModels -@publish ComputationalModels add_tag_from_vertex_filter! +@publish DiscreteModeling CartesianTags +@publish DiscreteModeling EvolutionFunctions +@publish DiscreteModeling add_tag_from_vertex_filter! +@publish DiscreteModeling aspect_ratio +@publish DiscreteModeling element_size @publish Solvers IterativeSolver @publish Solvers Newton_RaphsonSolver diff --git a/src/HyperFEM.jl b/src/HyperFEM.jl index 6a8ff3e..5dedc1e 100644 --- a/src/HyperFEM.jl +++ b/src/HyperFEM.jl @@ -5,7 +5,7 @@ include("PhysicalModels/PhysicalModels.jl") include("WeakForms/WeakForms.jl") include("Solvers/Solvers.jl") include("ComputationalModels/ComputationalModels.jl") - +include("DiscreteModeling/DiscreteModeling.jl") include("Io.jl") include("Exports.jl") From 89d2bf48c68c47417aba9f4066e959e867b6ed48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 17:54:24 +0200 Subject: [PATCH 2/7] added exports --- src/DiscreteModeling/CartesianTags.jl | 18 ++++++++++++++++++ src/Exports.jl | 3 +++ 2 files changed, 21 insertions(+) diff --git a/src/DiscreteModeling/CartesianTags.jl b/src/DiscreteModeling/CartesianTags.jl index dc119de..74271de 100644 --- a/src/DiscreteModeling/CartesianTags.jl +++ b/src/DiscreteModeling/CartesianTags.jl @@ -2,6 +2,24 @@ "Shortcuts for the tags of cartesian discrete models." module CartesianTags +export face0YZ, face1YZ, faceX0Z, faceX1Z, faceXY0, faceXY1 + +export edgeX00, edgeX10, edgeX01, edgeX11 +export edge0Y0, edge1Y0, edge0Y1, edge1Y1 +export edge00Z, edge10Z, edge01Z, edge11Z + +export corner000, corner100, corner010, corner110 +export corner001, corner101, corner011, corner111 + +export edgeX00⁺, edgeX10⁺, edgeX01⁺, edgeX11⁺ +export edge0Y0⁺, edge1Y0⁺, edge0Y1⁺, edge1Y1⁺ +export edge00Z⁺, edge10Z⁺, edge01Z⁺, edge11Z⁺ + +export face0YZ⁺, face1YZ⁺, faceX0Z⁺, faceX1Z⁺, faceXY0⁺, faceXY1⁺ + +# Deprecated tags +export faceX0, faceX1, faceY0, faceY1, faceZ0, faceZ1 + # --- Face tags --- "Tags indicating the face at plane X0." diff --git a/src/Exports.jl b/src/Exports.jl index 9e7d964..89723a1 100644 --- a/src/Exports.jl +++ b/src/Exports.jl @@ -158,6 +158,9 @@ end @publish DiscreteModeling aspect_ratio @publish DiscreteModeling element_size +Base.@deprecate_binding ComputationalModels.CartesianTags DiscreteModeling.CartesianTags +Base.@deprecate_binding ComputationalModels.EvolutionFunctions DiscreteModeling.EvolutionFunctions + @publish Solvers IterativeSolver @publish Solvers Newton_RaphsonSolver @publish Solvers Injectivity_Preserving_LS From 83fbd62c68f3f0d6c397335b4180649ec7bd6ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 18:02:03 +0200 Subject: [PATCH 3/7] try different export --- src/ComputationalModels/ComputationalModels.jl | 3 +++ src/Exports.jl | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ComputationalModels/ComputationalModels.jl b/src/ComputationalModels/ComputationalModels.jl index dc73ac4..240aec3 100644 --- a/src/ComputationalModels/ComputationalModels.jl +++ b/src/ComputationalModels/ComputationalModels.jl @@ -24,6 +24,9 @@ using GridapGmsh: GmshDiscreteModel import Base.getindex +Base.@deprecate_binding CartesianTags DiscreteModeling.CartesianTags +Base.@deprecate_binding EvolutionFunctions DiscreteModeling.EvolutionFunctions + include("BoundaryConditions.jl") export DirichletBC export NeumannBC diff --git a/src/Exports.jl b/src/Exports.jl index 89723a1..9e7d964 100644 --- a/src/Exports.jl +++ b/src/Exports.jl @@ -158,9 +158,6 @@ end @publish DiscreteModeling aspect_ratio @publish DiscreteModeling element_size -Base.@deprecate_binding ComputationalModels.CartesianTags DiscreteModeling.CartesianTags -Base.@deprecate_binding ComputationalModels.EvolutionFunctions DiscreteModeling.EvolutionFunctions - @publish Solvers IterativeSolver @publish Solvers Newton_RaphsonSolver @publish Solvers Injectivity_Preserving_LS From 8a43faa525c985e0a784bf6d4d16ef0919f739b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 18:09:20 +0200 Subject: [PATCH 4/7] missing import --- src/ComputationalModels/ComputationalModels.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ComputationalModels/ComputationalModels.jl b/src/ComputationalModels/ComputationalModels.jl index 240aec3..59484e3 100644 --- a/src/ComputationalModels/ComputationalModels.jl +++ b/src/ComputationalModels/ComputationalModels.jl @@ -24,6 +24,8 @@ using GridapGmsh: GmshDiscreteModel import Base.getindex +# Deprecation exports +using HyperFEM.DiscreteModeling Base.@deprecate_binding CartesianTags DiscreteModeling.CartesianTags Base.@deprecate_binding EvolutionFunctions DiscreteModeling.EvolutionFunctions From 67550f901c82038214f787d25ba881cbd3a67913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 18:16:56 +0200 Subject: [PATCH 5/7] reorder includes --- src/HyperFEM.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HyperFEM.jl b/src/HyperFEM.jl index 5dedc1e..64e963d 100644 --- a/src/HyperFEM.jl +++ b/src/HyperFEM.jl @@ -4,8 +4,8 @@ include("TensorAlgebra/TensorAlgebra.jl") include("PhysicalModels/PhysicalModels.jl") include("WeakForms/WeakForms.jl") include("Solvers/Solvers.jl") -include("ComputationalModels/ComputationalModels.jl") include("DiscreteModeling/DiscreteModeling.jl") +include("ComputationalModels/ComputationalModels.jl") include("Io.jl") include("Exports.jl") From efd5e368c14afcd673316a96773572f049774357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 21 May 2026 16:16:57 +0200 Subject: [PATCH 6/7] update tags in tests --- test/data/StaggeredElectroMechanicalSimulation.jl | 4 ++-- test/data/StaggeredViscoElectricSimulation.jl | 4 ++-- test/data/StaticMechanicalDirichletSimulation.jl | 4 ++-- test/data/StaticMechanicalNeumannSimulation.jl | 4 ++-- test/data/ViscoElasticSimulation.jl | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/data/StaggeredElectroMechanicalSimulation.jl b/test/data/StaggeredElectroMechanicalSimulation.jl index 5058a05..e057fcc 100644 --- a/test/data/StaggeredElectroMechanicalSimulation.jl +++ b/test/data/StaggeredElectroMechanicalSimulation.jl @@ -17,8 +17,8 @@ function staggered_electro_mechanical_simulation(; is_vtk=true, verbose=true) partition = (8, 2, 2) geometry = CartesianDiscreteModel(domain, partition) labels = get_face_labeling(geometry) - add_tag_from_tags!(labels, "fixedu", CartesianTags.faceX0) - add_tag_from_tags!(labels, "topsuf", CartesianTags.faceZ1) + add_tag_from_tags!(labels, "fixedu", CartesianTags.face0YZ⁺) + add_tag_from_tags!(labels, "topsuf", CartesianTags.faceXY1⁺) add_tag_from_vertex_filter!(labels, geometry, "midsuf", x -> x[3] ≈ 0.001) # Constitutive model diff --git a/test/data/StaggeredViscoElectricSimulation.jl b/test/data/StaggeredViscoElectricSimulation.jl index fb3abbf..7cac8c2 100644 --- a/test/data/StaggeredViscoElectricSimulation.jl +++ b/test/data/StaggeredViscoElectricSimulation.jl @@ -22,8 +22,8 @@ function staggered_visco_electric_simulation(; t_end=2, writevtk=true, verbose=t partition = (8, 2, 2) geometry = CartesianDiscreteModel(domain, partition) labels = get_face_labeling(geometry) - add_tag_from_tags!(labels, "fixed", CartesianTags.faceX0) - add_tag_from_tags!(labels, "bottom", CartesianTags.faceZ0) + add_tag_from_tags!(labels, "fixed", CartesianTags.face0YZ⁺) + add_tag_from_tags!(labels, "bottom", CartesianTags.faceXY0⁺) add_tag_from_tags!(labels, "top", CartesianTags.faceZ1) add_tag_from_vertex_filter!(labels, geometry, "mid", x -> x[3] ≈ 0.5thick) diff --git a/test/data/StaticMechanicalDirichletSimulation.jl b/test/data/StaticMechanicalDirichletSimulation.jl index a034159..a8e548f 100644 --- a/test/data/StaticMechanicalDirichletSimulation.jl +++ b/test/data/StaticMechanicalDirichletSimulation.jl @@ -19,8 +19,8 @@ function static_mechanical_dirichlet_simulation(;writevtk=true, verbose=true) thick = 0.002 # m geometry = CartesianDiscreteModel((0, long, 0, width, 0, thick), (5,2,2)) labels = get_face_labeling(geometry) - add_tag_from_tags!(labels, "fixed", CartesianTags.faceX0) - add_tag_from_tags!(labels, "moving", CartesianTags.faceX1) + add_tag_from_tags!(labels, "fixed", CartesianTags.face0YZ⁺) + add_tag_from_tags!(labels, "moving", CartesianTags.face1YZ⁺) physmodel = MooneyRivlin3D(λ=3.0, μ1=1.0, μ2=0.0, ρ=1.0) diff --git a/test/data/StaticMechanicalNeumannSimulation.jl b/test/data/StaticMechanicalNeumannSimulation.jl index 5bd25e3..97e7073 100644 --- a/test/data/StaticMechanicalNeumannSimulation.jl +++ b/test/data/StaticMechanicalNeumannSimulation.jl @@ -19,8 +19,8 @@ function static_mechanical_neumann_simulation(;writevtk=true, verbose=true) thick = 0.002 # m geometry = CartesianDiscreteModel((0, long, 0, width, 0, thick), (5,2,2)) labels = get_face_labeling(geometry) - add_tag_from_tags!(labels, "fixed", CartesianTags.faceX0) - add_tag_from_tags!(labels, "force", CartesianTags.faceX1) + add_tag_from_tags!(labels, "fixed", CartesianTags.face0YZ⁺) + add_tag_from_tags!(labels, "force", CartesianTags.face1YZ⁺) physmodel = MooneyRivlin3D(λ=3.0, μ1=1.0, μ2=0.0, ρ=1.0) diff --git a/test/data/ViscoElasticSimulation.jl b/test/data/ViscoElasticSimulation.jl index 8c38bdf..14e67e3 100644 --- a/test/data/ViscoElasticSimulation.jl +++ b/test/data/ViscoElasticSimulation.jl @@ -18,8 +18,8 @@ function visco_elastic_simulation(;t_end=15, writevtk=true, verbose=true) labels = get_face_labeling(model) add_tag_from_tags!(labels, "corner1", CartesianTags.corner000) add_tag_from_tags!(labels, "corner2", CartesianTags.corner010) - add_tag_from_tags!(labels, "fixed", CartesianTags.faceX0) - add_tag_from_tags!(labels, "moving", CartesianTags.faceX1) + add_tag_from_tags!(labels, "fixed", CartesianTags.face0YZ⁺) + add_tag_from_tags!(labels, "moving", CartesianTags.face1YZ⁺) # Constitutive model μ = 1.37e4 # Pa From 323f948fa6684c03f209ed296634f8f1a3a9c2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Tue, 26 May 2026 16:40:15 +0200 Subject: [PATCH 7/7] merge conflicts --- src/ComputationalModels/CartesianTags.jl | 156 ----------------------- 1 file changed, 156 deletions(-) delete mode 100644 src/ComputationalModels/CartesianTags.jl diff --git a/src/ComputationalModels/CartesianTags.jl b/src/ComputationalModels/CartesianTags.jl deleted file mode 100644 index dc119de..0000000 --- a/src/ComputationalModels/CartesianTags.jl +++ /dev/null @@ -1,156 +0,0 @@ - -"Shortcuts for the tags of cartesian discrete models." -module CartesianTags - -# --- Face tags --- - -"Tags indicating the face at plane X0." -const face0YZ = [25] - -"Tags indicating the face at plane X1." -const face1YZ = [26] - -"Tags indicating the face at plane Y0." -const faceX0Z = [23] - -"Tags indicating the face at plane Y1." -const faceX1Z = [24] - -"Tags indicating the face at plane Z0." -const faceXY0 = [21] - -"Tags indicating the face at plane Z1." -const faceXY1 = [22] - -# --- Edge tags --- - -"Tag indicating the edge at X, Y0, Z0." -const edgeX00 = [9] - -"Tag indicating the edge at X, Y1, Z0." -const edgeX10 = [10] - -"Tag indicating the edge at X, Y0, Z1." -const edgeX01 = [11] - -"Tag indicating the edge at X, Y1, Z1." -const edgeX11 = [12] - -"Tag indicating the edge at X0, Y, Z0." -const edge0Y0 = [13] - -"Tag indicating the edge at X1, Y, Z0." -const edge1Y0 = [14] - -"Tag indicating the edge at X0, Y, Z1." -const edge0Y1 = [15] - -"Tag indicating the edge at X1, Y, Z1." -const edge1Y1 = [16] - -"Tag indicating the edge at X0, Y0, Z." -const edge00Z = [17] - -"Tag indicating the edge at X1, Y0, Z." -const edge10Z = [18] - -"Tag indicating the edge at X0, Y1, Z." -const edge01Z = [19] - -"Tag indicating the edge at X1, Y1, Z." -const edge11Z = [20] - -# --- Corner tags --- - -"Tag indicating the point at corner X0, Y0, Z0." -const corner000 = [1] - -"Tag indicating the point at corner X1, Y0, Z0." -const corner100 = [2] - -"Tag indicating the point at corner X0, Y1, Z0." -const corner010 = [3] - -"Tag indicating the point at corner X1, Y1, Z0." -const corner110 = [4] - -"Tag indicating the point at corner X0, Y0, Z1." -const corner001 = [5] - -"Tag indicating the point at corner X1, Y0, Z1." -const corner101 = [6] - -"Tag indicating the point at corner X0, Y1, Z1." -const corner011 = [7] - -"Tag indicating the point at corner X1, Y1, Z1." -const corner111 = [8] - -# --- Edge & corner tags --- - -"Tags indicating points and edge at X, Y0, Z0." -const edgeX00⁺ = [edgeX00; corner000; corner100] - -"Tags indicating points and edge at X, Y1, Z0." -const edgeX10⁺ = [edgeX10; corner010; corner110] - -"Tags indicating points and edge at X, Y0, Z1." -const edgeX01⁺ = [edgeX01; corner001; corner101] - -"Tags indicating points and edge at X, Y1, Z1." -const edgeX11⁺ = [edgeX11; corner011; corner111] - -"Tags indicating points and edge at X0, Y, Z0." -const edge0Y0⁺ = [edge0Y0; corner000; corner010] - -"Tags indicating points and edge at X1, Y, Z0." -const edge1Y0⁺ = [edge1Y0; corner100; corner110] - -"Tags indicating points and edge at X0, Y, Z1." -const edge0Y1⁺ = [edge0Y1; corner001; corner011] - -"Tags indicating points and edge at X1, Y, Z1." -const edge1Y1⁺ = [edge1Y1; corner101; corner111] - -"Tags indicating points and edge at X0, Y0, Z." -const edge00Z⁺ = [edge00Z; corner000; corner001] - -"Tags indicating points and edge at X1, Y0, Z." -const edge10Z⁺ = [edge10Z; corner100; corner101] - -"Tags indicating points and edge at X0, Y1, Z." -const edge01Z⁺ = [edge01Z; corner010; corner011] - -"Tags indicating points and edge at X1, Y1, Z." -const edge11Z⁺ = [edge11Z; corner110; corner111] - -# --- Face & edge & corner tags --- - -"Tags indicating points, edges and faces at plane X0." -const face0YZ⁺ = [face0YZ; edge00Z⁺; edge01Z⁺; edge0Y0⁺; edge0Y1⁺] - -"Tags indicating points, edges and faces at plane X1." -const face1YZ⁺ = [face1YZ; edge10Z⁺; edge11Z⁺; edge1Y0⁺; edge1Y1⁺] - -"Tags indicating points, edges and faces at plane Y0." -const faceX0Z⁺ = [faceX0Z; edgeX00⁺; edgeX01⁺; edge00Z⁺; edge10Z⁺] - -"Tags indicating points, edges and faces at plane Y1." -const faceX1Z⁺ = [faceX1Z; edgeX10⁺; edgeX11⁺; edge01Z⁺; edge11Z⁺] - -"Tags indicating points, edges and faces at plane Z0." -const faceXY0⁺ = [faceXY0; edgeX00⁺; edgeX10⁺; edge0Y0⁺; edge1Y0⁺] - -"Tags indicating points, edges and faces at plane Z1." -const faceXY1⁺ = [faceXY1; edgeX01⁺; edgeX11⁺; edge0Y1⁺; edge1Y1⁺] - -# --- Deprecations --- - -Base.@deprecate_binding faceX0 face0YZ -Base.@deprecate_binding faceX1 face1YZ -Base.@deprecate_binding faceY0 faceX0Z -Base.@deprecate_binding faceY1 faceX1Z -Base.@deprecate_binding faceZ0 faceXY0 -Base.@deprecate_binding faceZ1 faceXY1 - -end