} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem, printVersion } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const VERSION = \"0.1.2\";","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n \n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n \n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map(val => val[0]);\n } else {\n zValues = solutionVector;\n }\n \n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n \n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: 'closest'\n };\n \n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: 'Solution Field'\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: 'contour',\n contours: {\n coloring: 'heatmap',\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n name: 'Solution Field'\n };\n \n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","fill","floor","random","Number","MAX_SAFE_INTEGER","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","assembleFrontPropagationMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","worker","feaWorker","isReady","_initWorker","Worker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":"iPAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,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I,EAAGtN,EACHqS,EAAGpS,EACHyV,EAAGd,EACH1O,KAAM,UACNyP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETvU,KAAM,kBAIR8U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,iBZzGOnE,iBACLhU,EAAS,oDACT,IACE,MAAM4Z,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAra,EAAS,4BAA4Bga,KAC9BA,CACR,CAAC,MAAOvO,GAEP,OADAxL,EAAS,wCAA0CwL,GAC5C,iCACR,CACH"}
\ No newline at end of file
diff --git a/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.html b/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.html
deleted file mode 100644
index 809c288..0000000
--- a/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.html
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FEAScript: Heat Conduction Through a Wall Example
-
-
-
-
-
-
-
-
-
-
-
- Heat Conduction Through a Wall Example
-
-
-
- This example demonstrates heat conduction through a wall using a one-dimensional model. The mesh
- configuration and boundary conditions are defined directly within the JavaScript code. Please refresh
- the page to update the results. Detailed instructions for this example can be found in the corresponding
- FEAScript tutorial. If you need further assistance, you can visit the
- FEAScript website.
-
-
- © 2023- FEAScript
-
-
-
-
-
diff --git a/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.js b/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.js
new file mode 100644
index 0000000..f637453
--- /dev/null
+++ b/examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.js
@@ -0,0 +1,47 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Import Math.js
+import * as math from "mathjs";
+global.math = math;
+
+// Import FEAScript library
+import { FEAScriptModel, logSystem, VERSION } from "feascript";
+
+console.log('FEAScript Version:', VERSION);
+
+// Create a new FEAScript model
+const model = new FEAScriptModel();
+
+// Set solver configuration
+model.setSolverConfig("solidHeatTransferScript");
+
+// Define mesh configuration
+model.setMeshConfig({
+ meshDimension: "1D",
+ elementOrder: "linear",
+ numElementsX: 10,
+ maxX: 0.15,
+});
+
+// Define boundary conditions
+model.addBoundaryCondition("0", ["convection", 1, 25]);
+model.addBoundaryCondition("1", ["constantTemp", 5]);
+
+// Set solver method (optional)
+model.setSolverMethod("lusolve");
+
+// Solve the problem and get the solution
+const { solutionVector, nodesCoordinates } = model.solve();
+
+// Print results to console
+console.log("Solution vector:", solutionVector);
+console.log("Node coordinates:", nodesCoordinates);
+console.log(`Number of nodes: ${nodesCoordinates.nodesXCoordinates.length}`);
diff --git a/examples/solidHeatTransferScript/HeatConduction1DWall/README.md b/examples/solidHeatTransferScript/HeatConduction1DWall/README.md
index 281ef56..e8b4887 100644
--- a/examples/solidHeatTransferScript/HeatConduction1DWall/README.md
+++ b/examples/solidHeatTransferScript/HeatConduction1DWall/README.md
@@ -4,12 +4,25 @@
This example demonstrates solving a steady-state heat transfer problem in a 1D domain using the FEAScript library. The problem represents heat flow through a building wall, where heat conduction is modeled to determine temperature profiles under specific boundary conditions.
-All examples are intentionally kept simple and modular to facilitate easy integration with web applications. The clean, minimal structure makes it straightforward to incorporate these simulations into existing websites or web-based tools.
+### Instructions
-### Available Versions
+The example requires the `feascript` npm package and its peer dependencies (`mathjs`). It imports FEAScript directly from the npm package and runs the simulation in a Node.js environment, making it suitable for server-side applications or local development without a browser (no WEB APIs here). To run the example you should follow these instructions:
-1. **Standard Version** (`HeatConduction1DWall.html`)
+1. **Create package.json with ES module support:**
-### Instructions
+ ```bash
+ echo '{"type":"module"}' > package.json
+ ```
+
+2. **Install FEAScript and dependencies:**
+
+ ```bash
+ npm install feascript mathjs
+ ```
+
+3. **Run the example:**
+ ```bash
+ node HeatConduction1DWall.js
+ ```
-The mesh configuration and boundary conditions are defined directly in the JavaScript section of the HTML file. For a step-by-step guide and additional details, refer to the corresponding [tutorial](https://feascript.com/tutorials/HeatConduction1DWall.html).
+**Note:** For an HTML version of this example, and additional details, refer to the corresponding [tutorial](https://feascript.com/tutorials/HeatConduction1DWall.html).
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.html b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.html
deleted file mode 100644
index a3a54ba..0000000
--- a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FEAScript: Heat Conduction in a Two-Dimensional Fin Example
-
-
-
-
-
-
-
-
-
-
-
- Heat Conduction in a Two-Dimensional Fin Example
-
-
-
- The mesh configuration and boundary conditions are defined directly within the JavaScript code in this
- example. Please refresh the page to update the results. Detailed instructions for this example can be
- found in the corresponding
- FEAScript tutorial. If you need further assistance, you can visit the
- FEAScript website.
-
-
- © 2023- FEAScript
-
-
-
-
-
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.js b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.js
new file mode 100644
index 0000000..76de95f
--- /dev/null
+++ b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.js
@@ -0,0 +1,51 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Import Math.js
+import * as math from "mathjs";
+global.math = math;
+
+// Import FEAScript library
+import { FEAScriptModel, logSystem, VERSION } from "feascript";
+
+console.log('FEAScript Version:', VERSION);
+
+// Create a new FEAScript model
+const model = new FEAScriptModel();
+
+// Set solver configuration
+model.setSolverConfig("solidHeatTransferScript");
+
+// Define mesh configuration
+model.setMeshConfig({
+ meshDimension: "2D",
+ elementOrder: "quadratic",
+ numElementsX: 8,
+ numElementsY: 4,
+ maxX: 4,
+ maxY: 2,
+});
+
+// Define boundary conditions
+model.addBoundaryCondition("0", ["constantTemp", 200]);
+model.addBoundaryCondition("1", ["symmetry"]);
+model.addBoundaryCondition("2", ["convection", 1, 20]);
+model.addBoundaryCondition("3", ["constantTemp", 200]);
+
+// Set solver method (optional)
+model.setSolverMethod("lusolve");
+
+// Solve the problem and get the solution
+const { solutionVector, nodesCoordinates } = model.solve();
+
+// Print results to console
+console.log("Solution vector:", solutionVector);
+console.log("Node coordinates:", nodesCoordinates);
+console.log(`Number of nodes in mesh: ${nodesCoordinates.nodesXCoordinates.length}`);
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.html b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.html
deleted file mode 100644
index ce65ddd..0000000
--- a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.html
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FEAScript: Heat Conduction in a Two-Dimensional Fin (Gmsh Example)
-
-
-
-
-
-
-
-
-
-
-
- Heat Conduction in a Two-Dimensional Fin Example (Gmsh)
-
-
-
- This example demonstrates solving a steady-state heat transfer problem in a 2D rectangular domain using
- a Gmsh-generated mesh (rect_quad_unstruct.msh). The mesh
- configuration and boundary conditions are defined directly within the JavaScript code. Please refresh
- the page to update the results. Detailed instructions for this example can be found in the corresponding
- FEAScript tutorial. If you need further assistance, you can visit the
- FEAScript website.
-
-
- © 2023- FEAScript
-
-
-
-
-
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.js b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.js
new file mode 100644
index 0000000..b992c02
--- /dev/null
+++ b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.js
@@ -0,0 +1,71 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Import required Node.js modules
+import fs from 'fs';
+import path from 'path';
+import { fileURLToPath } from 'url';
+
+// Import Math.js
+import * as math from "mathjs";
+global.math = math;
+
+// Import FEAScript library
+import { FEAScriptModel, importGmshQuadTri, logSystem, VERSION } from "feascript";
+
+console.log('FEAScript Version:', VERSION);
+
+// Get directory name for the current file
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+// Read the mesh file
+const meshFilePath = path.join(__dirname, 'rect_quad_unstruct.msh');
+const meshContent = fs.readFileSync(meshFilePath, 'utf8');
+
+async function main() {
+ // Create a new FEAScript model
+ const model = new FEAScriptModel();
+
+ // Set solver configuration
+ model.setSolverConfig("solidHeatTransferScript");
+
+ // Create a mock File object for Node.js environment
+ const mockFile = {
+ text: async () => meshContent,
+ name: 'rect_quad_unstruct.msh'
+ };
+
+ // Parse the mesh data
+ const result = await importGmshQuadTri(mockFile);
+
+ // Define mesh configuration with the parsed result
+ model.setMeshConfig({
+ parsedMesh: result,
+ meshDimension: "2D",
+ elementOrder: "quadratic",
+ });
+
+ // Define boundary conditions
+ model.addBoundaryCondition("0", ["constantTemp", 200]); // bottom boundary
+ model.addBoundaryCondition("1", ["constantTemp", 200]); // right boundary
+ model.addBoundaryCondition("2", ["convection", 1, 20]); // top boundary
+ model.addBoundaryCondition("3", ["symmetry"]); // left boundary
+
+ // Solve the problem and get the solution
+ const { solutionVector, nodesCoordinates } = model.solve();
+
+ // Print results to console
+ console.log("Solution vector:", solutionVector);
+ console.log("Node coordinates:", nodesCoordinates);
+ console.log(`Number of nodes in mesh: ${nodesCoordinates.nodesXCoordinates.length}`);
+}
+
+// Run the main function
+main();
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinWorker.html b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinWorker.html
deleted file mode 100644
index fd04524..0000000
--- a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinWorker.html
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FEAScript: Heat Conduction in a Two-Dimensional Fin Example (Web Worker)
-
-
-
-
-
-
-
-
-
-
-
- Heat Conduction in a Two-Dimensional Fin Example (Worker)
-
-
-
-
- This is a worker-based implementation of the heat conduction in a two-dimensional fin example using a
- larger mesh (18x9). This implementation enables better performance for larger simulations. The mesh
- configuration and boundary conditions are defined directly within the JavaScript code. Please refresh
- the page to update the results. Detailed instructions for this example can be found in the corresponding
- FEAScript tutorial. If you need further assistance, you can visit the
- FEAScript website.
-
-
- © 2023- FEAScript
-
-
-
-
-
diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/README.md b/examples/solidHeatTransferScript/HeatConduction2DFin/README.md
index 2394103..d88cb13 100644
--- a/examples/solidHeatTransferScript/HeatConduction2DFin/README.md
+++ b/examples/solidHeatTransferScript/HeatConduction2DFin/README.md
@@ -4,16 +4,39 @@
This example demonstrates solving a steady-state heat transfer problem in a 2D rectangular domain using the FEAScript library. The problem represents a typical cooling fin scenario, where the objective is to model heat conduction and understand temperature distribution under specific boundary conditions.
-All examples are intentionally kept simple and modular to facilitate easy integration with web applications. The clean, minimal structure makes it straightforward to incorporate these simulations into existing websites or web-based tools.
-
### Available Versions
-This example is available in three implementations:
+This example is available in two Node.js implementations:
-1. **Standard Version** (`HeatConduction2DFin.html`) - Basic implementation using the FEAScriptModel class
-2. **Web Worker Version** (`HeatConduction2DFinWorker.html`) - Implementation using Web Workers for better performance with larger models
-3. **Gmsh Version** (`HeatConduction2DFinGmsh.html`) - Implementation using an unstructured mesh generated by [Gmsh](https://gmsh.info/) (the mesh file, `rect_quad_unstruct.msh`, is also located in the current directory)
+1. **Standard Version** (`HeatConduction2DFin.js`) - Basic implementation using the FEAScriptModel class
+2. **Gmsh Version** (`HeatConduction2DFinGmsh.js`) - Implementation using an unstructured mesh generated by [Gmsh](https://gmsh.info/) (the mesh file, `rect_quad_unstruct.msh`, is also located in the current directory)
### Instructions
-The mesh configuration and boundary conditions are defined directly in the JavaScript section of the HTML files. For a step-by-step guide and additional details, refer to the corresponding [tutorial](https://feascript.com/tutorials/HeatConduction2DFin.html).
+The examples require the `feascript` npm package and its peer dependencies (`mathjs`). They import FEAScript directly from the npm package and run the simulations in a Node.js environment, making them suitable for server-side applications or local development without a browser (no WEB APIs here). To run the examples, follow these instructions:
+
+1. **Create package.json with ES module support:**
+
+ ```bash
+ echo '{"type":"module"}' > package.json
+ ```
+
+2. **Install dependencies:**
+
+ ```bash
+ npm install feascript mathjs
+ ```
+
+3. **Run the desired version:**
+
+ ```bash
+ node HeatConduction2DFin.js
+ ```
+
+ or
+
+ ```bash
+ node HeatConduction2DFinGmsh.js
+ ```
+
+**Note:** For detailed information on the model setup, boundary conditions, and simulation results, refer to the comments in the JavaScript files and the corresponding standard [tutorial](https://feascript.com/tutorials/HeatConduction2DFin.html) as well as to the Gmsh mesh [tutorial](https://feascript.com/tutorials/HeatConduction2DFinGmsh.html).
diff --git a/feascript-0.1.1.tgz b/feascript-0.1.1.tgz
deleted file mode 100644
index aa2d260..0000000
Binary files a/feascript-0.1.1.tgz and /dev/null differ
diff --git a/package-lock.json b/package-lock.json
index 21f115f..9742dac 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,26 +1,23 @@
{
"name": "feascript",
- "version": "0.1.1",
+ "version": "0.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "feascript",
- "version": "0.1.1",
+ "version": "0.1.2",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.3",
"@rollup/plugin-node-resolve": "^16.0.1",
- "@types/estree": "^1.0.7",
"mathjs": "^11.12.0",
"rollup": "^2.79.2",
- "rollup-plugin-terser": "^7.0.2",
- "rollup-plugin-typescript2": "^0.36.0",
- "typescript": "^5.8.3"
+ "rollup-plugin-terser": "^7.0.2"
},
"peerDependencies": {
"mathjs": "^11.12.0",
- "plotly.js": "^2.27.0"
+ "plotly.js": "^2.35.3"
}
},
"node_modules/@babel/code-frame": {
@@ -1875,38 +1872,6 @@
}
}
},
- "node_modules/find-cache-dir": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
- "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "commondir": "^1.0.1",
- "make-dir": "^3.0.2",
- "pkg-dir": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
- }
- },
- "node_modules/find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/flatten-vertex-data": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz",
@@ -1962,21 +1927,6 @@
"readable-stream": "^2.0.0"
}
},
- "node_modules/fs-extra": {
- "version": "10.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
- "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "graceful-fs": "^4.2.0",
- "jsonfile": "^6.0.1",
- "universalify": "^2.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@@ -2332,7 +2282,8 @@
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
- "license": "ISC"
+ "license": "ISC",
+ "peer": true
},
"node_modules/grid-index": {
"version": "1.1.0",
@@ -2633,19 +2584,6 @@
"license": "MIT",
"peer": true
},
- "node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/kdbush": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
@@ -2673,19 +2611,6 @@
"node": ">=6.11.5"
}
},
- "node_modules/locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "p-locate": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@@ -2703,32 +2628,6 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
- "node_modules/make-dir": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
- "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "semver": "^6.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/make-dir/node_modules/semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- }
- },
"node_modules/map-limit": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz",
@@ -3123,45 +3022,6 @@
"wrappy": "1"
}
},
- "node_modules/p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "p-try": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "p-limit": "^2.2.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/parenthesis": {
"version": "3.1.8",
"resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz",
@@ -3193,16 +3053,6 @@
"license": "MIT",
"peer": true
},
- "node_modules/path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
@@ -3256,19 +3106,6 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
- "node_modules/pkg-dir": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
- "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "find-up": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/plotly.js": {
"version": "2.35.3",
"resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-2.35.3.tgz",
@@ -3711,51 +3548,6 @@
"rollup": "^2.0.0"
}
},
- "node_modules/rollup-plugin-typescript2": {
- "version": "0.36.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz",
- "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@rollup/pluginutils": "^4.1.2",
- "find-cache-dir": "^3.3.2",
- "fs-extra": "^10.0.0",
- "semver": "^7.5.4",
- "tslib": "^2.6.2"
- },
- "peerDependencies": {
- "rollup": ">=1.26.3",
- "typescript": ">=2.4.0"
- }
- },
- "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
- "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "estree-walker": "^2.0.1",
- "picomatch": "^2.2.2"
- },
- "engines": {
- "node": ">= 8.0.0"
- }
- },
- "node_modules/rollup-plugin-typescript2/node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
"node_modules/rw": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
@@ -3829,6 +3621,7 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
"integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
"license": "ISC",
+ "peer": true,
"bin": {
"semver": "bin/semver.js"
},
@@ -4258,7 +4051,8 @@
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
- "license": "0BSD"
+ "license": "0BSD",
+ "peer": true
},
"node_modules/type": {
"version": "2.7.3",
@@ -4295,36 +4089,12 @@
"dup": "^1.0.0"
}
},
- "node_modules/typescript": {
- "version": "5.8.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
- "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
- "dev": true,
- "license": "Apache-2.0",
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"license": "MIT"
},
- "node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/unquote": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz",
diff --git a/package.json b/package.json
index 94de51e..2539c15 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "feascript",
- "version": "0.1.1",
+ "version": "0.1.2",
"description": "A lightweight finite element simulation library built in JavaScript for browser-based physics and engineering simulations",
"main": "dist/feascript.cjs.js",
"module": "dist/feascript.esm.js",
@@ -13,7 +13,6 @@
"dist",
"src"
],
- "types": "dist/types/index.d.ts",
"directories": {
"example": "examples"
},
@@ -54,16 +53,13 @@
},
"peerDependencies": {
"mathjs": "^11.12.0",
- "plotly.js": "^2.27.0"
+ "plotly.js": "^2.35.3"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.3",
"@rollup/plugin-node-resolve": "^16.0.1",
- "@types/estree": "^1.0.7",
"mathjs": "^11.12.0",
"rollup": "^2.79.2",
- "rollup-plugin-terser": "^7.0.2",
- "rollup-plugin-typescript2": "^0.36.0",
- "typescript": "^5.8.3"
+ "rollup-plugin-terser": "^7.0.2"
}
}
diff --git a/src/FEAScript.js b/src/FEAScript.js
index e7a5dda..a588d19 100644
--- a/src/FEAScript.js
+++ b/src/FEAScript.js
@@ -10,6 +10,9 @@
// Internal imports
import { jacobiMethod } from "./methods/jacobiMethodScript.js";
+import { newtonRaphson } from "./methods/newtonRaphsonScript.js";
+import { solveLinearSystem } from "./methods/linearSystemScript.js";
+import { assembleFrontPropagationMat } from "./solvers/frontPropagationScript.js";
import { assembleSolidHeatTransferMat } from "./solvers/solidHeatTransferScript.js";
import { basicLog, debugLog, errorLog } from "./utilities/loggingScript.js";
@@ -36,9 +39,7 @@ export class FEAScriptModel {
setMeshConfig(meshConfig) {
this.meshConfig = meshConfig;
- debugLog(
- `Mesh config set with dimensions: ${meshConfig.meshDimension}`
- );
+ debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);
}
addBoundaryCondition(boundaryKey, condition) {
@@ -63,41 +64,55 @@ export class FEAScriptModel {
let solutionVector = [];
let nodesCoordinates = {};
- // Assembly matrices
- basicLog("Beginning matrix assembly...");
- console.time("assemblyMatrices");
+ // Select and execute the appropriate solver based on solverConfig
+ basicLog("Beginning solving process...");
+ console.time("totalSolvingTime");
if (this.solverConfig === "solidHeatTransferScript") {
basicLog(`Using solver: ${this.solverConfig}`);
({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(
this.meshConfig,
this.boundaryConditions
));
- }
- console.timeEnd("assemblyMatrices");
- basicLog("Matrix assembly completed");
- // System solving
- basicLog(`Solving system using ${this.solverMethod}...`);
- console.time("systemSolving");
- if (this.solverMethod === "lusolve") {
- solutionVector = math.lusolve(jacobianMatrix, residualVector);
- } else if (this.solverMethod === "jacobi") {
- // Create initial guess of zeros
- const initialGuess = new Array(residualVector.length).fill(0);
- // Call Jacobi method with desired max iterations and tolerance
- const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);
+ // Solve the assembled linear system
+ const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);
+ solutionVector = linearSystemResult.solutionVector;
+ } else if (this.solverConfig === "frontPropagationScript") {
+ basicLog(`Using solver: ${this.solverConfig}`);
+ let eikonalActivationFlag = 0; // Parameterization flag (from 0 to 1)
+ const initialEikonalViscousTerm = 0.1; // Initial viscous term for the front propagation (eikonal) equation
+ let eikonalViscousTerm = 1 - eikonalActivationFlag + initialEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation
- // Log convergence information
- if (jacobiResult.converged) {
- debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);
- } else {
- debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);
- }
+ // Create context object with all necessary properties
+ const context = {
+ meshConfig: this.meshConfig,
+ boundaryConditions: this.boundaryConditions,
+ eikonalActivationFlag,
+ eikonalViscousTerm,
+ solverMethod: this.solverMethod,
+ };
- solutionVector = jacobiResult.solution;
+ while (eikonalActivationFlag <= 1) {
+ // Use Newton-Raphson to iterate
+ const newtonRaphsonResult = newtonRaphson(
+ assembleFrontPropagationMat, // Pass the function reference
+ context,
+ 100, // maxIterations
+ 1e-7 // tolerance
+ );
+
+ // Extract results
+ jacobianMatrix = newtonRaphsonResult.jacobianMatrix;
+ residualVector = newtonRaphsonResult.residualVector;
+ nodesCoordinates = newtonRaphsonResult.nodesCoordinates;
+ solutionVector = newtonRaphsonResult.solution;
+
+ // Increment eikonalActivationFlag for next step
+ eikonalActivationFlag += 0.1;
+ }
}
- console.timeEnd("systemSolving");
- basicLog("System solved successfully");
+ console.timeEnd("totalSolvingTime");
+ basicLog("Solving process completed");
return { solutionVector, nodesCoordinates };
}
diff --git a/src/index.js b/src/index.js
index c836d38..12a5482 100644
--- a/src/index.js
+++ b/src/index.js
@@ -13,4 +13,4 @@ export { importGmshQuadTri } from "./readers/gmshReaderScript.js";
export { logSystem, printVersion } from "./utilities/loggingScript.js";
export { plotSolution } from "./visualization/plotSolutionScript.js";
export { FEAScriptWorker } from "./workers/workerScript.js";
-export const VERSION = "0.1.1";
\ No newline at end of file
+export const VERSION = "0.1.2";
\ No newline at end of file
diff --git a/src/methods/euclideanNormScript.js b/src/methods/euclideanNormScript.js
new file mode 100644
index 0000000..f0ef057
--- /dev/null
+++ b/src/methods/euclideanNormScript.js
@@ -0,0 +1,23 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+/**
+ * Function to calculate the Euclidean norm of a vector
+ * @param {array} vector - The input vector
+ * @returns {number} The Euclidean norm of the vector
+ */
+export function euclideanNorm(vector) {
+ let norm = 0;
+ for (let i = 0; i < vector.length; i++) {
+ norm += vector[i] * vector[i];
+ }
+ norm = Math.sqrt(norm);
+ return norm;
+}
diff --git a/src/methods/jacobiMethodScript.js b/src/methods/jacobiMethodScript.js
index 1a3e3df..bc411f3 100644
--- a/src/methods/jacobiMethodScript.js
+++ b/src/methods/jacobiMethodScript.js
@@ -10,33 +10,35 @@
/**
* Function to solve a system of linear equations using the Jacobi iterative method
- * @param {array} A - The coefficient matrix (must be square)
- * @param {array} b - The right-hand side vector
- * @param {array} x0 - Initial guess for solution vector
- * @param {number} [maxIterations=100] - Maximum number of iterations
- * @param {number} [tolerance=1e-7] - Convergence tolerance
+ * @param {array} jacobianMatrix - The coefficient matrix (must be square)
+ * @param {array} residualVector - The right-hand side vector
+ * @param {array} initialGuess - Initial guess for solution vector
+ * @param {object} [options] - Options for the solver
+ * @param {number} [options.maxIterations=1000] - Maximum number of iterations
+ * @param {number} [options.tolerance=1e-6] - Convergence tolerance
* @returns {object} An object containing:
- * - solution: The solution vector
+ * - solutionVector: The solution vector
* - iterations: The number of iterations performed
* - converged: Boolean indicating whether the method converged
*/
-export function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {
- const n = A.length; // Size of the square matrix
- let x = [...x0]; // Current solution (starts with initial guess)
+export function jacobiMethod(jacobianMatrix, residualVector, initialGuess, options = {}) {
+ const { maxIterations = 1000, tolerance = 1e-6 } = options;
+ const n = jacobianMatrix.length; // Size of the square matrix
+ let x = [...initialGuess]; // Current solution (starts with initial guess)
let xNew = new Array(n); // Next iteration's solution
for (let iteration = 0; iteration < maxIterations; iteration++) {
// Perform one iteration
for (let i = 0; i < n; i++) {
let sum = 0;
- // Calculate sum of A[i][j] * x[j] for j ≠i
+ // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠i
for (let j = 0; j < n; j++) {
if (j !== i) {
- sum += A[i][j] * x[j];
+ sum += jacobianMatrix[i][j] * x[j];
}
}
// Update xNew[i] using the Jacobi formula
- xNew[i] = (b[i] - sum) / A[i][i];
+ xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i];
}
// Check convergence
@@ -51,7 +53,7 @@ export function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {
// Successfully converged if maxDiff is less than tolerance
if (maxDiff < tolerance) {
return {
- solution: x,
+ solutionVector: x,
iterations: iteration + 1,
converged: true,
};
@@ -60,7 +62,7 @@ export function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {
// maxIterations were reached without convergence
return {
- solution: x,
+ solutionVector: x,
iterations: maxIterations,
converged: false,
};
diff --git a/src/methods/linearSystemScript.js b/src/methods/linearSystemScript.js
new file mode 100644
index 0000000..18ccc4b
--- /dev/null
+++ b/src/methods/linearSystemScript.js
@@ -0,0 +1,68 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Internal imports
+import { jacobiMethod } from "./jacobiMethodScript.js";
+import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js";
+
+/**
+ * Function to solve a system of linear equations using different solver methods
+ * @param {string} solverMethod - The solver method to use ("lusolve" or "jacobi")
+ * @param {Array} jacobianMatrix - The coefficient matrix
+ * @param {Array} residualVector - The right-hand side vector
+ * @param {object} [options] - Additional options for the solver
+ * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods
+ * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods
+ * @returns {object} An object containing:
+ * - solutionVector: The solution vector
+ * - converged: Boolean indicating whether the method converged (for iterative methods)
+ * - iterations: Number of iterations performed (for iterative methods)
+ */
+export function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) {
+ const { maxIterations = 1000, tolerance = 1e-6 } = options;
+
+ let solutionVector = [];
+ let converged = true;
+ let iterations = 0;
+
+ // Solve the linear system based on the specified solver method
+ basicLog(`Solving system using ${solverMethod}...`);
+ console.time("systemSolving");
+
+ if (solverMethod === "lusolve") {
+ // Use LU decomposition method
+ solutionVector = math.lusolve(jacobianMatrix, residualVector);
+ } else if (solverMethod === "jacobi") {
+ // Use Jacobi method
+ const initialGuess = new Array(residualVector.length).fill(0);
+ const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, {
+ maxIterations,
+ tolerance,
+ });
+
+ // Log convergence information
+ if (jacobiResult.converged) {
+ debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);
+ } else {
+ debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);
+ }
+
+ solutionVector = jacobiResult.solutionVector;
+ converged = jacobiResult.converged;
+ iterations = jacobiResult.iterations;
+ } else {
+ errorLog(`Unknown solver method: ${solverMethod}`);
+ }
+
+ console.timeEnd("systemSolving");
+ basicLog("System solved successfully");
+
+ return { solutionVector, converged, iterations };
+}
diff --git a/src/methods/newtonRaphsonScript.js b/src/methods/newtonRaphsonScript.js
new file mode 100644
index 0000000..0abecd5
--- /dev/null
+++ b/src/methods/newtonRaphsonScript.js
@@ -0,0 +1,90 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Internal imports
+import { euclideanNorm } from "../methods/euclideanNormScript.js";
+import { solveLinearSystem } from "../methods/linearSystemScript.js";
+import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js";
+
+/**
+ * Function to solve a system of nonlinear equations using the Newton-Raphson method
+ * @param {number} [maxIterations=100] - Maximum number of iterations
+ * @param {number} [tolerance=1e-7] - Convergence tolerance
+ * @returns {object} An object containing:
+ * - solutionVector: The solution vector
+ * - iterations: The number of iterations performed
+ * - converged: Boolean indicating whether the method converged
+ */
+
+export function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-7) {
+ let errorNorm = 0;
+ let converged = false;
+ let iterations = 0;
+ let deltaX = [];
+ let solutionVector = [];
+ let jacobianMatrix = [];
+ let residualVector = [];
+ let nodesCoordinates = {};
+
+ // Initialize solution and deltaX
+ for (let i = 0; i < residualVector.length; i++) {
+ solutionVector[i] = 0;
+ deltaX[i] = 0;
+ }
+
+ while (iterations < maxIterations && !converged) {
+ // Update solution
+ for (let i = 0; i < solutionVector.length; i++) {
+ solutionVector[i] = solutionVector[i] + deltaX[i];
+ }
+
+ // Compute Jacobian and Residual matrices
+ if (assembleMat === "assembleFrontPropagationMat") {
+ // Pass an additional viscous parameter for front propagation
+ ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleMat(
+ context.meshConfig,
+ context.boundaryConditions,
+ context.eikonalViscousTerm
+ ));
+ } else {
+ // Standard call for other assembly functions
+ ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleMat(
+ context.meshConfig,
+ context.boundaryConditions
+ ));
+ }
+
+ // Solve the linear system based on the specified solver method
+ const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);
+ deltaX = linearSystemResult.solutionVector;
+
+ // Check convergence
+ errorNorm = euclideanNorm(deltaX);
+ if (errorNorm <= tolerance) {
+ converged = true;
+ } else if (errorNorm > 1e5) {
+ errorLog(`Solution not converged. Error norm: ${errorNorm}`);
+ break;
+ }
+
+ iterations++;
+ }
+
+ debugLog(`Newton-Raphson ${converged ? "converged" : "did not converge"} in ${iterations} iterations`);
+
+ return {
+ solutionVector,
+ converged,
+ iterations,
+ jacobianMatrix,
+ residualVector,
+ nodesCoordinates,
+ };
+}
diff --git a/src/solvers/frontPropagationScript.js b/src/solvers/frontPropagationScript.js
new file mode 100644
index 0000000..f60dc44
--- /dev/null
+++ b/src/solvers/frontPropagationScript.js
@@ -0,0 +1,236 @@
+// ______ ______ _____ _ _ //
+// | ____| ____| /\ / ____| (_) | | //
+// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
+// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
+// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
+// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
+// | | | | //
+// |_| | |_ //
+// Website: https://feascript.com/ \__| //
+
+// Internal imports
+import { numericalIntegration } from "../methods/numericalIntegrationScript.js";
+import { basisFunctions } from "../mesh/basisFunctionsScript.js";
+import { meshGeneration } from "../mesh/meshGenerationScript.js";
+import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js";
+
+/**
+ * Function to assemble the front propagation matrix
+ * @param {object} meshConfig - Object containing computational mesh details
+ * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis
+ * @returns {object} An object containing:
+ * - jacobianMatrix: The assembled Jacobian matrix
+ * - residualVector: The assembled residual vector
+ * - nodesCoordinates: Object containing x and y coordinates of nodes
+ */
+export function assembleFrontPropagationMat(meshConfig, boundaryConditions, eikonalViscousTerm) {
+ basicLog("Starting front propagation matrix assembly...");
+
+ // Extract mesh details from the configuration object
+ const {
+ meshDimension, // The dimension of the mesh
+ numElementsX, // Number of elements in x-direction
+ numElementsY, // Number of elements in y-direction (only for 2D)
+ maxX, // Max x-coordinate (m) of the domain
+ maxY, // Max y-coordinate (m) of the domain (only for 2D)
+ elementOrder, // The order of elements
+ parsedMesh, // The pre-parsed mesh data (if available)
+ } = meshConfig;
+
+ // Create a new instance of the meshGeneration class
+ debugLog("Generating mesh...");
+ const meshGenerationData = new meshGeneration({
+ numElementsX,
+ numElementsY,
+ maxX,
+ maxY,
+ meshDimension,
+ elementOrder,
+ parsedMesh, // Pass the parsed mesh to the mesh generator
+ });
+
+ // Generate the mesh
+ const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();
+
+ // Extract nodes coordinates and nodal numbering (NOP) from the mesh data
+ let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;
+ let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;
+ let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;
+ let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;
+ let nop = nodesCoordinatesAndNumbering.nodalNumbering;
+ let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;
+
+ // Check the mesh type
+ const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;
+
+ // Calculate totalElements and totalNodes based on mesh type
+ let totalElements, totalNodes;
+
+ if (isParsedMesh) {
+ totalElements = nop.length; // Number of elements is the length of the nodal numbering array
+ totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array
+
+ // Debug log for mesh size
+ debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);
+ } else {
+ // For structured mesh, calculate based on dimensions
+ totalElements = numElementsX * (meshDimension === "2D" ? numElementsY : 1);
+ totalNodes = totalNodesX * (meshDimension === "2D" ? totalNodesY : 1);
+ // Debug log for mesh size
+ debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);
+ }
+
+ // Initialize variables for matrix assembly
+ let localToGlobalMap = []; // Maps local element node indices to global mesh node indices
+ let gaussPoints = []; // Gauss points
+ let gaussWeights = []; // Gauss weights
+ let basisFunction = []; // Basis functions
+ let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi
+ let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)
+ let basisFunctionDerivX = []; // The x-derivative of the basis function
+ let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)
+ let residualVector = []; // Galerkin residuals
+ let jacobianMatrix = []; // Jacobian matrix
+ let xCoordinates; // x-coordinate (physical coordinates)
+ let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)
+ let ksiDerivX; // ksi-derivative of xCoordinates
+ let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)
+ let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)
+ let etaDerivY; // eta-derivative of yCoordinates (only for 2D)
+ let detJacobian; // The jacobian of the isoparametric mapping
+
+ // Initialize jacobianMatrix and residualVector arrays
+ for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {
+ residualVector[nodeIndex] = 0;
+ jacobianMatrix.push([]);
+ for (let colIndex = 0; colIndex < totalNodes; colIndex++) {
+ jacobianMatrix[nodeIndex][colIndex] = 0;
+ }
+ }
+
+ // Initialize the basisFunctions class
+ const basisFunctionsData = new basisFunctions({
+ meshDimension,
+ elementOrder,
+ });
+
+ // Initialize the numericalIntegration class
+ const numIntegrationData = new numericalIntegration({
+ meshDimension,
+ elementOrder,
+ });
+
+ // Calculate Gauss points and weights
+ let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();
+ gaussPoints = gaussPointsAndWeights.gaussPoints;
+ gaussWeights = gaussPointsAndWeights.gaussWeights;
+
+ // Determine the number of nodes in the reference element based on the first element in the nop array
+ const numNodes = nop[0].length;
+
+ // Matrix assembly
+ for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {
+ for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
+ // Subtract 1 from nop in order to start numbering from 0
+ localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;
+ }
+
+ // Loop over Gauss points
+ for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {
+ // 1D front propagation (eikonal) equation
+ if (meshDimension === "1D") {
+ let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(
+ gaussPoints[gaussPointIndex1]
+ );
+ basisFunction = basisFunctionsAndDerivatives.basisFunction;
+ basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;
+ xCoordinates = 0;
+ ksiDerivX = 0;
+ detJacobian = 0;
+
+ // Isoparametric mapping
+ for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
+ xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];
+ ksiDerivX +=
+ nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];
+ detJacobian = ksiDerivX;
+ }
+
+ // Compute x-derivative of basis functions
+ for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
+ basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function
+ }
+
+ // Computation of Galerkin's residuals and Jacobian matrix
+ for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {
+ let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];
+ // residualVector
+
+ for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {
+ let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];
+ // jacobianMatrix
+ }
+ }
+ // 2D front propagation (eikonal) equation
+ } else if (meshDimension === "2D") {
+ for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {
+ // Initialise variables for isoparametric mapping
+ let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(
+ gaussPoints[gaussPointIndex1],
+ gaussPoints[gaussPointIndex2]
+ );
+ basisFunction = basisFunctionsAndDerivatives.basisFunction;
+ basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;
+ basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;
+ xCoordinates = 0;
+ yCoordinates = 0;
+ ksiDerivX = 0;
+ etaDerivX = 0;
+ ksiDerivY = 0;
+ etaDerivY = 0;
+ detJacobian = 0;
+
+ // Isoparametric mapping
+ for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
+ xCoordinates +=
+ nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];
+ yCoordinates +=
+ nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];
+ ksiDerivX +=
+ nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];
+ etaDerivX +=
+ nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];
+ ksiDerivY +=
+ nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];
+ etaDerivY +=
+ nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];
+ detJacobian = meshDimension === "2D" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;
+ }
+
+ // Compute x-derivative and y-derivative of basis functions
+ for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
+ basisFunctionDerivX[localNodeIndex] =
+ (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -
+ ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /
+ detJacobian; // The x-derivative of the n basis function
+ basisFunctionDerivY[localNodeIndex] =
+ (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -
+ etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /
+ detJacobian; // The y-derivative of the n basis function
+ }
+
+ // Computation of Galerkin's residuals and Jacobian matrix
+ for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {
+ let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];
+ // residualVector
+
+ for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {
+ let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];
+ //jacobianMatrix
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/solvers/thermalBoundaryConditionsScript.js b/src/solvers/thermalBoundaryConditionsScript.js
index 64c0d0c..114d50b 100644
--- a/src/solvers/thermalBoundaryConditionsScript.js
+++ b/src/solvers/thermalBoundaryConditionsScript.js
@@ -293,10 +293,12 @@ export class ThermalBoundaryConditions {
}
// Compute the length of tangent vector
- const tangentVectorLength =
- side === 0 || side === 2
- ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)
- : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
+ let tangentVectorLength;
+ if (side === 0 || side === 2) {
+ tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);
+ } else {
+ tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
+ }
for (
let localNodeIndex = firstNodeIndex;
@@ -312,7 +314,11 @@ export class ThermalBoundaryConditions {
// Apply boundary condition with proper Jacobian for all sides
residualVector[globalNodeIndex] +=
- -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;
+ -gaussWeights[0] *
+ tangentVectorLength *
+ basisFunction[localNodeIndex] *
+ convectionCoeff *
+ extTemp;
for (
let localNodeIndex2 = firstNodeIndex;
@@ -389,10 +395,12 @@ export class ThermalBoundaryConditions {
}
// Compute the length of tangent vector
- const tangentVectorLength =
- side === 0 || side === 2
- ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)
- : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
+ let tangentVectorLength;
+ if (side === 0 || side === 2) {
+ tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);
+ } else {
+ tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
+ }
for (
let localNodeIndex = firstNodeIndex;
diff --git a/src/visualization/plotSolutionScript.js b/src/visualization/plotSolutionScript.js
index 75fbe72..5fc1c7e 100644
--- a/src/visualization/plotSolutionScript.js
+++ b/src/visualization/plotSolutionScript.js
@@ -73,9 +73,12 @@ export function plotSolution(
const uniqueYCoords = new Set(nodesYCoordinates).size;
// Extract scalar values from solution vector
- let zValues = Array.isArray(solutionVector[0])
- ? solutionVector.map(val => val[0])
- : solutionVector;
+ let zValues;
+ if (Array.isArray(solutionVector[0])) {
+ zValues = solutionVector.map(val => val[0]);
+ } else {
+ zValues = solutionVector;
+ }
// Common sizing parameters for both plot types
let maxWindowWidth = Math.min(window.innerWidth, 700);
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy