hemocell
Loading...
Searching...
No Matches
meshGeneratingFunctions.h
Go to the documentation of this file.
1/*
2This file is part of the HemoCell library
3
4HemoCell is developed and maintained by the Computational Science Lab
5in the University of Amsterdam. Any questions or remarks regarding this library
6can be sent to: info@hemocell.eu
7
8When using the HemoCell library in scientific work please cite the
9corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11The HemoCell library is free software: you can redistribute it and/or
12modify it under the terms of the GNU Affero General Public License as
13published by the Free Software Foundation, either version 3 of the
14License, or (at your option) any later version.
15
16The library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Affero General Public License for more details.
20
21You should have received a copy of the GNU Affero General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>.
23*/
24#ifndef MESH_GENERATING_FUNCTIONS_H
25#define MESH_GENERATING_FUNCTIONS_H
26
27#include "constant_defaults.h"
28#include "config.h"
29
30#include "offLattice/triangleSet.hh"
31#include "offLattice/triangleToDef.hh"
32#include "offLattice/triangleSetGenerator.hh"
33#include "offLattice/triangularSurfaceMesh.hh"
34#include "offLattice/triangleBoundary3D.hh"
35
36namespace plb {
37
38template<typename T>
39TriangleSet<T> constructCell(plb::Array<T,3> const& center, T radius, std::string cellFilename, plb::Array<T,3> const& eulerAngles);
40
41
42template<typename T>
43TriangleSet<T> constructSphereIcosahedron(plb::Array<T,3> const& center, T radius, plint minNumOfTriangles);
44
45
46template<typename T>
47plb::Array<T,3> mapMeshAsRBC(const plb::Array<T,3> point, const plb::Array<T,3> center, T R) ;
48
49
50template<typename T>
51plb::Array<T,3> spherePointToRBCPoint(const plb::Array<T,3> point, T R=1.0);
52
53
54template<typename T>
55TriangleSet<T> constructRBC(plb::Array<T,3> const& center, T radius, plint minNumOfTriangles, plb::Array<T,3> const& eulerAngles);
56
57
58// initialSphereShape: [0] Octahedron (PLB Sphere ) [1] Icosahedron
59template<typename T>
60TriangleSet<T> constructRBCFromSphere(plb::Array<T,3> const& center, T radius, plint minNumOfTriangles,
61 plb::Array<T,3> const& eulerAngles, pluint initialSphereShape=0);
62
63template<typename T>
64TriangleSet<T> constructEllipsoidFromSphere(plb::Array<T,3> const& center, T radius, T aspectRatio, plint minNumOfTriangles,
65 plb::Array<T,3> const& eulerAngles, pluint initialSphereShape);
66
67
68template<typename T>
69TriangleBoundary3D<T> constructMeshElement(plint shape, T radius, plint cellNumTriangles, T dx, std::string cellPath, plb::Array<T,3> const& eulerAngles, T aspectRatio=0.3) {
70 plb::Array<T,3> center({0.0, 0.0, 0.0});
71 std::vector<TriangleSet<T> > allTriangles;
72 TriangleSet<T> wholeTriangleSet;
73 if (shape == 0) {
74 wholeTriangleSet.append(constructSphereIcosahedron<T>(center, radius, cellNumTriangles));
75 } else if (shape == 1) {
76 wholeTriangleSet.append(constructRBCFromSphere<T>(center, radius, cellNumTriangles, eulerAngles, 1));
77 } else if (shape == 2) {
78 wholeTriangleSet.append(constructCell<T>(center, radius, cellPath, eulerAngles));
79 } else if (shape == 3) {
80 wholeTriangleSet.append(constructRBC<T>(center, radius, cellNumTriangles, eulerAngles));
81 } else if (shape == 4) {
82 wholeTriangleSet.append(constructRBCFromSphere<T>(center, radius, cellNumTriangles, eulerAngles, 0));
83 } else if (shape == 5) {
84 wholeTriangleSet.append(constructSphere<T>(center, radius, cellNumTriangles));
85 } else if (shape == 6) {
86 wholeTriangleSet.append(constructEllipsoidFromSphere<T>(center, radius, aspectRatio, cellNumTriangles, eulerAngles, 0));
87 }
88 /* Unknown code, was there from the beginning, let it be */
89 DEFscaledMesh<T> defMesh (wholeTriangleSet);
90 defMesh.setDx(dx);
91 TriangleBoundary3D<T> Cells(defMesh);
92 Cells.getMesh().inflate();
93 return Cells;
94}
95
96
97} // namespace plb
98
99plb::TriangularSurfaceMesh<T> * constructStringMeshFromConfig(hemo::Config & materialCfg);
100
102
103#endif // MESH_GENERATING_FUNCTIONS_H
Definition config.h:58
double T
Definition constant_defaults.h:118
long int plint
Definition constant_defaults.h:127
long unsigned int pluint
Definition constant_defaults.h:130
plb::TriangularSurfaceMesh< T > * constructStringMeshFromConfig(hemo::Config &materialCfg)
Definition meshGeneratingFunctions.cpp:28
plb::Array< T, 3 > mapMeshAsRBC(const plb::Array< T, 3 > point, const plb::Array< T, 3 > center, T R)
Definition meshGeneratingFunctions.hh:186
TriangleSet< T > constructCell(plb::Array< T, 3 > const &center, T radius, std::string cellFilename, plb::Array< T, 3 > const &eulerAngles)
Definition meshGeneratingFunctions.hh:275
plb::Array< T, 3 > spherePointToRBCPoint(const plb::Array< T, 3 > point, T R=1.0)
Definition meshGeneratingFunctions.hh:154
TriangleBoundary3D< T > constructMeshElement(plint shape, T radius, plint cellNumTriangles, T dx, std::string cellPath, plb::Array< T, 3 > const &eulerAngles, T aspectRatio=0.3)
Definition meshGeneratingFunctions.h:69
TriangleSet< T > constructRBCFromSphere(plb::Array< T, 3 > const &center, T radius, plint minNumOfTriangles, plb::Array< T, 3 > const &eulerAngles, pluint initialSphereShape=0)
Definition meshGeneratingFunctions.hh:214
TriangleSet< T > constructRBC(plb::Array< T, 3 > const &center, T radius, plint minNumOfTriangles, plb::Array< T, 3 > const &eulerAngles)
Definition meshGeneratingFunctions.hh:208
TriangleSet< T > constructEllipsoidFromSphere(plb::Array< T, 3 > const &center, T radius, T aspectRatio, plint minNumOfTriangles, plb::Array< T, 3 > const &eulerAngles, pluint initialSphereShape)
Definition meshGeneratingFunctions.hh:245
TriangleSet< T > constructSphereIcosahedron(plb::Array< T, 3 > const &center, T radius, plint minNumOfTriangles)
Definition meshGeneratingFunctions.hh:32