How are ranges sampled in Parameterization objects

Hello,

I was looking at the wave_1d example and was curious on how the values for the parameter time are chosen?

In the code I see the following lines

Line 37

time_range = {t_symbol: (0, 2 * L)}

Line 53-61

boundary condition

BC = PointwiseBoundaryConstraint(
    nodes=nodes,
    geometry=geo,
    outvar={"u": 0},
    batch_size=cfg.batch_size.BC,
    parameterization=time_range,
)
domain.add_constraint(BC, "BC")

What are the steps used for the time range or is it some type of random distribution that is used? Is it possible to change this to use time steps or other options?

Thank you for your help.

Hi @tstone

Yes sampled uniformly in that range. For future reference in the parameterization class you’ll fine the sample function which calls the _sample_ranges function for each variable which is indeed uniformly sampling. Unless of course you choose quasirandom sampling or provide a discrete list / fixed value/ etc.

For fixed time-steps you could replace that tuple with a numpy array and it will select a value from the given array. Have a look at this source code here to see what happens for a given input. Hope this helps!

Great, thank you for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.