Skip to content

Commit 5e9b7a1

Browse files
authored
bug-fix - fixed constexpr (#64)
* fixed constexpr
1 parent 4d8fd8c commit 5e9b7a1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# FANS Changelog
22

3+
## latest
4+
5+
- remove std::sqrt from constexpr - failed on Clang
6+
37
## v0.4.0
48

59
- Support compilaion on MacOS X via conda-forge https://github.com/DataAnalyticsEngineering/FANS/pull/59

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ FANS requires a JSON input file specifying the problem parameters. Example input
233233
234234
- `macroscale_loading`: This defines the external loading applied to the microstructure. It is an array of arrays, where each sub-array represents a loading condition applied to the system. The format of the loading array depends on the problem type:
235235
- For `thermal` problems, the array typically has 3 components, representing the temperature gradients in the $x$, $y$, and $z$ directions.
236-
- For `mechanical` problems, the array must have 6 components, corresponding to the components of the strain tensor in Mandel notation (e.g., $[\varepsilon_{11},\; \varepsilon_{22},\; \varepsilon_{33},\; \sqrt{2}\varepsilon_{12},\; \sqrt{2}\varepsilon_{13},\; \sqrt{2}\varepsilon_{23}]$).
236+
- For `mechanical` problems, the array must have 6 components, corresponding to the components of the strain tensor in Mandel notation (e.g., $[\varepsilon_{11}, \varepsilon_{22}, \varepsilon_{33}, \sqrt{2}\varepsilon_{12}, \sqrt{2}\varepsilon_{13}, \sqrt{2}\varepsilon_{23}]$).
237237
238238
In the case of path/time-dependent loading as shown, for example as in plasticity problems, the `macroscale_loading` array can include multiple steps with corresponding loading conditions.
239239

include/solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void Solver<howmany>::postprocess(Reader reader, const char resultsFileName[], i
490490
const double Lx2 = reader.L[0] / 2.0;
491491
const double Ly2 = reader.L[1] / 2.0;
492492
const double Lz2 = reader.L[2] / 2.0;
493-
constexpr double rs2 = 1.0 / std::sqrt(2.0);
493+
constexpr double rs2 = 0.7071067811865475; // 1.0 / std::sqrt(2.0)
494494
VectorXd u_total(local_n0 * n_y * n_z * howmany);
495495
/* ---------- single sweep ------------------------------------------------- */
496496
ptrdiff_t n = 0;

0 commit comments

Comments
 (0)