ASL  0.1.7
Advanced Simulation Library
aslLevelSet.h
Go to the documentation of this file.
1 /*
2  * Advanced Simulation Library <http://asl.org.il>
3  *
4  * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5  *
6  *
7  * This file is part of Advanced Simulation Library (ASL).
8  *
9  * ASL is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU Affero General Public License as
11  * published by the Free Software Foundation, version 3 of the License.
12  *
13  * ASL is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #ifndef ASLLEVELSET_H
25 #define ASLLEVELSET_H
26 
27 #include "aslNumMethod.h"
29 
30 
31 namespace acl{
32  class Kernel;
33  class VectorOfElementsData;
34 }
35 
36 namespace asl
37 {
38  class VectorTemplate;
39  class VTObjects;
40  template <typename V> class DataWithGhostNodes;
41  typedef DataWithGhostNodes<acl::VectorOfElementsData>
43  typedef std::shared_ptr<DataWithGhostNodesACLData>
45  typedef DataWithGhostNodes<acl::VectorOfElements>
47  typedef std::shared_ptr<DataWithGhostNodesACL>
49  class TemplateVE;
50 
52 
57  class LevelSet: public NumMethod
58  {
59  public:
63 
66  acl::VectorOfElements isBoundaryEl(unsigned int iEl);
67 
69 
72  acl::VectorOfElements isBoundaryDir(unsigned int iDir);
73 
75 
80  unsigned int iDir);
81 
83 
88  acl::VectorOfElements getBoundaryCenter(unsigned int iEl);
89 
91 
95  vector<acl::Element> gcBoundaryArea(unsigned int iEl,
96  acl::VectorOfElements & center,
97  acl::VectorOfElements & area);
98 
100 
103  vector<acl::Element> gcBoundaryArea(acl::VectorOfElements & center,
104  acl::VectorOfElements & area);
106 
110  acl::VectorOfElements getBoundaryPoint(unsigned int iDir);
111 
112  protected:
113  std::unique_ptr<acl::Kernel> kernel;
114 
117 
119  const VTObjects* vto;
120 
121  unique_ptr<TemplateVE> distanceTVE;
122  vector<acl::VectorOfElements> lVelocities;
123 
124  void initKernelPropagation();
125  virtual void initVelocityComputation()=0;
126  virtual void initDistancesComputation()=0;
127 
128  public:
129  LevelSet();
133  LevelSet(Data df);
134  ~LevelSet();
135 
136  inline const VectorTemplate* getVectorTemplate() const;
137 
138  virtual void init();
139  virtual void execute();
140  };
141 
142  typedef std::shared_ptr<LevelSet> SPLevelSet;
143 
144 // --------------------------- Implementation --------------------
145 
147  {
148  return vectorTemplate;
149  }
150 
151 } //asl
152 
153 #endif //ASLLEVELSET_H
virtual void initDistancesComputation()=0
SPDataWithGhostNodesACL DataGen
Definition: aslLevelSet.h:61
Advanced Simulation Library.
Definition: aslDataInc.h:30
Advanced Computational Language.
Definition: acl.h:40
acl::VectorOfElements getBoundaryCenter(unsigned int iEl)
generates expression for center of a boundary element
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
acl::VectorOfElements isBoundaryDir(unsigned int iDir)
generates expression resulting true if there is a boundary in this direction
Data distanceField
Definition: aslLevelSet.h:115
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
const VTObjects * vto
Definition: aslLevelSet.h:119
const VectorTemplate * vectorTemplate
Definition: aslLevelSet.h:118
acl::VectorOfElements getBoundaryPoint(unsigned int iDir)
computes coordinates of the surface point on the iDir vector
vector< acl::Element > gcBoundaryArea(unsigned int iEl, acl::VectorOfElements &center, acl::VectorOfElements &area)
generates expression for area of a boundary element
void initKernelPropagation()
Defines andditionl features related to a VectorTemplate.
Numerical method which computes evolution of an interface.
Definition: aslLevelSet.h:57
The class represents several Element.
virtual void execute()
Executes the numerical procedure.
acl::VectorOfElements getValueOnBoundary(acl::VectorOfElements field, unsigned int iDir)
generates expression resulting the value of the field
acl::VectorOfElements isBoundaryEl(unsigned int iEl)
generates expression resulting true if there is a boundary within the element
const VectorTemplate * getVectorTemplate() const
Definition: aslLevelSet.h:146
SPDataWithGhostNodesACLData Data
Definition: aslLevelSet.h:60
vector< acl::VectorOfElements > lVelocities
Definition: aslLevelSet.h:122
virtual void init()
Builds the necesery internal data and kernels.
Data distanceFieldInternalData
Definition: aslLevelSet.h:116
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
Definition: aslGenerators.h:48
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
Definition: aslGenerators.h:49
std::shared_ptr< LevelSet > SPLevelSet
Definition: aslLevelSet.h:142
Defines set of vectros with several properties.
Definition: aslTemplates.h:87
unique_ptr< TemplateVE > distanceTVE
Definition: aslLevelSet.h:121
virtual void initVelocityComputation()=0
std::unique_ptr< acl::Kernel > kernel
Definition: aslLevelSet.h:113