PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
meshUtil.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#pragma once
12
13#include "util/point.h"
14#include "util/matrix.h"
15#include "inp/materialDeck.h"
16#include <string>
17#include <vector>
18
19namespace mesh {
20
21// forward declare Mesh
22class Mesh;
23
31void createUniformMesh(mesh::Mesh *mesh_p, size_t dim, std::pair<std::vector<double>, std::vector<double>> box, std::vector<size_t> nGrid);
32
49 const std::vector<std::vector<double>> &boxes);
50
81void getCurrentQuadPoints(const mesh::Mesh *mesh_p,
82 const std::vector<util::Point> &xRef,
83 const std::vector<util::Point> &u,
84 std::vector<util::Point> &xQuadCur,
85 size_t iNodeStart = 0,
86 size_t iQuadStart = 0,
87 size_t quadOrder = 1);
88
115void getStrainStress(const mesh::Mesh *mesh_p,
116 const std::vector<util::Point> & xRef,
117 const std::vector<util::Point> &u,
118 bool isPlaneStrain,
119 std::vector<util::SymMatrix3> &strain,
120 std::vector<util::SymMatrix3> &stress,
121 size_t iNodeStart = 0,
122 size_t iStrainStart = 0,
123 double nu = 0.,
124 double lambda = 0.,
125 double mu = 0.,
126 bool computeStress = false,
127 size_t quadOrder = 1);
128
145void getMaxShearStressAndLoc(const mesh::Mesh *mesh_p,
146 const std::vector<util::Point> & xRef,
147 const std::vector<util::Point> &u,
148 const std::vector<util::SymMatrix3> &stress,
149 double &maxShearStress,
150 util::Point &maxShearStressLocRef,
151 util::Point &maxShearStressLocCur,
152 size_t iNodeStart = 0,
153 size_t iStrainStart = 0,
154 size_t quadOrder = 1);
155
156} // namespace mesh
A class for mesh data.
Definition mesh.h:53
Collection of methods and data related to finite element and mesh.
Definition mesh.cpp:29
void getCurrentQuadPoints(const mesh::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, std::vector< util::Point > &xQuadCur, size_t iNodeStart, size_t iQuadStart, size_t quadOrder)
Get current location of quadrature points of elements in the mesh. This function expects mesh has ele...
Definition meshUtil.cpp:305
void getMaxShearStressAndLoc(const mesh::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, const std::vector< util::SymMatrix3 > &stress, double &maxShearStress, util::Point &maxShearStressLocRef, util::Point &maxShearStressLocCur, size_t iNodeStart, size_t iStrainStart, size_t quadOrder)
Get location where maximum of specified component of stress occurs in this particle.
Definition meshUtil.cpp:477
void createUniformMesh(mesh::Mesh *mesh_p, size_t dim, std::pair< std::vector< double >, std::vector< double > > box, std::vector< size_t > nGrid)
Creates uniform mesh for rectangle/cuboid domain.
Definition meshUtil.cpp:64
void getStrainStress(const mesh::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, bool isPlaneStrain, std::vector< util::SymMatrix3 > &strain, std::vector< util::SymMatrix3 > &stress, size_t iNodeStart, size_t iStrainStart, double nu, double lambda, double mu, bool computeStress, size_t quadOrder)
Strain and stress at quadrature points in the mesh.
Definition meshUtil.cpp:373
void removeNodesInBoxes(mesh::Mesh *mesh_p, const std::vector< std::vector< double > > &boxes)
Removes nodes lying inside any of the given axis-aligned boxes.
Definition meshUtil.cpp:218
A structure to represent 3d vectors.
Definition point.h:30