Skip to content

Commit 789ced2

Browse files
committed
Update boundary conditions and logging in HeatConduction2DFinGmsh.html; adjust mesh density in rect.geo; add rect_quad2.msh file - Still in debugging phase
1 parent ae689a1 commit 789ced2

File tree

3 files changed

+505
-15
lines changed

3 files changed

+505
-15
lines changed

tutorials/HeatConduction2DFinGmsh.html

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,11 @@ <h2 id="results"><a name="results"></a>Results</h2>
149149
// Parse the mesh file first
150150
const result = await importGmshQuadTri(meshFile);
151151

152+
console.log("GMSH Boundary Conditions:", result.boundaryConditions);
152153
console.log("GMSH Boundary Elements:", result.boundaryElements);
153-
154-
// Fix nodal numbering format for the solver
155-
if (result.nodalNumbering.quadElements && result.nodalNumbering.quadElements.length > 0) {
156-
result.nodalNumbering = result.nodalNumbering.quadElements;
157-
} else if (
158-
result.nodalNumbering.triangleElements &&
159-
result.nodalNumbering.triangleElements.length > 0
160-
) {
161-
result.nodalNumbering = result.nodalNumbering.triangleElements;
162-
}
154+
console.log("GMSH Nodal Numbering:", result.nodalNumbering);
155+
console.log("x Coordinates:", result.nodesXCoordinates);
156+
console.log("y Coordinates:", result.nodesYCoordinates);
163157

164158
// Define mesh configuration with the parsed result
165159
gmshModel.setMeshConfig({
@@ -169,10 +163,10 @@ <h2 id="results"><a name="results"></a>Results</h2>
169163
});
170164

171165
// Define boundary conditions using Gmsh physical group tags
172-
gmshModel.addBoundaryCondition("1", ["constantTemp", 200]); // bottom boundary
173-
gmshModel.addBoundaryCondition("4", ["symmetry"]); // left boundary
174-
gmshModel.addBoundaryCondition("3", ["convection", 1, 20]); // top boundary
175-
gmshModel.addBoundaryCondition("2", ["constantTemp", 200]); // right boundary
166+
gmshModel.addBoundaryCondition("0", ["constantTemp", 200]); // bottom boundary
167+
gmshModel.addBoundaryCondition("1", ["constantTemp", 200]); // right boundary
168+
gmshModel.addBoundaryCondition("2", ["constantTemp", 100]); // top boundary
169+
gmshModel.addBoundaryCondition("3", ["symmetry"]); // left boundary
176170

177171
console.log("GMSH Boundary Conditions:", gmshModel.boundaryConditions);
178172

tutorials/rect.geo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// With Physical Lines for boundary labeling
33
// Use the command "gmsh rect.geo -2" to generate the mesh
44

5-
lc = 0.8; // Characteristic length (mesh density)
5+
lc = 0.3; // Characteristic length (mesh density)
66

77
// Points (x, y, z, mesh size)
88
Point(1) = {0, 0, 0, lc}; // Bottom left

0 commit comments

Comments
 (0)