Castro icon indicating copy to clipboard operation
Castro copied to clipboard

radiation should use _cpp_parameters

Open zingale opened this issue 7 years ago • 7 comments

To make it easier to discover, document, and add runtime parameters, we should modify Gravity.cpp, Radiation.cpp, and Diffusion.cpp to use the _cpp_parameters functionality.

zingale avatar Sep 17 '16 14:09 zingale

the radiation parameters seem confusing. A lot of them are dimensioned as arrays, but we only ever use them as scalars.

Take for instance, const_c_v

We declare this as:

const Real* const_c_v

dimension it as:

const_c_v.resize( 1, -1.0);

and then fill it as:

pp.queryarr("const_c_v",       const_c_v,       0, 1);

(note, we even print it as:

    std::cout << "const_c_v     =";                                                                               
    for (n = 0; n < 1; n++) std::cout << " " << const_c_v[n];          

)

When passing it to RAD_1D.F90, we dimension const in Fortran as: const(0:1) -- this has 2 elements even though in C++ we have only one quantity.

This all seems inconsistent.

Why can't these parameters just be scalars? and the Fortran code fixed to accept them as scalars?

@WeiqunZhang thoughts?

zingale avatar Sep 18 '16 15:09 zingale

This is leftover from Louis's previous code for multiple materials.

Feel free to change it to scalar.

On Sep 18, 2016 8:56 AM, "Michael Zingale" [email protected] wrote:

the radiation parameters seem confusing. A lot of them are dimensioned as arrays, but we only ever use them as scalars.

Take for instance, const_c_v

We declare this as:

const Real* const_c_v

dimension it as:

const_c_v.resize( 1, -1.0);

and then fill it as:

pp.queryarr("const_c_v", const_c_v, 0, 1);

(note, we even print it as:

std::cout << "const_c_v     =";
for (n = 0; n < 1; n++) std::cout << " " << const_c_v[n];

)

When passing it to RAD_1D.F90, we dimension const in Fortran as: const(0:1) -- this has 2 elements even though in C++ we have only one quantity.

This all seems inconsistent.

Why can't these parameters just be scalars? and the Fortran code fixed to accept them as scalars?

@WeiqunZhang https://github.com/WeiqunZhang thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BoxLib-Codes/Castro/issues/42#issuecomment-247855788, or mute the thread https://github.com/notifications/unsubscribe-auth/AHf54cxVaU8A4WMEvFKQ6DIsn-vZg29Qks5qrV8dgaJpZM4J_nRM .

WeiqunZhang avatar Sep 18 '16 16:09 WeiqunZhang

The array runtime parameters referenced in the above comment have now been removed

zingale avatar Dec 13 '16 20:12 zingale

particle parameters should also be moved into _cpp_parameters

zingale avatar Jan 19 '17 20:01 zingale

renamed to reflect that gravity and diffusion have been moved already

zingale avatar Jan 19 '17 23:01 zingale

radiation is difficult because a lot of the defaults are dependent on if-tests in the code that are only known at runtime.

zingale avatar Dec 10 '17 20:12 zingale

it looks like particles are all done

zingale avatar Jan 05 '19 00:01 zingale