Loading...
Searching...
No Matches
ConvLayer.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-------------------------------------------------------------------------------
12License
13 This file is part of ITHACA-FV
14 ITHACA-FV is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18 ITHACA-FV is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24Class
25 ConvLayer
26Description
27 set of functions to convert Eigen object to Torch objects and viceversa
28SourceFiles
29 ConvLayer.C
30\*---------------------------------------------------------------------------*/
31
34
35#ifndef ConvLayer_H
36#define ConvLayer_H
37
38#include <iostream>
39#include <torch/script.h>
40#include <torch/torch.h>
41#include <Eigen/Eigen>
42#include "ITHACAassert.H"
43#include "fvCFD.H"
44#include "boxToCell.H"
45#include "cellSet.H"
46#include "Filter.H"
47
48
49namespace ITHACAtorch
50{
51template<class Type, template<class> class PatchField, class GeoMesh>
53{
54 public:
55 //--------------------------------------------------------------------------
60 ConvLayer(PtrList<GeometricField<Type, PatchField, GeoMesh>>& snapshots);
61
62 PtrList<GeometricField<Type, PatchField, GeoMesh>>& _snapshots;
63 const fvMesh& mesh;
64
65 Vector<label> domainDivision;
66 Vector<scalar> filterSize;
67 Vector<scalar> domainSize;
68 Vector<scalar> ds;
69
70 List<point> convPoints;
71
72 void setFilterSize(double dx, double dy, double dz);
73 void setDomainDivision(label Nx, label Ny, label Nz);
74
75 torch::Tensor filter();
76 treeBoundBox box;
77
78 List<labelList> cellsInBoxes;
79 List<scalarList> weights;
80
81 bool isDomainDivisionSet = false;
82 bool isFilterSizeSet = false;
83
84 autoPtr<Filter> flt;
85 autoPtr<IOdictionary> convDict;
86};
87
91
92}
93#endif
Header file of the BaseFilter class.
Implementation of the assert function for ITHACA-FV.
torch::Tensor filter()
Vector< label > domainDivision
Definition ConvLayer.H:65
Vector< scalar > filterSize
Definition ConvLayer.H:66
autoPtr< Filter > flt
Definition ConvLayer.H:84
ConvLayer(PtrList< GeometricField< Type, PatchField, GeoMesh > > &snapshots)
Construct using Time as functionObject.
Definition ConvLayer.C:35
void setDomainDivision(label Nx, label Ny, label Nz)
Definition ConvLayer.C:65
List< scalarList > weights
Definition ConvLayer.H:79
const fvMesh & mesh
Definition ConvLayer.H:63
Vector< scalar > ds
Definition ConvLayer.H:68
void setFilterSize(double dx, double dy, double dz)
Definition ConvLayer.C:126
PtrList< GeometricField< Type, PatchField, GeoMesh > > & _snapshots
Definition ConvLayer.H:62
List< point > convPoints
Definition ConvLayer.H:70
autoPtr< IOdictionary > convDict
Definition ConvLayer.H:85
Vector< scalar > domainSize
Definition ConvLayer.H:67
List< labelList > cellsInBoxes
Definition ConvLayer.H:78
ConvLayer< vector, fvPatchField, volMesh > volVectorLayer
Definition ConvLayer.H:89
ConvLayer< scalar, fvsPatchField, surfaceMesh > surfaceScalarLayer
Definition ConvLayer.H:90
ConvLayer< scalar, fvPatchField, volMesh > volScalarLayer
Definition ConvLayer.H:88