Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Here is a minimal browser-based example using the JavaScript API. Adapt paths, s
const model = new FEAScriptModel();

// Set the solver type for your problem
model.setSolverConfig("solverType"); // Example: "solidHeatTransferScript"
model.setSolverConfig("solverType"); // Example: "heatConductionScript"

// Configure the mesh
model.setMeshConfig({
Expand All @@ -148,7 +148,7 @@ Here is a minimal browser-based example using the JavaScript API. Adapt paths, s

**Note:** The code above uses placeholder values that you should replace with appropriate options, e.g.:

- "solverType" should be replaced with an actual solver type such as "solidHeatTransferScript" for heat conduction problems
- "solverType" should be replaced with an actual solver type such as "heatConductionScript" for heat conduction problems
- "conditionType" should be replaced with an actual boundary condition type such as "constantTemp"
- "boundaryIndex" should be replaced with a string identifying the boundary

Expand Down
4 changes: 2 additions & 2 deletions dist/feascript.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.esm.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/feascript.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.umd.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ console.log("FEAScript Version:", printVersion);
const model = new FEAScriptModel();

// Set solver configuration
model.setSolverConfig("solidHeatTransferScript");
model.setSolverConfig("heatConductionScript");

// Define mesh configuration
model.setMeshConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This example demonstrates solving a steady-state heat transfer problem in a 2D r

This example is available in two Node.js implementations:

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)
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ console.log("FEAScript Version:", printVersion);
const model = new FEAScriptModel();

// Set solver configuration
model.setSolverConfig("solidHeatTransferScript");
model.setSolverConfig("heatConductionScript");

// Define mesh configuration
model.setMeshConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function main() {
const model = new FEAScriptModel();

// Set solver configuration
model.setSolverConfig("solidHeatTransferScript");
model.setSolverConfig("heatConductionScript");

// Create a mock File object for Node.js environment
const mockFile = {
Expand Down
12 changes: 6 additions & 6 deletions src/FEAScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { solveLinearSystem } from "./methods/linearSystemSolverScript.js";
import { prepareMesh } from "./mesh/meshUtilsScript.js";
import { assembleFrontPropagationMat } from "./solvers/frontPropagationScript.js";
import {
assembleSolidHeatTransferMat,
assembleSolidHeatTransferFront,
} from "./solvers/solidHeatTransferScript.js";
assembleHeatConductionMat,
assembleHeatConductionFront,
} from "./solvers/heatConductionScript.js";
import { runFrontalSolver } from "./methods/frontalSolverScript.js";
import { basicLog, debugLog, errorLog } from "./utilities/loggingScript.js";

Expand Down Expand Up @@ -92,20 +92,20 @@ export class FEAScriptModel {
// Select and execute the appropriate solver based on solverConfig
basicLog("Beginning solving process...");
console.time("totalSolvingTime");
if (this.solverConfig === "solidHeatTransferScript") {
if (this.solverConfig === "heatConductionScript") {
basicLog(`Using solver: ${this.solverConfig}`);

// Check if using frontal solver
if (this.solverMethod === "frontal") {
const frontalResult = runFrontalSolver(
assembleSolidHeatTransferFront,
assembleHeatConductionFront,
meshData,
this.boundaryConditions
);
solutionVector = frontalResult.solutionVector;
} else {
// Use regular linear solver methods
({ jacobianMatrix, residualVector } = assembleSolidHeatTransferMat(
({ jacobianMatrix, residualVector } = assembleHeatConductionMat(
meshData,
this.boundaryConditions
));
Expand Down
10 changes: 5 additions & 5 deletions src/methods/frontalSolverScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Internal imports
import { BasisFunctions } from "../mesh/basisFunctionsScript.js";
import { initializeFEA } from "../mesh/meshUtilsScript.js";
import { assembleSolidHeatTransferFront } from "../solvers/solidHeatTransferScript.js";
import { assembleHeatConductionFront } from "../solvers/heatConductionScript.js";
import { ThermalBoundaryConditions } from "../solvers/thermalBoundaryConditionsScript.js";
import { assembleFrontPropagationFront } from "../solvers/frontPropagationScript.js";
import { GenericBoundaryConditions } from "../solvers/genericBoundaryConditionsScript.js";
Expand Down Expand Up @@ -68,8 +68,8 @@ export function runFrontalSolver(assembleFront, meshData, boundaryConditions, op

// Handle Dirichlet-type boundary conditions differently based on which solver is being used
let dirichletBoundaryConditionsHandler;
// Solid heat transfer model (solidHeatTransferScript solver)
if (assembleFront === assembleSolidHeatTransferFront) {
// Solid heat transfer model (heatConductionScript solver)
if (assembleFront === assembleHeatConductionFront) {
dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(
boundaryConditions,
meshData.boundaryElements,
Expand Down Expand Up @@ -250,8 +250,8 @@ function assembleElementContribution(meshData, FEAData, thermalBoundaryCondition
.map(() => Array(FEAData.numNodes).fill(0));
let boundaryResidualVector = Array(FEAData.numNodes).fill(0);

// solidHeatTransferScript solver
if (assembleFront === assembleSolidHeatTransferFront) {
// heatConductionScript solver
if (assembleFront === assembleHeatConductionFront) {
// Check if this element is on a Robin-type boundary
let isOnRobinTypeBoundary = false;
for (const boundaryKey in meshData.boundaryElements) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { basicLog, debugLog } from "../utilities/loggingScript.js";
* classic stiffness/conductivity matrix and `residualVector`
* corresponds to the traditional load (RHS) vector.
*/
export function assembleSolidHeatTransferMat(meshData, boundaryConditions) {
export function assembleHeatConductionMat(meshData, boundaryConditions) {
basicLog("Starting solid heat transfer matrix assembly...");

// Extract mesh data
Expand Down Expand Up @@ -185,7 +185,7 @@ export function assembleSolidHeatTransferMat(meshData, boundaryConditions) {
* - localResidualVector: Residual vector contributions
* - ngl: Array mapping local node indices to global node indices
*/
export function assembleSolidHeatTransferFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {
export function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {
// Extract numerical integration parameters and mesh coordinates
const { gaussPoints, gaussWeights, numNodes } = FEAData;
const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;
Expand Down