@@ -200,12 +200,12 @@ class EosBase {
200
200
// Generic evaluator
201
201
template <typename Functor_t>
202
202
PORTABLE_INLINE_FUNCTION void EvaluateDevice (const Functor_t f) const {
203
- const CRTP copy = *(static_cast <CRTP const *>(this ));
203
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
204
204
f (copy);
205
205
}
206
206
template <typename Functor_t>
207
207
void EvaluateHost (Functor_t &f) const {
208
- const CRTP copy = *(static_cast <CRTP const *>(this ));
208
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
209
209
f (copy);
210
210
}
211
211
@@ -247,7 +247,7 @@ class EosBase {
247
247
PORTABLE_INLINE_FUNCTION Real GibbsFreeEnergyFromDensityTemperature (
248
248
const Real rho, const Real T,
249
249
Indexer_t &&lambda = static_cast <Real *>(nullptr )) const {
250
- const CRTP copy = *(static_cast <CRTP const *>(this ));
250
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
251
251
Real sie = copy.InternalEnergyFromDensityTemperature (rho, T, lambda);
252
252
Real P = copy.PressureFromDensityTemperature (rho, T, lambda);
253
253
Real S = copy.EntropyFromDensityTemperature (rho, T, lambda);
@@ -257,7 +257,7 @@ class EosBase {
257
257
PORTABLE_INLINE_FUNCTION Real GibbsFreeEnergyFromDensityInternalEnergy (
258
258
const Real rho, const Real sie,
259
259
Indexer_t &&lambda = static_cast <Real *>(nullptr )) const {
260
- const CRTP copy = *(static_cast <CRTP const *>(this ));
260
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
261
261
Real T = copy.TemperatureFromDensityInternalEnergy (rho, sie, lambda);
262
262
Real P = copy.PressureFromDensityTemperature (rho, T, lambda);
263
263
Real S = copy.EntropyFromDensityTemperature (rho, T, lambda);
@@ -272,7 +272,7 @@ class EosBase {
272
272
LambdaIndexer &&lambdas) const {
273
273
static auto const name = SG_MEMBER_FUNC_NAME ();
274
274
static auto const cname = name.c_str ();
275
- CRTP copy = *(static_cast <CRTP const *>(this ));
275
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
276
276
portableFor (
277
277
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
278
278
temperatures[i] =
@@ -307,7 +307,7 @@ class EosBase {
307
307
LambdaIndexer &&lambdas) const {
308
308
static auto const name = SG_MEMBER_FUNC_NAME ();
309
309
static auto const cname = name.c_str ();
310
- CRTP copy = *(static_cast <CRTP const *>(this ));
310
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
311
311
portableFor (
312
312
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
313
313
sies[i] = copy.InternalEnergyFromDensityTemperature (rhos[i], temperatures[i],
@@ -342,7 +342,7 @@ class EosBase {
342
342
LambdaIndexer &&lambdas) const {
343
343
static auto const name = SG_MEMBER_FUNC_NAME ();
344
344
static auto const cname = name.c_str ();
345
- CRTP copy = *(static_cast <CRTP const *>(this ));
345
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
346
346
portableFor (
347
347
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
348
348
pressures[i] =
@@ -375,7 +375,7 @@ class EosBase {
375
375
LambdaIndexer &&lambdas) const {
376
376
static auto const name = SG_MEMBER_FUNC_NAME ();
377
377
static auto const cname = name.c_str ();
378
- CRTP copy = *(static_cast <CRTP const *>(this ));
378
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
379
379
portableFor (
380
380
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
381
381
pressures[i] =
@@ -406,7 +406,7 @@ class EosBase {
406
406
const int num, LambdaIndexer &&lambdas) const {
407
407
static auto const name = SG_MEMBER_FUNC_NAME ();
408
408
static auto const cname = name.c_str ();
409
- CRTP copy = *(static_cast <CRTP const *>(this ));
409
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
410
410
portableFor (
411
411
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
412
412
sies[i] = copy.MinInternalEnergyFromDensity (rhos[i], lambdas[i]);
@@ -436,7 +436,7 @@ class EosBase {
436
436
LambdaIndexer &&lambdas) const {
437
437
static auto const name = SG_MEMBER_FUNC_NAME ();
438
438
static auto const cname = name.c_str ();
439
- CRTP copy = *(static_cast <CRTP const *>(this ));
439
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
440
440
portableFor (
441
441
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
442
442
entropies[i] =
@@ -469,7 +469,7 @@ class EosBase {
469
469
LambdaIndexer &&lambdas) const {
470
470
static auto const name = SG_MEMBER_FUNC_NAME ();
471
471
static auto const cname = name.c_str ();
472
- CRTP copy = *(static_cast <CRTP const *>(this ));
472
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
473
473
portableFor (
474
474
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
475
475
entropies[i] =
@@ -501,7 +501,7 @@ class EosBase {
501
501
LambdaIndexer &&lambdas) const {
502
502
static auto const name = SG_MEMBER_FUNC_NAME ();
503
503
static auto const cname = name.c_str ();
504
- CRTP copy = *(static_cast <CRTP const *>(this ));
504
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
505
505
portableFor (
506
506
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
507
507
cvs[i] = copy.SpecificHeatFromDensityTemperature (rhos[i], temperatures[i],
@@ -536,7 +536,7 @@ class EosBase {
536
536
LambdaIndexer &&lambdas) const {
537
537
static auto const name = SG_MEMBER_FUNC_NAME ();
538
538
static auto const cname = name.c_str ();
539
- CRTP copy = *(static_cast <CRTP const *>(this ));
539
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
540
540
portableFor (
541
541
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
542
542
cvs[i] =
@@ -569,7 +569,7 @@ class EosBase {
569
569
LambdaIndexer &&lambdas) const {
570
570
static auto const name = SG_MEMBER_FUNC_NAME ();
571
571
static auto const cname = name.c_str ();
572
- CRTP copy = *(static_cast <CRTP const *>(this ));
572
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
573
573
portableFor (
574
574
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
575
575
bmods[i] = copy.BulkModulusFromDensityTemperature (rhos[i], temperatures[i],
@@ -604,7 +604,7 @@ class EosBase {
604
604
LambdaIndexer &&lambdas) const {
605
605
static auto const name = SG_MEMBER_FUNC_NAME ();
606
606
static auto const cname = name.c_str ();
607
- CRTP copy = *(static_cast <CRTP const *>(this ));
607
+ const CRTP & copy = *(static_cast <CRTP const *>(this ));
608
608
portableFor (
609
609
cname, 0 , num, PORTABLE_LAMBDA (const int i) {
610
610
bmods[i] =
0 commit comments