@@ -12,6 +12,7 @@ import { basisFunctions } from "../mesh/basisFunctionsScript.js";
12
12
import { numericalIntegration } from "../methods/numericalIntegrationScript.js" ;
13
13
import { meshGeneration } from "../mesh/meshGenerationScript.js" ;
14
14
import { ThermalBoundaryConditions } from "../methods/thermalBoundaryConditionsScript.js" ;
15
+ import { basicLog , debugLog } from "../utilities/utilitiesScript.js" ;
15
16
16
17
/**
17
18
* Assemble the solid heat transfer matrix
@@ -23,7 +24,7 @@ import { ThermalBoundaryConditions } from "../methods/thermalBoundaryConditionsS
23
24
* - nodesCoordinates: Object containing x and y coordinates of nodes
24
25
*/
25
26
export function assembleSolidHeatTransferMat ( meshConfig , boundaryConditions ) {
26
- console . log ( "Starting solid heat transfer matrix assembly" ) ;
27
+ basicLog ( "Starting solid heat transfer matrix assembly" ) ;
27
28
28
29
// Extract mesh details from the configuration object
29
30
const {
@@ -35,11 +36,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
35
36
elementOrder, // The order of elements
36
37
} = meshConfig ;
37
38
38
- console . log (
39
- `Mesh configuration: ${ meshDimension } , Elements: ${ numElementsX } x${ numElementsY || 1 } , Size: ${ maxX } x${
40
- maxY || 0
41
- } , Order: ${ elementOrder } `
42
- ) ;
39
+ debugLog ( `Mesh configuration: ${ meshDimension } , Elements: ${ numElementsX } x${ numElementsY || 1 } , Size: ${ maxX } x${ maxY || 0 } , Order: ${ elementOrder } ` ) ;
43
40
44
41
// Extract boundary conditions from the configuration object
45
42
let convectionHeatTranfCoeff = [ ] ;
@@ -49,14 +46,11 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
49
46
if ( boundaryCondition [ 0 ] === "convection" ) {
50
47
convectionHeatTranfCoeff [ key ] = boundaryCondition [ 1 ] ;
51
48
convectionExtTemp [ key ] = boundaryCondition [ 2 ] ;
52
- console . log (
53
- `Convection boundary condition on boundary ${ key } : h=${ boundaryCondition [ 1 ] } , T=${ boundaryCondition [ 2 ] } `
54
- ) ;
55
49
}
56
50
} ) ;
57
51
58
52
// Create a new instance of the meshGeneration class
59
- console . log ( "Generating mesh..." ) ;
53
+ debugLog ( "Generating mesh..." ) ;
60
54
const meshGenerationData = new meshGeneration ( {
61
55
numElementsX,
62
56
numElementsY,
@@ -68,7 +62,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
68
62
69
63
// Generate the mesh
70
64
const nodesCoordinatesAndNumbering = meshGenerationData . generateMesh ( ) ;
71
- console . log ( "Mesh generated successfully" ) ;
72
65
73
66
// Extract nodes coordinates and nodal numbering (NOP) from the mesh data
74
67
let nodesXCoordinates = nodesCoordinatesAndNumbering . nodesXCoordinates ;
@@ -81,9 +74,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
81
74
// Initialize variables for matrix assembly
82
75
const totalElements = numElementsX * ( meshDimension === "2D" ? numElementsY : 1 ) ; // Total number of elements
83
76
const totalNodes = totalNodesX * ( meshDimension === "2D" ? totalNodesY : 1 ) ; // Total number of nodes
84
- console . log ( `Total elements: ${ totalElements } , Total nodes: ${ totalNodes } ` ) ;
85
-
86
- // Initialize variables for matrix assembly
87
77
let localNodalNumbers = [ ] ; // Local nodal numbering
88
78
let gaussPoints = [ ] ; // Gauss points
89
79
let gaussWeights = [ ] ; // Gauss weights
@@ -112,14 +102,12 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
112
102
}
113
103
114
104
// Initialize the basisFunctions class
115
- console . log ( "Initializing basis functions..." ) ;
116
105
const basisFunctionsData = new basisFunctions ( {
117
106
meshDimension,
118
107
elementOrder,
119
108
} ) ;
120
109
121
110
// Initialize the numericalIntegration class
122
- console . log ( "Setting up numerical integration..." ) ;
123
111
const numIntegrationData = new numericalIntegration ( {
124
112
meshDimension,
125
113
elementOrder,
@@ -133,8 +121,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
133
121
// Determine the number of nodes in the reference element based on the first element in the nop array
134
122
const numNodes = nop [ 0 ] . length ;
135
123
136
- console . log ( `Beginning matrix assembly for ${ totalElements } elements...` ) ;
137
-
138
124
// Matrix assembly
139
125
for ( let elementIndex = 0 ; elementIndex < totalElements ; elementIndex ++ ) {
140
126
for ( let localNodeIndex = 0 ; localNodeIndex < numNodes ; localNodeIndex ++ ) {
@@ -256,7 +242,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
256
242
}
257
243
258
244
// Create an instance of ThermalBoundaryConditions
259
- console . log ( "Applying thermal boundary conditions..." ) ;
245
+ debugLog ( "Applying thermal boundary conditions..." ) ;
260
246
const thermalBoundaryConditions = new ThermalBoundaryConditions (
261
247
boundaryConditions ,
262
248
boundaryElements ,
@@ -277,13 +263,13 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
277
263
convectionHeatTranfCoeff ,
278
264
convectionExtTemp
279
265
) ;
280
- console . log ( "Convection boundary conditions applied" ) ;
266
+ debugLog ( "Convection boundary conditions applied" ) ;
281
267
282
268
// Impose ConstantTemp boundary conditions
283
269
thermalBoundaryConditions . imposeConstantTempBoundaryConditions ( residualVector , jacobianMatrix ) ;
284
- console . log ( "Constant temperature boundary conditions applied" ) ;
270
+ debugLog ( "Constant temperature boundary conditions applied" ) ;
285
271
286
- console . log ( "Solid heat transfer matrix assembly completed" ) ;
272
+ basicLog ( "Solid heat transfer matrix assembly completed" ) ;
287
273
288
274
return {
289
275
jacobianMatrix,
0 commit comments