Header file of the torch2Foam namespace.
More...
#include <iostream>
#include <torch/script.h>
#include <torch/torch.h>
#include <Eigen/Eigen>
#include "ITHACAassert.H"
#include "fvCFD.H"
Go to the source code of this file.
|
| template<class type_f> |
| torch::Tensor | ITHACAtorch::torch2Foam::field2Torch (Field< type_f > &field) |
| | Convert an OpenFOAM field to a torch tensor, in case of field<vector> the tensor is arranged as t = [fx;fy;fz].
|
| template<class type_f> |
| Field< type_f > | ITHACAtorch::torch2Foam::torch2Field (torch::Tensor &tTensor) |
| | Convert an Torch TensorOpenFOAM to an OpenFoam Field.
|
|
template<class type_f> |
| torch::Tensor | ITHACAtorch::torch2Foam::ptrList2Torch (PtrList< type_f > &ptrList) |
| template<class type_f> |
| PtrList< Field< type_f > > | ITHACAtorch::torch2Foam::torch2PtrList (torch::Tensor &tTensor) |
Header file of the torch2Foam namespace.
It contains functions to
Definition in file torch2Foam.H.
◆ field2Torch()
template<class type_f>
| torch::Tensor ITHACAtorch::torch2Foam::field2Torch |
( |
Field< type_f > & | field | ) |
|
Convert an OpenFOAM field to a torch tensor, in case of field<vector> the tensor is arranged as t = [fx;fy;fz].
- Parameters
-
- Template Parameters
-
| type_f | type can be scalar or vector |
- Returns
- the torch tensor
◆ torch2Field()
template<class type_f>
| Field< type_f > ITHACAtorch::torch2Foam::torch2Field |
( |
torch::Tensor & | tTensor | ) |
|
Convert an Torch TensorOpenFOAM to an OpenFoam Field.
- Parameters
-
- Template Parameters
-
| type_f | type can be scalar or vector |
- Returns
- the OF field
◆ torch2PtrList()
template<class type_f>
| PtrList< Field< type_f > > ITHACAtorch::torch2Foam::torch2PtrList |
( |
torch::Tensor & | tTensor | ) |
|