FlowModelingControl / flowtorch

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

dtype FOAMDataloader not set #50

Closed JanisGeise closed 3 months ago

JanisGeise commented 4 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 3 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