PeriDEM 0.3.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 - 2026 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
46 std::vector<std::vector<double>> d_derShapes;
47
54 std::vector<std::vector<double>> d_J;
55
60 double d_detJ;
61
65 QuadData() : d_w(0.), d_p(util::Point()), d_detJ(0.){};
66
74 std::string printStr(int nt = 0, int lvl = 0) const {
75
76 auto tabS = util::io::getTabS(nt);
77 std::ostringstream oss;
78 oss << tabS << "------- QuadData --------" << std::endl << std::endl;
79 oss << tabS << "Weight = " << d_w << std::endl;
80 oss << tabS << "Point = " << d_p.printStr() << std::endl;
81 oss << tabS << "Shapes = " << util::io::printStr(d_shapes, 0) << std::endl;
82 oss << tabS << "Derivative = " << util::io::printStr(d_derShapes, 0)
83 << std::endl;
84 oss << tabS << "Jacobian = " << util::io::printStr(d_J, 0)
85 << std::endl;
86 oss << tabS << "Det(J) = " << d_detJ << std::endl;
87 oss << std::endl;
88
89 return oss.str();
90 };
91
98 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
99};
100
101} // namespace fe
102
103#endif // FE_QUADDATA_H
Definition baseElem.h:17
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:82
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Definition io.h:96
Collection of methods useful in simulation.
Definition constants.h:14
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
Derivatives of shape functions at the quad point.
Definition quadData.h:46
QuadData()
Constructor.
Definition quadData.h:65
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:98
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:54
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition quadData.h:74
double d_detJ
Determinant of the Jacobian of the map from reference element to the element.
Definition quadData.h:60
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