Skip to content

Commit 03feade

Browse files
committed
Tag the Gmsh example meshes bottom, left, top, right
Renumber the physical groups of rect_quad.msh and rhom_quad.msh so their boundary keys match the structured mesh (0 bottom, 1 left, 2 top, 3 right), and swap the left/right boundary conditions in the two Gmsh examples accordingly. The meshes themselves are unchanged. Correct the tests/meshes README, which said the example mesh was identical to rect_quad_quadratic.msh: the test meshes keep their bottom, right, top, left tags.
1 parent b29edd8 commit 03feade

5 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎examples/heatConductionScript/heatConduction2DFin/heatConduction2DFinGmsh.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ async function main() {
4747

4848
// Define boundary conditions
4949
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Bottom boundary
50-
model.addBoundaryCondition("1", ["constantTemperature", 200]); // Right boundary
50+
model.addBoundaryCondition("1", ["symmetry"]); // Left boundary
5151
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top boundary
52-
model.addBoundaryCondition("3", ["symmetry"]); // Left boundary
52+
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Right boundary
5353

5454
// Solve the problem
5555
const { solutionVector, nodesCoordinates } = model.solve();

‎examples/heatConductionScript/heatConduction2DFin/heatConduction2DRhomFinGmsh.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ async function main() {
4747

4848
// Define boundary conditions
4949
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Bottom boundary
50-
model.addBoundaryCondition("1", ["constantTemperature", 200]); // Right boundary
50+
model.addBoundaryCondition("1", ["symmetry"]); // Left boundary
5151
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top boundary
52-
model.addBoundaryCondition("3", ["symmetry"]); // Left boundary
52+
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Right boundary
5353

5454
// Solve the problem
5555
model.setSolverMethod("lusolve");

‎examples/heatConductionScript/heatConduction2DFin/rect_quad.msh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ $EndMeshFormat
44
$PhysicalNames
55
5
66
1 1 "bottom"
7-
1 2 "right"
7+
1 2 "left"
88
1 3 "top"
9-
1 4 "left"
9+
1 4 "right"
1010
2 5 "domain"
1111
$EndPhysicalNames
1212
$Entities
@@ -16,9 +16,9 @@ $Entities
1616
3 4 2 0 0
1717
4 0 2 0 0
1818
1 0 0 0 4 0 0 1 1 2 1 -2
19-
2 4 0 0 4 2 0 1 2 2 2 -3
19+
2 4 0 0 4 2 0 1 4 2 2 -3
2020
3 0 2 0 4 2 0 1 3 2 3 -4
21-
4 0 0 0 0 2 0 1 4 2 4 -1
21+
4 0 0 0 0 2 0 1 2 2 4 -1
2222
1 0 0 0 4 2 0 1 5 4 1 2 3 4
2323
$EndEntities
2424
$Nodes

‎examples/heatConductionScript/heatConduction2DFin/rhom_quad.msh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ $EndMeshFormat
44
$PhysicalNames
55
5
66
1 1 "bottom"
7-
1 2 "right"
7+
1 2 "left"
88
1 3 "top"
9-
1 4 "left"
9+
1 4 "right"
1010
2 5 "domain"
1111
$EndPhysicalNames
1212
$Entities
@@ -16,9 +16,9 @@ $Entities
1616
3 5 2 0 0
1717
4 1 2 0 0
1818
1 0 0 0 4 0 0 1 1 2 1 -2
19-
2 4 0 0 5 2 0 1 2 2 2 -3
19+
2 4 0 0 5 2 0 1 4 2 2 -3
2020
3 1 2 0 5 2 0 1 3 2 3 -4
21-
4 0 0 0 1 2 0 1 4 2 4 -1
21+
4 0 0 0 1 2 0 1 2 2 4 -1
2222
1 0 0 0 5 2 0 1 5 4 1 2 3 4
2323
$EndEntities
2424
$Nodes

‎tests/meshes/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ Then run (Gmsh 4.12.1 was used):
4848
gmsh rect.geo -save -format msh41 -o <mesh file>
4949
```
5050

51-
`rect_quad_quadratic.msh` is identical to `rect_quad.msh` used by the
52-
[`heatConduction2DFinGmsh.js`](../../examples/heatConductionScript/heatConduction2DFin/heatConduction2DFinGmsh.js) example.
51+
`rect_quad_quadratic.msh` has the same nodes and elements as `rect_quad.msh` used by the
52+
[`heatConduction2DFinGmsh.js`](../../examples/heatConductionScript/heatConduction2DFin/heatConduction2DFinGmsh.js) example,
53+
but its physical groups are tagged bottom, right, top, left; the example mesh tags them bottom, left, top, right,
54+
like the sides of FEAScript structured meshes.
5355

5456
## Used by
5557

0 commit comments

Comments
 (0)