NLMech  0.1.0
quadData.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 FE_QUADDATA_H
10 #define FE_QUADDATA_H
11 
12 #include <util/point.h> // definition of Point3
13 #include <util/utilIO.h>
14 #include <vector>
15 
16 namespace fe {
17 
21 struct QuadData {
22 
24  double d_w;
25 
28 
35  std::vector<double> d_shapes;
36 
48  std::vector<std::vector<double>> d_derShapes;
49 
56  std::vector<std::vector<double>> d_J;
57 
62  double d_detJ;
63 
67  QuadData() : d_w(0.), d_p(util::Point3()), d_detJ(0.){};
68 
69 
77  std::string printStr(int nt = 0, int lvl = 0) const {
78 
79  auto tabS = util::io::getTabS(nt);
80  std::ostringstream oss;
81  oss << tabS << "------- QuadData --------" << std::endl << std::endl;
82  oss << tabS << "Weight = " << d_w << std::endl;
83  oss << tabS << "Point = " << d_p.printStr() << std::endl;
84  oss << tabS << "Shapes = " << util::io::printStr(d_shapes, 0) << std::endl;
85  oss << tabS << "Derivative = " << util::io::printStr(d_derShapes, 0)
86  << std::endl;
87  oss << tabS << "Jacobian = " << util::io::printStr(d_J, 0)
88  << std::endl;
89  oss << tabS << "Det(J) = " << d_detJ << std::endl;
90  oss << std::endl;
91 
92  return oss.str();
93  };
94 
101  void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
102 };
103 
104 } // namespace fe
105 
106 #endif // FE_QUADDATA_H
Collection of methods and data related to finite element and mesh.
Definition: baseElem.h:15
std::string printStr(const std::vector< T > &list, int nt=0)
Concatenates the elements of the vector separated with a comma.
Definition: utilIO.h:40
std::string getTabS(int nt)
Generate a string contaning nt tabs.
Definition: utilIO.h:26
Collection of methods useful in simulation.
Definition: DataManager.h:50
A struct to store the quadrature data. List of data are.
Definition: quadData.h:21
std::vector< double > d_shapes
Value of shape functions at quad point p.
Definition: quadData.h:35
std::vector< std::vector< double > > d_derShapes
Value of derivative of shape functions at quad point p.
Definition: quadData.h:48
QuadData()
Constructor.
Definition: quadData.h:67
double d_w
Quadrature weight.
Definition: quadData.h:24
void print(int nt=0, int lvl=0) const
Prints the information.
Definition: quadData.h:101
std::vector< std::vector< double > > d_J
Jacobian of the map from reference element to the element.
Definition: quadData.h:56
util::Point3 d_p
Quadrature point in 1-d, 2-d or 3-d.
Definition: quadData.h:27
std::string printStr(int nt=0, int lvl=0) const
Prints the information.
Definition: quadData.h:77
double d_detJ
Determinant of the Jacobian of the map from reference element to the element.
Definition: quadData.h:62
A structure to represent 3d vectors.
Definition: point.h:29
std::string printStr(int nt=0, int lvl=0) const
Prints the information.
Definition: point.h:94