Skip to content

Consistent cartesian tags#154

Open
miguelmaso wants to merge 2 commits into
mainfrom
cart-tags
Open

Consistent cartesian tags#154
miguelmaso wants to merge 2 commits into
mainfrom
cart-tags

Conversation

@miguelmaso
Copy link
Copy Markdown
Collaborator

Changelog

  • Face names are now consistent with edges and corners: faceX0 -> face0YZ ~ edgeX00 ~ corner000
  • Differentiated raw tags (only corners, edges or faces) and extended tags (face with corners and edges): face0YZ, face0YZ⁺
  • Old names (faceX0) have been marked as deprecated to avoid breaking existing code
- faceX0  # old tag
+ face0YZ  # new name, only contains the face tag
+ face0YZ⁺  # new name, it contains the face with the corresponding edges and corners
+ edgeX00⁺  # extended tag with the corresponding corners

Example

This example shows the usage of the new interface with a quarter domain with symmetry. The simple and extended tags avoid overlapping boundary conditions.

  domain = (0.0, 0.5width, 0.0, 0.5width, 0.0, thick)
  partition = (ndivisions, ndivisions, ndivisions÷10)
  geometry = CartesianDiscreteModel(domain, partition)
  labels = get_face_labeling(geometry)
  add_tag_from_tags!(labels, "top",    CartesianTags.faceXY1)
  add_tag_from_tags!(labels, "bottom", CartesianTags.faceXY0)
  add_tag_from_tags!(labels, "faces", [CartesianTags.face1YZ⁺; CartesianTags.faceX1Z⁺])
  add_tag_from_tags!(labels, "x_sym", [CartesianTags.face0YZ; CartesianTags.edge0Y0; CartesianTags.edge0Y1])
  add_tag_from_tags!(labels, "y_sym", [CartesianTags.faceX0Z; CartesianTags.edgeX00; CartesianTags.edgeX01])
  add_tag_from_tags!(labels, "center", CartesianTags.edge00Z⁺)

@miguelmaso miguelmaso requested a review from jmartfrut May 21, 2026 13:40
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Benchmark Results (Julia v1)

Time benchmarks
main 759f4e4... main / 759f4e4...
Constitutive models/Visco-elastic Ψ 0.0482 ± 0.029 ms 0.0485 ± 0.03 ms 0.993 ± 0.85
Constitutive models/Visco-elastic ∂Ψu 0.0543 ± 0.0022 ms 0.0553 ± 0.0025 ms 0.981 ± 0.06
Constitutive models/Visco-elastic ∂Ψuu 0.102 ± 0.018 ms 0.102 ± 0.019 ms 0.999 ± 0.25
Simulations/StaticMechanicalDirichlet 0.141 ± 0.01 s 0.136 ± 0.0074 s 1.04 ± 0.093
Simulations/StaticMechanicalNeumann 0.131 ± 0.013 s 0.132 ± 0.013 s 0.992 ± 0.14
Simulations/ViscoElastic 18.7 s 18.7 s 0.999
Tensor algebra/Cofactor 0.06 ± 0.01 μs 0.07 ± 0.01 μs 0.857 ± 0.19
Tensor algebra/Det(A)Inv(A') 0.14 ± 0.021 μs 0.121 ± 0.06 μs 1.16 ± 0.6
Tensor algebra/δδ_λ_2d 30 ± 0 ns 30 ± 0 ns 1 ± 0
Tensor algebra/δδ_μ_2d 30 ± 0 ns 30 ± 0 ns 1 ± 0
time_to_load 2.79 ± 0.088 s 2.76 ± 0.013 s 1.01 ± 0.032
Memory benchmarks
main 759f4e4... main / 759f4e4...
Constitutive models/Visco-elastic Ψ 1.24 k allocs: 0.0777 MB 1.24 k allocs: 0.0777 MB 1
Constitutive models/Visco-elastic ∂Ψu 1.29 k allocs: 0.0826 MB 1.29 k allocs: 0.0826 MB 1
Constitutive models/Visco-elastic ∂Ψuu 2.25 k allocs: 0.149 MB 2.25 k allocs: 0.149 MB 1
Simulations/StaticMechanicalDirichlet 1.51 M allocs: 0.108 GB 1.51 M allocs: 0.108 GB 1
Simulations/StaticMechanicalNeumann 1.48 M allocs: 0.093 GB 1.48 M allocs: 0.093 GB 1
Simulations/ViscoElastic 0.327 G allocs: 20.6 GB 0.327 G allocs: 20.6 GB 1
Tensor algebra/Cofactor 1 allocs: 0.0781 kB 1 allocs: 0.0781 kB 1
Tensor algebra/Det(A)Inv(A') 4 allocs: 0.25 kB 4 allocs: 0.25 kB 1
Tensor algebra/δδ_λ_2d 0 allocs: 0 B 0 allocs: 0 B
Tensor algebra/δδ_μ_2d 0 allocs: 0 B 0 allocs: 0 B
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant