libsurf
Programmer's Documentation

hexboxpart.h (r6227/r5337)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_HEXBOXPART_H
16 #define SURF_HEXBOXPART_H
17 
18 #include "forward.h"
19 #include "topopart.h"
20 #include <genua/svector.h>
21 #include <genua/propmacro.h>
22 #include <genua/mxmeshtypes.h>
23 
32 class HexBoxPart : public TopoPart
33 {
34 public:
35 
36  enum SideType { LeftSide=0, TopSide, RightSide,
37  BottomSide, FrontSide, RearSide };
38 
40  HexBoxPart(const std::string &s);
41 
43  void rescale(Real l, Real w, Real h);
44 
46  void meshQuality(DcMeshCritBasePtr crit) {m_mcrit = crit;}
47 
49  virtual void inject(Topology &topo);
50 
52  uint faceIndex(SideType s) {
53  return m_ifaces[int(s)];
54  }
55 
57  void boco(SideType s, Mx::BocoType b) {
58  m_bctype[int(s)] = b;
59  }
60 
62  void imprint(Topology &topo, uint eix, SideType s);
63 
65  virtual void appendTo(const Topology &topo, MxMesh &mx, bool mergeBc=false);
66 
67 private:
68 
70  uint m_ifaces[6];
71 
73  uint m_ibocos[6];
74 
76  PlaneSurfacePtr m_sides[6];
77 
79  DcMeshCritBasePtr m_mcrit;
80 
82  Mx::BocoType m_bctype[6];
83 
84  GENUA_PROP(Vct3, center)
85  GENUA_PROP(Vct3, length)
86  GENUA_PROP(Vct3, width)
87  GENUA_PROP(Vct3, height)
88  GENUA_PROP(std::string, name)
89 };
90 
91 #endif // HEXBOXPART_H
virtual void inject(Topology &topo)
inject into topology
Definition: hexboxpart.cpp:40
void boco(SideType s, Mx::BocoType b)
set boundary condition on side s
Definition: hexboxpart.h:57
Base class for mesh generation components assembled from multiple surfaces.
Definition: topopart.h:30
DcMeshCritBasePtr m_mcrit
mesh quality criterion assign to all faces
Definition: hexboxpart.h:79
void rescale(Real l, Real w, Real h)
leave directions as they are, but scale
Definition: hexboxpart.cpp:33
Hexahedral box.
Definition: hexboxpart.h:32
virtual void appendTo(const Topology &topo, MxMesh &mx, bool mergeBc=false)
once topo has meshed all faces, add triangle meshes to to mx
Definition: hexboxpart.cpp:133
Container for topology information.
Definition: topology.h:30
uint m_ibocos[6]
indices of my mesh bocos in global MxMesh object
Definition: hexboxpart.h:73
uint m_ifaces[6]
indices of my TopoFaces in global Topology object
Definition: hexboxpart.h:70
void imprint(Topology &topo, uint eix, SideType s)
imprint topological edge on side s
Definition: hexboxpart.cpp:98
HexBoxPart(const std::string &s)
create a default, axis-aligned box centered at (0,0,0)
Definition: hexboxpart.cpp:25
uint faceIndex(SideType s)
access face index for side s (NotFound before initialized)
Definition: hexboxpart.h:52
Mx::BocoType m_bctype[6]
boundary conditions for the sides (default: all farfield)
Definition: hexboxpart.h:82
PlaneSurfacePtr m_sides[6]
surface objects for the 6 sides
Definition: hexboxpart.h:76
void meshQuality(DcMeshCritBasePtr crit)
set mesh quality criterion for all walls
Definition: hexboxpart.h:46
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5