// Read results from a file. // displ - displacements for the finite element model (out) public void readResults(String resultFile, double[] displ) { if (resultFile == null) { return; } FeScanner RD = new FeScanner(resultFile); // Read displacements RD.moveAfterLineWithWord("node"); for (int i = 0; i < fem.nNod; i++) { RD.readInt(); for (int j = 0; j < fem.nDim; j++) { displ[fem.nDim * i + j] = RD.readDouble(); } } // Read stresses for (int iel = 0; iel < fem.nEl; iel++) { RD.moveAfterLineWithWord("el"); foreach (StressContainer aStr in fem.elems[iel].str) { for (int i = 0; i < 2 * fem.nDim; i++) { if (fem.nDim == 3) { aStr.sStress[i] = RD.readDouble(); } else { if (i == 2) { aStr.sStress[i + 1] = RD.readDouble(); } else if (i == 3) { aStr.sStress[i - 1] = RD.readDouble(); } else { aStr.sStress[i] = RD.readDouble(); } } } aStr.sEpi = RD.readDouble(); } } RD.close(); }