FlowModelingControl / flowtorch

flowTorch - a Python library for analysis and reduced-order modeling of fluid flows
GNU General Public License v3.0
131 stars 45 forks source link

dtype FOAMDataloader not set #50

Closed JanisGeise closed 2 months ago

JanisGeise commented 2 months ago

Hi @AndreWeiner,

when passing a dtype as argument for the FOAMDataloader, it is not set correctly. For example in

loader = FOAMDataloader(load_dir, dtype="pt.float64")
print(_loader.vertices.dtype)

# prints torch.float32

the type remains always the DEFAULT_DTYPE, independently whether passed as string or directly as, e.g. pt.float64. I'm assuming this issue affects the other Dataloader as well.

Further, in the Dataloaderbase class, the decorator @abstractproperty is depreciated according to the Python documentation and should be replaced with

@property
@abstractmethod

Regards, Janis

AndreWeiner commented 2 months ago

@JanisGeise the dtype passed to the constructor of FOAMDataloader was not correctly passed to the constructor of FOAMMesh. The problem is specific to this dataloader and should be fixed now (on the aweiner branch). Thanks for spotting this issue. Best, Andre