Skip to content

Commit ac43574

Browse files
committed
Refactor string quotes for consistency in solid heat transfer script
1 parent 215135a commit ac43574

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/solvers/solidHeatTransferScript.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
6666
let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;
6767

6868
// Initialize variables for matrix assembly
69-
const totalElements = numElementsX * (meshDimension === '2D' ? numElementsY : 1); // Total number of elements
70-
const totalNodes = totalNodesX * (meshDimension === '2D' ? totalNodesY : 1); // Total number of nodes
69+
const totalElements = numElementsX * (meshDimension === "2D" ? numElementsY : 1); // Total number of elements
70+
const totalNodes = totalNodesX * (meshDimension === "2D" ? totalNodesY : 1); // Total number of nodes
7171
let localNodalNumbers = []; // Local nodal numbering
7272
let gaussPoints = []; // Gauss points
7373
let gaussWeights = []; // Gauss weights
@@ -125,7 +125,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
125125
// Loop over Gauss points
126126
for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {
127127
// 1D solid heat transfer
128-
if (meshDimension === '1D') {
128+
if (meshDimension === "1D") {
129129
let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(
130130
gaussPoints[gaussPointIndex1]
131131
);
@@ -146,17 +146,14 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
146146

147147
// Compute x-derivative of basis functions
148148
for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {
149-
basisFunctionDerivX[localNodeIndex] =
150-
basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function
149+
basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function
151150
}
152151

153152
// Computation of Galerkin's residuals and Jacobian matrix
154153
for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {
155154
let globalNodeIndex1 = localNodalNumbers[localNodeIndex1];
156155
residualVector[globalNodeIndex1] +=
157-
gaussWeights[gaussPointIndex1] *
158-
detJacobian *
159-
basisFunction[localNodeIndex1];
156+
gaussWeights[gaussPointIndex1] * detJacobian * basisFunction[localNodeIndex1];
160157

161158
for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {
162159
let globalNodeIndex2 = localNodalNumbers[localNodeIndex2];
@@ -166,8 +163,8 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
166163
(basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);
167164
}
168165
}
169-
// 2D solid heat transfer
170-
} else if (meshDimension === '2D') {
166+
// 2D solid heat transfer
167+
} else if (meshDimension === "2D") {
171168
for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {
172169
// Initialise variables for isoparametric mapping
173170
let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(
@@ -199,7 +196,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
199196
nodesYCoordinates[localNodalNumbers[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];
200197
etaDerivY +=
201198
nodesYCoordinates[localNodalNumbers[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];
202-
detJacobian = meshDimension === '2D' ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;
199+
detJacobian = meshDimension === "2D" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;
203200
}
204201

205202
// Compute x-derivative and y-derivative of basis functions

0 commit comments

Comments
 (0)