Loading...
Searching...
No Matches
torch2Foam.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12
13 License
14 This file is part of ITHACA-FV
15
16 ITHACA-FV is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License as published by
18 the Free Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
20
21 ITHACA-FV is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU Lesser General Public License for more details.
25
26 You should have received a copy of the GNU Lesser General Public License
27 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
28
29\*---------------------------------------------------------------------------*/
30
35
36#ifndef torch2Foam_H
37#define torch2Foam_H
38
39#include <iostream>
40#include <torch/script.h>
41#include <torch/torch.h>
42#include <Eigen/Eigen>
43#include "ITHACAassert.H"
44#include "fvCFD.H"
45
46namespace ITHACAtorch
47{
48namespace torch2Foam
49{
50//--------------------------------------------------------------------------
60template <class type_f>
61torch::Tensor field2Torch(Field<type_f>& field);
62
63//--------------------------------------------------------------------------
72template <class type_f>
73Field<type_f> torch2Field(torch::Tensor& tTensor);
74
75template <class type_f>
76torch::Tensor ptrList2Torch(PtrList<type_f>& ptrList);
77
78template <class type_f>
79PtrList<Field<type_f>> torch2PtrList(torch::Tensor& tTensor);
80}
81
82}
83
84#endif
Implementation of the assert function for ITHACA-FV.
torch::Tensor field2Torch(Field< vector > &field)
Definition torch2Foam.C:39
Field< vector > torch2Field(torch::Tensor &torchTensor)
Definition torch2Foam.C:59
torch::Tensor ptrList2Torch(PtrList< Field< vector > > &ptrList)
Definition torch2Foam.C:87
PtrList< Field< type_f > > torch2PtrList(torch::Tensor &tTensor)
Definition torch2Foam.C:117