@@ -12,6 +12,7 @@ import { basisFunctions } from "../mesh/basisFunctionsScript.js";
1212import { numericalIntegration } from "../methods/numericalIntegrationScript.js" ;
1313import { meshGeneration } from "../mesh/meshGenerationScript.js" ;
1414import { ThermalBoundaryConditions } from "../methods/thermalBoundaryConditionsScript.js" ;
15+ import { basicLog , debugLog } from "../utilities/utilitiesScript.js" ;
1516
1617/**
1718 * Assemble the solid heat transfer matrix
@@ -23,7 +24,7 @@ import { ThermalBoundaryConditions } from "../methods/thermalBoundaryConditionsS
2324 * - nodesCoordinates: Object containing x and y coordinates of nodes
2425 */
2526export function assembleSolidHeatTransferMat ( meshConfig , boundaryConditions ) {
26- console . log ( "Starting solid heat transfer matrix assembly" ) ;
27+ basicLog ( "Starting solid heat transfer matrix assembly" ) ;
2728
2829 // Extract mesh details from the configuration object
2930 const {
@@ -35,11 +36,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
3536 elementOrder, // The order of elements
3637 } = meshConfig ;
3738
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 } ` ) ;
4340
4441 // Extract boundary conditions from the configuration object
4542 let convectionHeatTranfCoeff = [ ] ;
@@ -49,14 +46,11 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
4946 if ( boundaryCondition [ 0 ] === "convection" ) {
5047 convectionHeatTranfCoeff [ key ] = boundaryCondition [ 1 ] ;
5148 convectionExtTemp [ key ] = boundaryCondition [ 2 ] ;
52- console . log (
53- `Convection boundary condition on boundary ${ key } : h=${ boundaryCondition [ 1 ] } , T=${ boundaryCondition [ 2 ] } `
54- ) ;
5549 }
5650 } ) ;
5751
5852 // Create a new instance of the meshGeneration class
59- console . log ( "Generating mesh..." ) ;
53+ debugLog ( "Generating mesh..." ) ;
6054 const meshGenerationData = new meshGeneration ( {
6155 numElementsX,
6256 numElementsY,
@@ -68,7 +62,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
6862
6963 // Generate the mesh
7064 const nodesCoordinatesAndNumbering = meshGenerationData . generateMesh ( ) ;
71- console . log ( "Mesh generated successfully" ) ;
7265
7366 // Extract nodes coordinates and nodal numbering (NOP) from the mesh data
7467 let nodesXCoordinates = nodesCoordinatesAndNumbering . nodesXCoordinates ;
@@ -81,9 +74,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
8174 // Initialize variables for matrix assembly
8275 const totalElements = numElementsX * ( meshDimension === "2D" ? numElementsY : 1 ) ; // Total number of elements
8376 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
8777 let localNodalNumbers = [ ] ; // Local nodal numbering
8878 let gaussPoints = [ ] ; // Gauss points
8979 let gaussWeights = [ ] ; // Gauss weights
@@ -112,14 +102,12 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
112102 }
113103
114104 // Initialize the basisFunctions class
115- console . log ( "Initializing basis functions..." ) ;
116105 const basisFunctionsData = new basisFunctions ( {
117106 meshDimension,
118107 elementOrder,
119108 } ) ;
120109
121110 // Initialize the numericalIntegration class
122- console . log ( "Setting up numerical integration..." ) ;
123111 const numIntegrationData = new numericalIntegration ( {
124112 meshDimension,
125113 elementOrder,
@@ -133,8 +121,6 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
133121 // Determine the number of nodes in the reference element based on the first element in the nop array
134122 const numNodes = nop [ 0 ] . length ;
135123
136- console . log ( `Beginning matrix assembly for ${ totalElements } elements...` ) ;
137-
138124 // Matrix assembly
139125 for ( let elementIndex = 0 ; elementIndex < totalElements ; elementIndex ++ ) {
140126 for ( let localNodeIndex = 0 ; localNodeIndex < numNodes ; localNodeIndex ++ ) {
@@ -256,7 +242,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
256242 }
257243
258244 // Create an instance of ThermalBoundaryConditions
259- console . log ( "Applying thermal boundary conditions..." ) ;
245+ debugLog ( "Applying thermal boundary conditions..." ) ;
260246 const thermalBoundaryConditions = new ThermalBoundaryConditions (
261247 boundaryConditions ,
262248 boundaryElements ,
@@ -277,13 +263,13 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
277263 convectionHeatTranfCoeff ,
278264 convectionExtTemp
279265 ) ;
280- console . log ( "Convection boundary conditions applied" ) ;
266+ debugLog ( "Convection boundary conditions applied" ) ;
281267
282268 // Impose ConstantTemp boundary conditions
283269 thermalBoundaryConditions . imposeConstantTempBoundaryConditions ( residualVector , jacobianMatrix ) ;
284- console . log ( "Constant temperature boundary conditions applied" ) ;
270+ debugLog ( "Constant temperature boundary conditions applied" ) ;
285271
286- console . log ( "Solid heat transfer matrix assembly completed" ) ;
272+ basicLog ( "Solid heat transfer matrix assembly completed" ) ;
287273
288274 return {
289275 jacobianMatrix,
0 commit comments