www.cemf.ir
triSurfaceFieldToVTK.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #ifndef __triSurfaceFieldToVTK_hpp__
23 #define __triSurfaceFieldToVTK_hpp__
24 
25 #include <regex>
26 
27 #include "pointFieldToVTK.hpp"
28 #include "triSurface.hpp"
29 #include "multiTriSurface.hpp"
30 #include "triSurfaceFields.hpp"
31 
32 
33 namespace pFlow::TSFtoVTK
34 {
35 
37  systemControl& control,
38  const fileSystem& destPath,
39  const word& bName,
40  bool separate,
41  wordList& surfNames,
42  wordList& fileNames);
43 
44 
45 bool triSurfaceToVTK(Ostream &os,
46  const realx3 *points,
47  const uint32x3 *vertices,
48  const subSurface &subSurf);
49 
50 bool triSurfaceToVTK(Ostream &os,
51  const realx3* points,
52  const uint32x3* vertices,
53  uint32 numPoints,
54  uint32 numTris);
55 
58  const fileSystem& destPath,
59  real time,
60  const word& bName,
61  wordList& surfNames,
62  wordList& fileNames);
63 
66  const fileSystem& destPath,
67  real time,
68  const word& bName,
69  wordList& surfNames,
70  wordList& fileNames);
71 
72 inline
73 bool regexCheck(const word& TYPENAME, const word& fieldType)
74 {
75  std::regex match("triSurfaceField\\<([A-Za-z1-9_]*)\\,([A-Za-z1-9_]*)\\>");
76  std::smatch search1;
77  std::smatch search2;
78  if(!std::regex_match(fieldType, search1, match))return false;
79  if(!std::regex_match(TYPENAME, search2, match))return false;
80  if(search1.size()!=3)return false;
81  if(search1.size()!=search2.size())return false;
82  return search1[1] == search2[1];
83 }
84 
85 template<typename Type>
86 inline
87 bool checkTriFieldType(word objectType)
88 {
89  return regexCheck(triSurfaceField<Type>::TYPENAME(), objectType);
90 }
91 
93  Ostream& os,
94  const IOfileHeader& header,
95  multiTriSurface& tSurface);
96 
98  const fileSystem& destPath,
99  const IOfileHeader& header,
100  multiTriSurface& tSurface,
101  const word& bName,
102  real time);
103 
104 
105 
106 
107 }
108 
109 #endif
pFlow::List< word >
triSurfaceFields.hpp
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::TSFtoVTK::checkTriFieldType
bool checkTriFieldType(word objectType)
Definition: triSurfaceFieldToVTK.hpp:87
pointFieldToVTK.hpp
pFlow::TSFtoVTK::convertRealx3TypetriSurfaceField
bool convertRealx3TypetriSurfaceField(Ostream &os, const IOfileHeader &header, multiTriSurface &tSurface)
Definition: triSurfaceFieldToVTK.cpp:289
pFlow::TSFtoVTK::convertTimeFolderTriSurfaceFieldsSeparate
bool convertTimeFolderTriSurfaceFieldsSeparate(multiTriSurface &surface, const fileSystem &destPath, real time, const word &bName, wordList &surfNames, wordList &fileNames)
Definition: triSurfaceFieldToVTK.cpp:211
pFlow::TSFtoVTK
Definition: triSurfaceFieldToVTK.hpp:33
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:32
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
pFlow::triSurfaceField
Definition: triSurfaceField.hpp:35
multiTriSurface.hpp
pFlow::TSFtoVTK::convertTimeFolderTriSurfaceFields
bool convertTimeFolderTriSurfaceFields(systemControl &control, const fileSystem &destPath, const word &bName, bool separate, wordList &surfNames, wordList &fileNames)
Definition: triSurfaceFieldToVTK.cpp:5
pFlow::TSFtoVTK::triSurfaceToVTK
bool triSurfaceToVTK(Ostream &os, const realx3 *points, const uint32x3 *vertices, const subSurface &subSurf)
Definition: triSurfaceFieldToVTK.cpp:64
pFlow::TSFtoVTK::convertRealx3TypetriSurfaceFieldSeparate
bool convertRealx3TypetriSurfaceFieldSeparate(const fileSystem &destPath, const IOfileHeader &header, multiTriSurface &tSurface, const word &bName, real time)
Definition: triSurfaceFieldToVTK.cpp:321
pFlow::IOfileHeader
Definition: IOfileHeader.hpp:35
pFlow::TSFtoVTK::regexCheck
bool regexCheck(const word &TYPENAME, const word &fieldType)
Definition: triSurfaceFieldToVTK.hpp:73
pFlow::triple< real >
pFlow::subSurface
Definition: subSurface.hpp:27
pFlow::Ostream
Standard output stream for BINARY and ASCII formats.
Definition: Ostream.hpp:39
triSurface.hpp
pFlow::triangle::surface
INLINE_FUNCTION_HD real surface(const realx3 &p1, const realx3 &p2, const realx3 &p3)
Definition: triangleFunctions.hpp:30
pFlow::TSFtoVTK::convertTimeFolderTriSurfaceFieldsSingle
bool convertTimeFolderTriSurfaceFieldsSingle(multiTriSurface &surface, const fileSystem &destPath, real time, const word &bName, wordList &surfNames, wordList &fileNames)
Definition: triSurfaceFieldToVTK.cpp:151