PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
quadData.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#ifndef FE_QUADDATA_H
12#define FE_QUADDATA_H
13
14#include <util/io.h>
15#include <util/point.h> // definition of Point
16#include <vector>
17
18namespace fe {
19
23struct QuadData {
24
26 double d_w;
27
30
37 std::vector<double> d_shapes;
38
50 std::vector<std::vector<double>> d_derShapes;
51
58 std::vector<std::vector<double>> d_J;
59
64 double d_detJ;
65
69 QuadData() : d_w(0.), d_p(util::Point()), d_detJ(0.){};
70
78 std::string printStr(int nt = 0, int lvl = 0) const {
79
80 auto tabS = util::io::getTabS(nt);
81 std::ostringstream oss;
82 oss << tabS << "------- QuadData --------" << std::endl << std::endl;
83 oss << tabS << "Weight = " << d_w << std::endl;
84 oss << tabS << "Point = " << d_p.printStr() << std::endl;
85 oss << tabS << "Shapes = " << util::io::printStr(d_shapes, 0) << std::endl;
86 oss << tabS << "Derivative = " << util::io::printStr(d_derShapes, 0)
87 << std::endl;
88 oss << tabS << "Jacobian = " << util::io::printStr(d_J, 0)
89 << std::endl;
90 oss << tabS << "Det(J) = " << d_detJ << std::endl;
91 oss << std::endl;
92
93 return oss.str();
94 };
95
102 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
103};
104
105} // namespace fe
106
107#endif // FE_QUADDATA_H
Collection of methods and data related to finite element and mesh.
Definition baseElem.h:17
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Definition io.h:54
Collection of methods useful in simulation.
A struct to store the quadrature data. List of data are.
Definition quadData.h:23
std::vector< double > d_shapes
Value of shape functions at quad point p.
Definition quadData.h:37
std::vector< std::vector< double > > d_derShapes
Value of derivative of shape functions at quad point p.
Definition quadData.h:50
QuadData()
Constructor.
Definition quadData.h:69
double d_w
Quadrature weight.
Definition quadData.h:26
void print(int nt=0, int lvl=0) const
Prints the information about the object.
Definition quadData.h:102
util::Point d_p
Quadrature point in 1-d, 2-d or 3-d.
Definition quadData.h:29
std::vector< std::vector< double > > d_J
Jacobian of the map from reference element to the element.
Definition quadData.h:58
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition quadData.h:78
double d_detJ
Determinant of the Jacobian of the map from reference element to the element.
Definition quadData.h:64
A structure to represent 3d vectors.
Definition point.h:30
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition point.h:94