NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
ConservativeSurfaceTransfer.H
Go to the documentation of this file.
1 /*******************************************************************************
2 * Promesh *
3 * Copyright (C) 2022, IllinoisRocstar LLC. All rights reserved. *
4 * *
5 * Promesh is the property of IllinoisRocstar LLC. *
6 * *
7 * IllinoisRocstar LLC *
8 * Champaign, IL *
9 * www.illinoisrocstar.com *
10 * promesh@illinoisrocstar.com *
11 *******************************************************************************/
12 /*******************************************************************************
13 * This file is part of Promesh *
14 * *
15 * This version of Promesh is free software: you can redistribute it and/or *
16 * modify it under the terms of the GNU Lesser General Public License as *
17 * published by the Free Software Foundation, either version 3 of the License, *
18 * or (at your option) any later version. *
19 * *
20 * Promesh is distributed in the hope that it will be useful, but WITHOUT ANY *
21 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more *
23 * details. *
24 * *
25 * You should have received a copy of the GNU Lesser General Public License *
26 * along with this program. If not, see <https://www.gnu.org/licenses/>. *
27 * *
28 *******************************************************************************/
29 #ifndef NEMOSYS_CONSERVATIVESURFACETRANSFER_H_
30 #define NEMOSYS_CONSERVATIVESURFACETRANSFER_H_
31 
32 #include "Transfer/TransferBase.H"
33 #include "Mesh/meshBase.H"
34 
35 class NEMOSYS_EXPORT ConservativeSurfaceTransfer : public TransferBase {
36 public:
37  ConservativeSurfaceTransfer(meshBase *_source, meshBase *_target);
38 
40  std::cout << "Conservative Surface Transfer destroyed" << std::endl;
41  }
42 
43 public:
45  meshBase *_target) {
46  return new ConservativeSurfaceTransfer(_source, _target);
47  }
48 
49  static std::shared_ptr<ConservativeSurfaceTransfer>
50  CreateShared(meshBase *_source, meshBase *_target) {
51  return std::shared_ptr<ConservativeSurfaceTransfer>(
52  ConservativeSurfaceTransfer::Create(_source, _target));
53  }
54 
55 public:
57  const std::vector<int> &arrayIDs = std::vector<int>(),
58  const std::vector<std::string> &newnames = std::vector<std::string>());
59 
60  int transferPointData(int i, vtkSmartPointer<vtkGenericCell> genCell,
61  std::vector<vtkSmartPointer<vtkDoubleArray>> &dasSource,
62  std::vector<vtkSmartPointer<vtkDoubleArray>> &dasTarget,
63  bool flip) {
64  return 0;
65  }
66 
67  int writeOverlay();
68 
69 public:
71  const std::vector<int> &arrayIDs,
72  const std::vector<std::string> &newnames = std::vector<std::string>()) {
73  return 0;
74  }
75 
77  int i, vtkSmartPointer<vtkGenericCell> genCell,
78  std::vector<vtkSmartPointer<vtkDoubleArray>> &dasSourceToPoint,
79  std::vector<vtkSmartPointer<vtkDoubleArray>> &dasTarget) {
80  return 0;
81  }
82 
83  int run(
84  const std::vector<std::string> &newnames = std::vector<std::string>()) {
85  return 0;
86  }
87 
88  void transfer(int arrayId);
89 
90 private:
91 
92  void extractDataFromVTK(vtkDataSet *data, std::vector<double> &coords,
93  std::vector<int> &elems);
94 
95  // function handles for COM (IMPACT)
96  int RFC_clear, RFC_read, RFC_write, RFC_overlay, RFC_transfer, RFC_interp;
97 
98  /*
99  vtkDataSet *sourceDataSet;
100  vtkDataSet *targetDataSet;
101 
102  // mesh data in COM format
103  std::vector<double> sourceCoords;
104  std::vector<int> sourceElems;
105 
106  std::vector<double> targetCoords;
107  std::vector<int> targetElems;
108  */
109 
110 };
111 
112 #endif // NEMOSYS_CONSERVATIVESURFACETRANSFER_H_
data_type data
Edge/face with sorted point ids (a, b, c, ...) is located at some index i in data[b], with data[b][i].first == [a, c] (for edges, third point id treated as -1).
A brief description of meshBase.
Definition: meshBase.H:64
static std::shared_ptr< ConservativeSurfaceTransfer > CreateShared(meshBase *_source, meshBase *_target)
int run(const std::vector< std::string > &newnames=std::vector< std::string >())
Transfer all fields.
int transferCellData(const std::vector< int > &arrayIDs, const std::vector< std::string > &newnames=std::vector< std::string >())
Transfer cell data with given ids from source to target.
virtual int transferPointData(const std::vector< int > &arrayIDs, const std::vector< std::string > &newnames=std::vector< std::string >())=0
Transfer point data with given ids from source to target.
static ConservativeSurfaceTransfer * Create(meshBase *_source, meshBase *_target)
int transferPointData(int i, vtkSmartPointer< vtkGenericCell > genCell, std::vector< vtkSmartPointer< vtkDoubleArray >> &dasSource, std::vector< vtkSmartPointer< vtkDoubleArray >> &dasTarget, bool flip)
int transferCellData(int i, vtkSmartPointer< vtkGenericCell > genCell, std::vector< vtkSmartPointer< vtkDoubleArray >> &dasSourceToPoint, std::vector< vtkSmartPointer< vtkDoubleArray >> &dasTarget)
std::map< std::string, std::vector< Elem > > elems
If the ELEMENT keyword line contains ELSET=name, then the element is stored in elems[name], otherwise, stored in elems[std::string{}].
Definition: inpGeoMesh.C:144