PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
fracture.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 GEOM_FRACTURE_H
12#define GEOM_FRACTURE_H
13
14#include "util/point.h" // definition of Point
15#include <cstdint> // uint8_t type
16#include <cstring> // string and size_t type
17#include <vector>
18
20namespace geometry {
21
26class Fracture {
27
28public:
38 Fracture(const std::vector<util::Point> *nodes,
39 const std::vector<std::vector<std::size_t>> *neighbor_list = nullptr);
40
44 Fracture();
45
53 void setBondState(const std::size_t &i, const std::size_t &j, const bool &state);
54
62 bool getBondState(const std::size_t &i, const std::size_t &j) const;
63
70 const std::vector<uint8_t> &getBonds(const std::size_t &i) const;
71
73 std::vector<uint8_t> &getBonds(const std::size_t &i);
74
82 std::string printStr(int nt = 0, int lvl = 0) const;
83
90 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
91
92private:
93
101 std::vector<std::vector<uint8_t>> d_fracture;
102};
103
104} // namespace geometry
105
106#endif // GEOM_FRACTURE_H
A class for fracture state of bonds.
Definition fracture.h:26
void setBondState(const std::size_t &i, const std::size_t &j, const bool &state)
Sets the bond state.
Definition fracture.cpp:51
const std::vector< uint8_t > & getBonds(const std::size_t &i) const
Returns the list of bonds of node i.
Definition fracture.cpp:70
Fracture()
Constructor.
Definition fracture.cpp:18
bool getBondState(const std::size_t &i, const std::size_t &j) const
Read bond state.
Definition fracture.cpp:64
void print(int nt=0, int lvl=0) const
Prints the information about the object.
Definition fracture.h:90
std::vector< std::vector< uint8_t > > d_fracture
Vector which stores the state of bonds.
Definition fracture.h:101
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition fracture.cpp:78
Collection of methods and data related to geometry.
Definition fracture.h:20