NLMech  0.1.0
volumeCorrection.h
1 // Copyright (c) 2019 Prashant K. Jha
3 // Copyright (c) 2019 Patrick Diehl
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 
9 #ifndef GEOM_VOLUMECORRECTION_H
10 #define GEOM_VOLUMECORRECTION_H
11 
12 #include "util/point.h" // definition of Point3
13 #include <string>
14 #include <vector>
15 #include "neighbor.h"
16 #include "fe/mesh.h"
17 #include "data/DataManager.h"
18 #include "inp/decks/modelDeck.h"
19 
20 // forward declaration of class
21 namespace data {
22 class DataManager;
23 } // namespace data
24 
25 namespace inp {
26 struct ModelDeck;
27 }
28 
29 // forward declaration of class
30 namespace fe {
31 class Mesh;
32 } // namespace fe
33 
34 namespace geometry {
35 
45 
46 public:
47 
49  std::vector<double>* d_weightedVolume_p;
51  std::vector<std::vector<double>>* d_volumeCorrection_p;
52 
57  VolumeCorrection(data::DataManager* dataManager);
58 
68  std::string printStr(int nt = 0, int lvl = 0) const;
69 
77  void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
78 
79 private:
80 
89  //std:string d_type;
90  void correctVolume(const double &horizon, const double &dx,
91  geometry::Neighbor *neighbors,
92  const std::vector<util::Point3> *nodes);
93 
100  void weightedVolume(geometry::Neighbor *neighbors,
101  const std::vector<util::Point3> *nodes, fe::Mesh* p_mesh);
102 
103 };
104 
105 } // namespace geometry
106 
107 #endif //GEOM_VOLUMECORRECTION_H
Data manager to collect the global simulation data.
Definition: DataManager.h:58
A class for mesh data.
Definition: mesh.h:49
A class to store neighbor list and provide access to the list.
Definition: neighbor.h:32
A class to to compute the volume correction for state-based models.
Definition: volumeCorrection.h:44
void correctVolume(const double &horizon, const double &dx, geometry::Neighbor *neighbors, const std::vector< util::Point3 > *nodes)
Computes the volume correction for each node inside the neighborhood. Since nodes close the boundary ...
Definition: volumeCorrection.cpp:25
void weightedVolume(geometry::Neighbor *neighbors, const std::vector< util::Point3 > *nodes, fe::Mesh *p_mesh)
Computes the weighted volume with as the influence function for each discrete node.
Definition: volumeCorrection.cpp:48
std::vector< double > * d_weightedVolume_p
Weighted volume of nodes.
Definition: volumeCorrection.h:49
VolumeCorrection(data::DataManager *dataManager)
Constructor.
Definition: volumeCorrection.cpp:16
void print(int nt=0, int lvl=0) const
Prints the information about the instance of the object.
Definition: volumeCorrection.h:77
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing information about the instance of the object.
Definition: volumeCorrection.cpp:69
std::vector< std::vector< double > > * d_volumeCorrection_p
Volume correction for the neighborhood of each node.
Definition: volumeCorrection.h:51
Data mamanger to share the global simulation data between the classes.
Definition: DataManager.h:55
Collection of methods and data related to finite element and mesh.
Definition: baseElem.h:15
Collection of methods and data related to geometry.
Definition: DataManager.h:23
Collection of methods and database related to input.
Definition: main.cpp:21