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.
Refine.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_REFINE_H_
30 #define NEMOSYS_REFINE_H_
31 
32 #include <string>
33 
34 #include <MAdLib.h>
35 
36 #include "nemosys_export.h"
37 #include "Mesh/meshBase.H"
38 
39 namespace NEM {
40 namespace ADP {
41 
42 class NEMOSYS_EXPORT Refine {
43  // constructors and destructors
44  public:
45  Refine(meshBase *_mesh, const std::string &method, int arrayID,
46  double dev_mult, bool maxIsmin, double edge_scale,
47  const std::string &_ofname, double sizeFactor = 1.0, int order = 1);
48  ~Refine();
49 
50  // methods
51  public:
52  void run(bool transferData, bool bndryConstraint = false);
53 
54  private:
55  meshBase *mesh; // mesh to be refined
56  MAd::pMesh MadMesh; // MAdLib mesh object generated from converted meshBase
57  MAd::BackgroundSF *bSF; // background sizeField
58  MAd::PWLSField *pwlSF; // piecewise linear size field
59  MAd::MeshAdapter *adapter; // adapter
60  std::string ofname;
61  MAd::pGEntity bnd;
62  bool bndrConst;
63 
64  // helpers
65  private:
66  void initUniform(double edge_scale);
67  void initAdaptive(int arrayID, const std::string &method);
68 
69  void classifyBoundaries();
70  void unClassifyBoundaries();
71 };
72 
73 } // namespace ADP
74 } // namespace NEM
75 
76 #endif // NEMOSYS_REFINE_H_
A brief description of meshBase.
Definition: meshBase.H:64
MAd::pMesh MadMesh
Definition: Refine.H:56
MAd::pGEntity bnd
Definition: Refine.H:61
std::string ofname
Definition: Refine.H:60
bool bndrConst
Definition: Refine.H:62
MAd::MeshAdapter * adapter
Definition: Refine.H:59
MAd::BackgroundSF * bSF
Definition: Refine.H:57
meshBase * mesh
Definition: Refine.H:55
MAd::PWLSField * pwlSF
Definition: Refine.H:58