8000 Added initial file for frontPropagationScript · FEAScript/FEAScript-core@cabe801 · GitHub
[go: up one dir, main page]

Skip to content

Commit cabe801

Browse files
committed
Added initial file for frontPropagationScript
1 parent 767da8a commit cabe801

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

src/FEAScript.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export class FEAScriptModel {
7272
this.meshConfig,
7373
this.boundaryConditions
7474
));
75+
} else if (this.solverConfig === "frontPropagationScript") {
76+
basicLog(`Using solver: ${this.solverConfig}`);
7577
}
7678
console.timeEnd("assemblyMatrices");
7779
basicLog("Matrix assembly completed");

src/solvers/frontPropagationScript.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// ______ ______ _____ _ _ //
2+
// | ____| ____| /\ / ____| (_) | | //
3+
// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
4+
// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
5+
// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
6+
// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
7+
// | | | | //
8+
// |_| | |_ //
9+
// Website: https://feascript.com/ \__| //

src/solvers/thermalBoundaryConditionsScript.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,12 @@ export class ThermalBoundaryConditions {
293293
}
294294

295295
// Compute the length of tangent vector
296-
const tangentVectorLength =
297-
side === 0 || side === 2
298-
? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)
299-
: Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
296+
let tangentVectorLength;
297+
if (side === 0 || side === 2) {
298+
tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);
299+
} else {
300+
tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
301+
}
300302

301303
for (
302304
let localNodeIndex = firstNodeIndex;
@@ -389,10 +391,12 @@ export class ThermalBoundaryConditions {
389391
}
390392

391393
// Compute the length of tangent vector
392-
const tangentVectorLength =
393-
side === 0 || side === 2
394-
? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)
395-
: Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
394+
let tangentVectorLength;
395+
if (side === 0 || side === 2) {
396+
tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);
397+
} else {
398+
tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);
399+
}
396400

397401
for (
398402
let localNodeIndex = firstNodeIndex;

src/visualization/plotSolutionScript.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ export function plotSolution(
7373
const uniqueYCoords = new Set(nodesYCoordinates).size;
7474

7575
// Extract scalar values from solution vector
76-
let zValues = Array.isArray(solutionVector[0])
77-
? solutionVector.map(val => val[0])
78-
: solutionVector;
76+
let zValues;
77+
if (Array.isArray(solutionVector[0])) {
78+
zValues = solutionVector.map(val => val[0]);
79+
} else {
80+
zValues = solutionVector;
81+
}
7982

8083
// Common sizing parameters for both plot types
8184
let maxWindowWidth = Math.min(window.innerWidth, 700);

0 commit comments

Comments
 (0)
0