libsurf
Programmer's Documentation

tgrefiner.h (r6227/r5385)
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_TGREFINER_H
16 #define SURF_TGREFINER_H
17 
18 #include <genua/forward.h>
19 #include <genua/defines.h>
20 #include <genua/kdop.h>
21 #include <genua/dvector.h>
22 
33 class TgRefiner
34 {
35 public:
36 
38  TgRefiner() : m_fgrowth(1.4), m_nsiter(64), m_ndistrib(0) {}
39 
41  uint appendBox(const Vct3& plo, const Vct3 &phi, Real len);
42 
44  void configure(const ConfigParser &cfg);
45 
47  const Vector & edgeLengths(MxMesh &msh);
48 
50  void writeMetricFile(const std::string &fname) const;
51 
52 private:
53 
55  Real maxBoxedLength(const Vct3 &p) const {
56  Real len = std::numeric_limits<Real>::max();
57  const int nbox = m_boxes.size();
58  for (int i=0; i<nbox; ++i) {
59  if (m_boxes[i].inside(p.pointer()))
60  len = std::min(len, m_lbox[i]);
61  }
62  return len;
63  }
64 
65 private:
66 
68  Real m_fgrowth;
69 
71  int m_nsiter, m_ndistrib;
72 
74  Vector m_ledg;
75 
77  std::vector< Dop3d3<Real> > m_boxes;
78 
80  Vector m_lbox;
81 };
82 
83 #endif // TGREFINER_H
Real maxBoxedLength(const Vct3 &p) const
determine maximum permitted edge length due to boxes
Definition: tgrefiner.h:55
uint appendBox(const Vct3 &plo, const Vct3 &phi, Real len)
add another refinement box
Definition: tgrefiner.cpp:22
TgRefiner()
set default values
Definition: tgrefiner.h:38
Auxilliary data for tet mesh refinement using tetgen.
Definition: tgrefiner.h:33
std::vector< Dop3d3< Real > > m_boxes
refinement boxes
Definition: tgrefiner.h:77
Vector m_ledg
nodal size field to be written to .mtr file
Definition: tgrefiner.h:74
Real m_fgrowth
desired edge length growth factor
Definition: tgrefiner.h:68
void configure(const ConfigParser &cfg)
read refinement box specification from config file
Definition: tgrefiner.cpp:29
void writeMetricFile(const std::string &fname) const
write nodal edge lengths to .mtr file
Definition: tgrefiner.cpp:131
Vector m_lbox
maximum permitted edge length within boxes
Definition: tgrefiner.h:80
int m_nsiter
number of edge length smoothing iterations
Definition: tgrefiner.h:71
const Vector & edgeLengths(MxMesh &msh)
determine target edge lengths
Definition: tgrefiner.cpp:58
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5