PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
material.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 MATERIAL_PARTILCE_MATERIAL_H
12#define MATERIAL_PARTILCE_MATERIAL_H
13
14#include "influenceFn.h"
16#include "util/function.h"
17#include "util/point.h" // definition of Point
18#include <limits>
19#include <memory>
20#include <string>
21#include <vector>
22
23namespace {
24
26size_t dimension = 0;
27
29bool is_plane_strain = false;
30
32std::shared_ptr<material::BaseInfluenceFn> influence_fn;
33
40double getGlobalInfFn(const double &r) {
41 return influence_fn->getInfFn(r);
42}
43
53double getGlobalMoment(const size_t &i) {return influence_fn->getMoment(i);}
54}
55
56namespace material {
57
76class Material {
77
78public:
83 explicit Material(std::string name = "") : d_name(name) {}
84
90 virtual ~Material() {}
91
96 std::string name() { return d_name; }
97
102 size_t getDimension() { return dimension; }
103
108 bool isPlaneStrain() { return is_plane_strain; }
109
114 virtual bool isStateActive() const = 0;
115
125 virtual std::pair<double, double>
126 getBondEF(const double &r, const double &s, bool &fs,
127 const bool &break_bonds) const = 0;
128
139 virtual std::pair<double, double>
140 getBondEF(const double &r, const double &s, bool &fs, const double
141 &mx, const double &thetax) const = 0;
142
151 const util::Point &du) const = 0;
152
159 virtual double getS(const util::Point &dx, const util::Point &du) const = 0;
160
167 virtual double getSc(const double &r) const = 0;
168
173 virtual double getDensity() const = 0;
174
181 virtual double getInfFn(const double &r) const = 0;
182
192 virtual double getMoment(const size_t &i) const = 0;
193
199 virtual double getHorizon() const = 0;
200
208 virtual inp::MatData computeMaterialProperties(const size_t &dim) const = 0;
209
217 virtual std::string printStr(int nt, int lvl) const {
218
219 auto tabS = util::io::getTabS(nt);
220 std::ostringstream oss;
221 oss << tabS << "------- particle::Material --------" << std::endl
222 << std::endl;
223 oss << tabS << "Abstract class of peridynamic materials" << std::endl;
224 oss << tabS << "See RnpMaterial and PmbMaterial for implementation"
225 << std::endl;
226 oss << tabS << std::endl;
227
228 return oss.str();
229 }
230
237 virtual void print(int nt, int lvl) const { std::cout << printStr(nt, lvl); }
238
240 virtual void print() const { print(0, 0); }
241
242private:
244 std::string d_name;
245};
246
251class RnpMaterial : public Material {
252
253public:
260 RnpMaterial(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
261 : Material("RNPBond"), d_horizon(horizon), d_density(deck.d_density),
262 d_C(0.), d_beta(0.), d_rbar(0.), d_invFactor(0.),
263 d_factorSc(deck.d_checkScFactor),
264 d_irrevBondBreak(deck.d_irreversibleBondBreak) {
265
266 // set global fields
267 if (dimension != dim)
268 dimension = dim;
269
270 if (is_plane_strain != deck.d_isPlaneStrain)
271 is_plane_strain = deck.d_isPlaneStrain;
272
273 // create influence function
274 if (deck.d_influenceFnType == 0) {
275 if (influence_fn == nullptr)
276 influence_fn = std::make_shared<material::ConstInfluenceFn>(
277 deck.d_influenceFnParams, dim);
278 }
279 else if (deck.d_influenceFnType == 1) {
280 if (influence_fn == nullptr)
281 influence_fn = std::make_shared<material::LinearInfluenceFn>(
282 deck.d_influenceFnParams, dim);
283 }
284 else if (deck.d_influenceFnType == 2) {
285 if (influence_fn == nullptr)
286 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
287 deck.d_influenceFnParams, dim);
288 }
289 else {
290 std::cerr << "Error: Influence function type = "
291 << deck.d_influenceFnType
292 << " is invalid.\n";
293 exit(1);
294 }
295
296 if (dim == 1)
297 d_invFactor = std::pow(horizon, 2) * 2.;
298 else if (dim == 2)
299 d_invFactor = std::pow(horizon, 3) * M_PI;
300 else if (dim == 3)
301 d_invFactor = std::pow(horizon, 4) * 4. * M_PI / 3.;
302
303 // check if we need to compute the material parameters
305 computeParameters(deck, dim);
306 else {
307 d_C = deck.d_bondPotentialParams[0];
309 d_rbar = std::sqrt(0.5 / d_beta);
310 }
311 };
312
314 bool isStateActive() const override { return false; };
315
342 std::pair<double, double> getBondEF(const double &r, const double &s,
343 bool &fs,
344 const bool &break_bonds) const override {
345
346 if (break_bonds) {
347 // check if fracture state of the bond need to be updated
348 if (d_irrevBondBreak && !fs &&
349 util::isGreater(std::abs(s), d_factorSc * getSc(r)))
350 fs = true;
351
352 // if bond is not fractured, return energy and force from nonlinear
353 // potential otherwise return energy of fractured bond, and zero force
354 if (!fs)
355 return std::make_pair(
356 getInfFn(r) * d_C *
357 (1. - std::exp(-d_beta * r * s * s)) / d_invFactor,
358 getInfFn(r) * 4. * s * d_C * d_beta *
359 std::exp(-d_beta * r * s * s) / d_invFactor);
360 else
361 return std::make_pair(d_C / d_invFactor, 0.);
362 } else {
363 return std::make_pair(getInfFn(r) * d_C * d_beta *
364 r * s * s / d_invFactor,
365 getInfFn(r) * 4. * s * d_C *
367 }
368 };
369
380 std::pair<double, double>
381 getBondEF(const double &r, const double &s, bool &fs, const double
382 &mx, const double &thetax) const override {
383
384 return this->getBondEF(r, s, fs, true);
385 };
386
395 const util::Point &du) const override {
396 return dx / dx.length();
397 };
398
405 double getS(const util::Point &dx, const util::Point &du) const override {
406 return dx.dot(du) / dx.dot(dx);
407 };
408
415 double getSc(const double &r) const override {
416 return d_rbar / std::sqrt(r);
417 };
418
423 double getDensity() const override { return d_density; };
424
431 double getInfFn(const double &r) const override {
432 return getGlobalInfFn(r / d_horizon);
433 };
434
444 double getMoment(const size_t &i) const override {
445 return getGlobalMoment(i);
446 };
447
452 double getHorizon() const override { return d_horizon; };
453
461 inp::MatData computeMaterialProperties(const size_t &dim) const override {
462
463 auto data = inp::MatData();
464
465 // set Poisson's ratio to 1/4
466 data.d_nu = 0.25;
467
468 // get moment of influence function
469 double M = getMoment(dim);
470
471 // compute peridynamic parameters
472 if (dim == 2) {
473 data.d_Gc = 4. * M * d_C / M_PI;
474 data.d_lambda = d_C * M * d_beta / 4.;
475 } else if (dim == 3) {
476 data.d_Gc = 3. * M * d_C / 2.;
477 data.d_lambda = d_C * M * d_beta / 5.;
478 }
479 data.d_mu = data.d_lambda;
480 data.d_G = data.d_lambda;
481 data.d_E = data.toELambda(data.d_lambda,
482 data.d_nu);
483 data.d_K =
484 data.toK(data.d_E, data.d_nu);
485 data.d_KIc = data.toKIc(
486 data.d_Gc, data.d_nu, data.d_E);
487
488 return data;
489 };
490
498 std::string printStr(int nt, int lvl) const override {
499
500 auto tabS = util::io::getTabS(nt);
501 std::ostringstream oss;
502 oss << tabS << "------- particle::RnpMaterial --------" << std::endl
503 << std::endl;
504 oss << tabS << "State active = " << 0 << std::endl;
505 oss << tabS << "Horizon = " << d_horizon << std::endl;
506 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
507 oss << tabS << "Influence fn info: " << std::endl;
508 oss << influence_fn->printStr(nt + 1, lvl);
509 oss << tabS << "Peridynamic parameters: " << std::endl;
510 oss << tabS << " C = " << d_C << std::endl;
511 oss << tabS << " beta = " << d_beta << std::endl;
512 oss << tabS << " r_bar = " << d_rbar << std::endl;
513 oss << tabS << " inv_factor = " << d_invFactor << std::endl;
514 oss << tabS << " factor_Sc = " << d_factorSc << std::endl;
515 oss << tabS << " irrev_bond_breaking = " << d_irrevBondBreak << std::endl;
516 oss << tabS << std::endl;
517
518 return oss.str();
519 }
520
527 void print(int nt, int lvl) const override {
528 std::cout << printStr(nt, lvl);
529 }
530
532 void print() const override { print(0, 0); }
533
534private:
541 void computeParameters(inp::MaterialDeck &deck, const size_t &dim) {
542 //
543 // Need following elastic and fracture properties
544 // 1. E or K
545 // 2. Gc or KIc
546 // For bond-based, Poisson's ratio is fixed to 1/4
547 //
548 if (util::isLess(deck.d_matData.d_E, 0.) &&
549 util::isLess(deck.d_matData.d_K, 0.)) {
550 std::cerr << "Error: Require either Young's modulus E or Bulk modulus K"
551 " to compute the RNP bond-based peridynamic parameters.\n";
552 exit(1);
553 }
554 if (util::isGreater(deck.d_matData.d_E, 0.) &&
555 util::isGreater(deck.d_matData.d_K, 0.)) {
556 std::cout << "Warning: Both Young's modulus E and Bulk modulus K are "
557 "provided.\n";
558 std::cout << "Warning: To compute the RNP bond-based peridynamic "
559 "parameters, we only require one of those.\n";
560 std::cout
561 << "Warning: Selecting Young's modulus to compute parameters.\n";
562 }
563
564 if (util::isLess(deck.d_matData.d_Gc, 0.) &&
565 util::isLess(deck.d_matData.d_KIc, 0.)) {
566 std::cerr << "Error: Require either critical energy release rate Gc or "
567 "critical stress intensity factor KIc to compute the RNP "
568 "bond-based peridynamic parameters.\n";
569 exit(1);
570 } else if (util::isGreater(deck.d_matData.d_Gc, 0.) &&
571 util::isGreater(deck.d_matData.d_KIc, 0.)) {
572 std::cout << "Warning: Both critical energy release rate Gc and critical "
573 "stress intensity factor KIc are provided.\n";
574 std::cout << "Warning: To compute the RNP bond-based peridynamic "
575 "parameters, we only require one of those.\n";
576 std::cout << "Warning: Selecting critical energy release rate Gc to "
577 "compute parameters.\n";
578 }
579
580 // set Poisson's ratio to 1/4
581 deck.d_matData.d_nu = 0.25;
582
583 // compute E if not provided or K if not provided
584 if (deck.d_matData.d_E > 0.)
585 deck.d_matData.d_K =
586 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
587
588 if (deck.d_matData.d_K > 0. && deck.d_matData.d_E < 0.)
589 deck.d_matData.d_E =
590 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
591
592 if (deck.d_matData.d_Gc > 0.)
593 deck.d_matData.d_KIc = deck.d_matData.toKIc(
594 deck.d_matData.d_Gc, deck.d_matData.d_nu, deck.d_matData.d_E);
595
596 if (deck.d_matData.d_KIc > 0. && deck.d_matData.d_Gc < 0.)
597 deck.d_matData.d_Gc = deck.d_matData.toGc(
598 deck.d_matData.d_KIc, deck.d_matData.d_nu, deck.d_matData.d_E);
599
600 // compute lame parameter
601 deck.d_matData.d_lambda =
603 deck.d_matData.d_G =
604 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
605 deck.d_matData.d_mu = deck.d_matData.d_G;
606
607 // get moment of influence function
608 double M = getMoment(dim);
609
610 // compute peridynamic parameters
611 if (dim == 2) {
612 d_C = M_PI * deck.d_matData.d_Gc / (4. * M);
613 d_beta = 4. * deck.d_matData.d_lambda / (d_C * M);
614 } else if (dim == 3) {
615 d_C = 2. * deck.d_matData.d_Gc / (3. * M);
616 d_beta = 5. * deck.d_matData.d_lambda / (d_C * M);
617 }
618
619 d_rbar = std::sqrt(0.5 / d_beta);
620 };
621
622private:
623
625 double d_horizon;
626
628 double d_density;
629
636 double d_C;
637
639 double d_beta;
640
644 double d_rbar;
645
648
656
659};
660
665class PmbMaterial : public Material {
666
667public:
674 PmbMaterial(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
675 : Material("PMBBond"), d_horizon(horizon), d_density(deck.d_density),
676 d_c(0.), d_s0(0.) {
677
678 // set global fields
679 if (dimension != dim)
680 dimension = dim;
681
682 if (is_plane_strain != deck.d_isPlaneStrain)
683 is_plane_strain = deck.d_isPlaneStrain;
684
685 // create influence function
686 if (deck.d_influenceFnType == 0) {
687 if (influence_fn == nullptr)
688 influence_fn = std::make_shared<material::ConstInfluenceFn>(
689 deck.d_influenceFnParams, dim);
690 }
691 else if (deck.d_influenceFnType == 1) {
692 if (influence_fn == nullptr)
693 influence_fn = std::make_shared<material::LinearInfluenceFn>(
694 deck.d_influenceFnParams, dim);
695 }
696 else if (deck.d_influenceFnType == 2) {
697 if (influence_fn == nullptr)
698 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
699 deck.d_influenceFnParams, dim);
700 }
701 else {
702 std::cerr << "Error: Influence function type = "
703 << deck.d_influenceFnType
704 << " is invalid.\n";
705 exit(1);
706 }
707
708 // check if we need to compute the material parameters
710 computeParameters(deck, dim);
711 else {
712 d_c = deck.d_bondPotentialParams[0];
713 d_s0 = deck.d_bondPotentialParams[1];
714 }
715 };
716
721 bool isStateActive() const override { return false; };
722
732 std::pair<double, double> getBondEF(const double &r, const double &s,
733 bool &fs,
734 const bool &break_bonds) const override {
735
736 if (!break_bonds)
737 return std::make_pair(getInfFn(r) * 0.5 * d_c * s *
738 s * r,
739 getInfFn(r) * d_c * s);
740
741 // check if fracture state of the bond need to be updated
742 if (!fs && util::isGreater(std::abs(s), d_s0 + 1.0e-10))
743 fs = true;
744
745 // if bond is not fractured, return energy and force from nonlinear
746 // potential otherwise return energy of fractured bond, and zero force
747 if (!fs)
748 return std::make_pair(getInfFn(r) * 0.5 * d_c * s *
749 s * r,
750 getInfFn(r) * d_c * s);
751 else
752 return std::make_pair(
753 getInfFn(r) * 0.5 * d_c * d_s0 * d_s0 * r, 0.);
754 };
755
766 std::pair<double, double>
767 getBondEF(const double &r, const double &s, bool &fs, const double
768 &mx, const double &thetax) const override {
769
770 return this->getBondEF(r, s, fs, true);
771 };
772
781 const util::Point &du) const override {
782 return (dx + du) / (dx + du).length();
783 };
784
791 double getS(const util::Point &dx, const util::Point &du) const override {
792 return ((dx + du).length() - dx.length()) / dx.length();
793 };
794
801 double getSc(const double &r) const override { return d_s0; };
802
807 double getDensity() const override { return d_density; };
808
815 double getInfFn(const double &r) const override {
816 return getGlobalInfFn(r / d_horizon);
817 };
818
828 double getMoment(const size_t &i) const override {
829 return getGlobalMoment(i);
830 };
831
837 double getHorizon() const override { return d_horizon; };
838
846 inp::MatData computeMaterialProperties(const size_t &dim) const override {
847
848 auto data = inp::MatData();
849
850 // set Poisson's ratio to 1/4
851 data.d_nu = 0.25;
852
853 // compute peridynamic parameters
854 if (dim == 2) {
855 data.d_lambda = d_c * (M_PI * std::pow(d_horizon, 3.0)) / 24.0;
856 data.d_E = data.toELambda(data.d_lambda, data.d_nu);
857 data.d_Gc = d_s0 * d_s0 * (9.0 * data.d_E * d_horizon) / (5.0 * M_PI);
858 } else if (dim == 3) {
859 data.d_lambda = d_c * (M_PI * std::pow(d_horizon, 3.0)) / 24.0;
860 data.d_E = data.toELambda(data.d_lambda, data.d_nu);
861 data.d_Gc = d_s0 * d_s0 * (9.0 * data.d_E * d_horizon) / (5.0 * M_PI);
862 }
863 data.d_mu = data.d_lambda;
864 data.d_G = data.d_lambda;
865 data.d_K =
866 data.toK(data.d_E, data.d_nu);
867 data.d_KIc = data.toKIc(
868 data.d_Gc, data.d_nu, data.d_E);
869
870 return data;
871 };
872
880 std::string printStr(int nt, int lvl) const override {
881
882 auto tabS = util::io::getTabS(nt);
883 std::ostringstream oss;
884 oss << tabS << "------- particle::PmbMaterial --------" << std::endl
885 << std::endl;
886 oss << tabS << "State active = " << 0 << std::endl;
887 oss << tabS << "Horizon = " << d_horizon << std::endl;
888 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
889 oss << tabS << "Influence fn info: " << std::endl;
890 oss << influence_fn->printStr(nt + 1, lvl);
891 oss << tabS << "Peridynamic parameters: " << std::endl;
892 oss << tabS << " c = " << d_c << std::endl;
893 oss << tabS << " s0 = " << d_s0 << std::endl;
894 oss << tabS << std::endl;
895
896 return oss.str();
897 };
898
905 void print(int nt, int lvl) const override {
906 std::cout << printStr(nt, lvl);
907 };
908
910 void print() const override { print(0, 0); };
911
912private:
919 void computeParameters(inp::MaterialDeck &deck, const size_t &dim) {
920 //
921 // Need following elastic and fracture properties
922 // 1. E or K
923 // 2. Gc or KIc
924 // For bond-based, Poisson's ratio is fixed to 1/4
925 //
926 if (util::isLess(deck.d_matData.d_E, 0.) &&
927 util::isLess(deck.d_matData.d_K, 0.)) {
928 std::cerr << "Error: Require either Young's modulus E or Bulk modulus K"
929 " to compute the RNP bond-based peridynamic parameters.\n";
930 exit(1);
931 }
932 if (util::isGreater(deck.d_matData.d_E, 0.) &&
933 util::isGreater(deck.d_matData.d_K, 0.)) {
934 std::cout << "Warning: Both Young's modulus E and Bulk modulus K are "
935 "provided.\n";
936 std::cout << "Warning: To compute the RNP bond-based peridynamic "
937 "parameters, we only require one of those.\n";
938 std::cout
939 << "Warning: Selecting Young's modulus to compute parameters.\n";
940 }
941
942 if (util::isLess(deck.d_matData.d_Gc, 0.) &&
943 util::isLess(deck.d_matData.d_KIc, 0.)) {
944 std::cerr << "Error: Require either critical energy release rate Gc or "
945 "critical stress intensity factor KIc to compute the RNP "
946 "bond-based peridynamic parameters.\n";
947 exit(1);
948 } else if (util::isGreater(deck.d_matData.d_Gc, 0.) &&
949 util::isGreater(deck.d_matData.d_KIc, 0.)) {
950 std::cout << "Warning: Both critical energy release rate Gc and critical "
951 "stress intensity factor KIc are provided.\n";
952 std::cout << "Warning: To compute the RNP bond-based peridynamic "
953 "parameters, we only require one of those.\n";
954 std::cout << "Warning: Selecting critical energy release rate Gc to "
955 "compute parameters.\n";
956 }
957
958 // set Poisson's ratio to 1/4
959 deck.d_matData.d_nu = 0.25;
960
961 // compute E if not provided or K if not provided
962 if (deck.d_matData.d_E > 0.)
963 deck.d_matData.d_K =
964 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
965
966 if (deck.d_matData.d_K > 0. && deck.d_matData.d_E < 0.)
967 deck.d_matData.d_E =
968 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
969
970 if (deck.d_matData.d_Gc > 0.)
971 deck.d_matData.d_KIc = deck.d_matData.toKIc(
972 deck.d_matData.d_Gc, deck.d_matData.d_nu, deck.d_matData.d_E);
973
974 if (deck.d_matData.d_KIc > 0. && deck.d_matData.d_Gc < 0.)
975 deck.d_matData.d_Gc = deck.d_matData.toGc(
976 deck.d_matData.d_KIc, deck.d_matData.d_nu, deck.d_matData.d_E);
977
978 // compute lame parameter
979 deck.d_matData.d_lambda =
981 deck.d_matData.d_G =
982 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
983 deck.d_matData.d_mu = deck.d_matData.d_G;
984
985 // compute peridynamic parameters
986 if (dim == 2) {
987 // Ha, Bobaru 2010 "Studies of dynamic crack propagation and crack branching
988 // with peridynamics"
989 d_c = 24.0 * deck.d_matData.d_E / (M_PI * std::pow(d_horizon, 3.0) *
990 (1. - deck.d_matData.d_nu));
991 d_s0 = std::sqrt(5.0 * M_PI * deck.d_matData.d_Gc /
992 (9.0 * deck.d_matData.d_E * d_horizon));
993 } else if (dim == 3) {
994 d_c = 24.0 * deck.d_matData.d_lambda / (M_PI * std::pow(d_horizon, 3.0));
995 d_s0 = std::sqrt(5.0 * M_PI * deck.d_matData.d_Gc /
996 (9.0 * deck.d_matData.d_E * d_horizon));
997 }
998 };
999
1000private:
1003
1006
1013 double d_c;
1014
1016 double d_s0;
1017
1019};
1020
1025class PdElastic : public Material {
1026
1027public:
1034 PdElastic(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
1035 : Material("PDElasticBond"), d_horizon(horizon),
1036 d_density(deck.d_density), d_c(0.) {
1037
1038 // set global fields
1039 if (dimension != dim)
1040 dimension = dim;
1041
1042 if (is_plane_strain != deck.d_isPlaneStrain)
1043 is_plane_strain = deck.d_isPlaneStrain;
1044
1045 // create influence function
1046 if (deck.d_influenceFnType == 0) {
1047 if (influence_fn == nullptr)
1048 influence_fn = std::make_shared<material::ConstInfluenceFn>(
1049 deck.d_influenceFnParams, dim);
1050 }
1051 else if (deck.d_influenceFnType == 1) {
1052 if (influence_fn == nullptr)
1053 influence_fn = std::make_shared<material::LinearInfluenceFn>(
1054 deck.d_influenceFnParams, dim);
1055 }
1056 else if (deck.d_influenceFnType == 2) {
1057 if (influence_fn == nullptr)
1058 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
1059 deck.d_influenceFnParams, dim);
1060 }
1061 else {
1062 std::cerr << "Error: Influence function type = "
1063 << deck.d_influenceFnType
1064 << " is invalid.\n";
1065 exit(1);
1066 }
1067
1068 // check if we need to compute the material parameters
1070 computeParameters(deck, dim);
1071 else
1072 d_c = deck.d_bondPotentialParams[0];
1073 };
1074
1079 bool isStateActive() const override { return false; };
1080
1090 std::pair<double, double> getBondEF(const double &r, const double &s,
1091 bool &fs,
1092 const bool &break_bonds) const override {
1093
1094 return std::make_pair(getInfFn(r) * 0.5 * d_c * s *
1095 s * r,
1096 getInfFn(r) * d_c * s);
1097 };
1098
1109 std::pair<double, double>
1110 getBondEF(const double &r, const double &s, bool &fs, const double
1111 &mx, const double &thetax) const override {
1112
1113 return this->getBondEF(r, s, fs, true);
1114 };
1115
1124 const util::Point &du) const override {
1125 return (dx + du) / (dx + du).length();
1126 };
1127
1134 double getS(const util::Point &dx, const util::Point &du) const override {
1135 return ((dx + du).length() - dx.length()) / dx.length();
1136 };
1137
1144 double getSc(const double &r) const override { return std::numeric_limits<double>::max(); };
1145
1150 double getDensity() const override { return d_density; };
1151
1158 double getInfFn(const double &r) const override {
1159 return getGlobalInfFn(r / d_horizon);
1160 };
1161
1171 double getMoment(const size_t &i) const override {
1172 return getGlobalMoment(i);
1173 };
1174
1180 double getHorizon() const override { return d_horizon; };
1181
1189 inp::MatData computeMaterialProperties(const size_t &dim) const override {
1190
1191 auto data = inp::MatData();
1192
1193 // set Poisson's ratio to 1/4
1194 data.d_nu = 0.25;
1195
1196 // compute peridynamic parameters
1197 if (dim == 2) {
1198 data.d_lambda = d_c * (M_PI * std::pow(d_horizon, 3.0)) / 24.0;
1199 data.d_E = data.toELambda(data.d_lambda, data.d_nu);
1200 } else if (dim == 3) {
1201 data.d_lambda = d_c * (M_PI * std::pow(d_horizon, 3.0)) / 24.0;
1202 data.d_E = data.toELambda(data.d_lambda, data.d_nu);
1203 }
1204 data.d_mu = data.d_lambda;
1205 data.d_G = data.d_lambda;
1206 data.d_K =
1207 data.toK(data.d_E, data.d_nu);
1208
1209 return data;
1210 };
1211
1219 std::string printStr(int nt, int lvl) const override {
1220
1221 auto tabS = util::io::getTabS(nt);
1222 std::ostringstream oss;
1223 oss << tabS << "------- particle::PdElastic --------" << std::endl
1224 << std::endl;
1225 oss << tabS << "State active = " << 0 << std::endl;
1226 oss << tabS << "Horizon = " << d_horizon << std::endl;
1227 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
1228 oss << tabS << "Influence fn info: " << std::endl;
1229 oss << influence_fn->printStr(nt + 1, lvl);
1230 oss << tabS << "Peridynamic parameters: " << std::endl;
1231 oss << tabS << " c = " << d_c << std::endl;
1232 oss << tabS << std::endl;
1233
1234 return oss.str();
1235 };
1236
1243 void print(int nt, int lvl) const override {
1244 std::cout << printStr(nt, lvl);
1245 };
1246
1248 void print() const override { print(0, 0); };
1249
1250private:
1257 void computeParameters(inp::MaterialDeck &deck, const size_t &dim) {
1258 //
1259 // Need following elastic and fracture properties
1260 // 1. E or K
1261 // For bond-based, Poisson's ratio is fixed to 1/4
1262 //
1263 if (util::isLess(deck.d_matData.d_E, 0.) &&
1264 util::isLess(deck.d_matData.d_K, 0.)) {
1265 std::cerr << "Error: Require either Young's modulus E or Bulk modulus K"
1266 " to compute the RNP bond-based peridynamic parameters.\n";
1267 exit(1);
1268 }
1269 if (util::isGreater(deck.d_matData.d_E, 0.) &&
1270 util::isGreater(deck.d_matData.d_K, 0.)) {
1271 std::cout << "Warning: Both Young's modulus E and Bulk modulus K are "
1272 "provided.\n";
1273 std::cout << "Warning: To compute the RNP bond-based peridynamic "
1274 "parameters, we only require one of those.\n";
1275 std::cout
1276 << "Warning: Selecting Young's modulus to compute parameters.\n";
1277 }
1278
1279 // set Poisson's ratio to 1/4
1280 deck.d_matData.d_nu = 0.25;
1281
1282 // compute E if not provided or K if not provided
1283 if (deck.d_matData.d_E > 0.)
1284 deck.d_matData.d_K =
1285 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
1286
1287 if (deck.d_matData.d_K > 0. && deck.d_matData.d_E < 0.)
1288 deck.d_matData.d_E =
1289 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
1290
1291 // compute lame parameter
1292 deck.d_matData.d_lambda =
1293 deck.d_matData.toLambdaE(deck.d_matData.d_E, deck.d_matData.d_nu);
1294 deck.d_matData.d_G =
1295 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
1296 deck.d_matData.d_mu = deck.d_matData.d_G;
1297
1298 // compute peridynamic parameters
1299 if (dim == 2) {
1300 d_c = 24.0 * deck.d_matData.d_lambda / (M_PI * std::pow(d_horizon, 3.0));
1301 } else if (dim == 3) {
1302 // TODO
1303 // For PdElastic and PmbMaterial, implement correct formula in 3-d
1304 d_c = 24.0 * deck.d_matData.d_lambda / (M_PI * std::pow(d_horizon, 3.0));
1305 }
1306 };
1307
1308private:
1311
1314
1321 double d_c;
1322
1324};
1325
1330class PdState : public Material {
1331
1332public:
1339 PdState(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
1340 : Material("PDState"), d_horizon(horizon), d_density(deck.d_density),
1341 d_K(0.), d_G(0.), d_s0(0.) {
1342
1343 // set global fields
1344 if (dimension != dim)
1345 dimension = dim;
1346
1347 if (is_plane_strain != deck.d_isPlaneStrain)
1348 is_plane_strain = deck.d_isPlaneStrain;
1349
1350 // create influence function
1351 if (deck.d_influenceFnType == 0) {
1352 if (influence_fn == nullptr)
1353 influence_fn = std::make_shared<material::ConstInfluenceFn>(
1354 deck.d_influenceFnParams, dim);
1355 }
1356 else if (deck.d_influenceFnType == 1) {
1357 if (influence_fn == nullptr)
1358 influence_fn = std::make_shared<material::LinearInfluenceFn>(
1359 deck.d_influenceFnParams, dim);
1360 }
1361 else if (deck.d_influenceFnType == 2) {
1362 if (influence_fn == nullptr)
1363 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
1364 deck.d_influenceFnParams, dim);
1365 }
1366 else {
1367 std::cerr << "Error: Influence function type = "
1368 << deck.d_influenceFnType
1369 << " is invalid.\n";
1370 exit(1);
1371 }
1372
1373 // check if we need to compute the material parameters
1375 computeParameters(deck, dim);
1376 else {
1377 d_K = deck.d_bondPotentialParams[0];
1378 d_G = deck.d_bondPotentialParams[1];
1379 d_s0 = deck.d_bondPotentialParams[2];
1380 }
1381 };
1382
1387 bool isStateActive() const override { return true; };
1388
1398 std::pair<double, double> getBondEF(const double &r, const double &s,
1399 bool &fs,
1400 const bool &break_bonds) const override {
1401
1402 return {0., 0.};
1403 };
1404
1415 std::pair<double, double>
1416 getBondEF(const double &r, const double &s, bool &fs, const double
1417 &mx, const double &thetax) const override {
1418
1419 if (fs)
1420 return {0., 0.};
1421
1422 double J = getInfFn(r);
1423 double change_length = s * r;
1424
1425 double alpha = 15. * d_G / mx;
1426 double factor = (3. * d_K / mx) - alpha / 3.;
1427
1428 return {0., J * (r * thetax * factor + change_length * alpha)};
1429 };
1430
1439 const util::Point &du) const override {
1440 return (dx + du) / (dx + du).length();
1441 };
1442
1449 double getS(const util::Point &dx, const util::Point &du) const override {
1450 return ((dx + du).length() - dx.length()) / dx.length();
1451 };
1452
1459 double getSc(const double &r) const override { return d_s0; };
1460
1465 double getDensity() const override { return d_density; };
1466
1473 double getInfFn(const double &r) const override {
1474 return getGlobalInfFn(r / d_horizon);
1475 };
1476
1486 double getMoment(const size_t &i) const override {
1487 return getGlobalMoment(i);
1488 };
1489
1495 double getHorizon() const override { return d_horizon; };
1496
1504 inp::MatData computeMaterialProperties(const size_t &dim) const override {
1505
1506 auto data = inp::MatData();
1507
1508 // we already have G and K
1509 data.d_G = d_G;
1510 data.d_K = d_K;
1511
1512 // get Poisson ratio and Young's modulus
1513 data.d_nu = (3. * d_K - 2. * d_G) / (2. * (3. * d_K + d_G));
1514 data.d_E = data.toE(d_K, data.d_nu);
1515
1516 // get lame parameters
1517 data.d_lambda = data.toLambdaE(data.d_E, data.d_nu);
1518 data.d_mu = d_G;
1519
1520 // get Gc
1521 double d =
1522 (3. * d_G + std::pow(3. / 4., 4) * (d_K - 5. * d_G / 3.)) * d_horizon;
1523 data.d_Gc = d_s0 * d_s0 * d;
1524
1525 // KIc
1526 data.d_KIc = data.toKIc(
1527 data.d_Gc, data.d_nu, data.d_E);
1528
1529 return data;
1530 };
1531
1539 std::string printStr(int nt, int lvl) const override {
1540
1541 auto tabS = util::io::getTabS(nt);
1542 std::ostringstream oss;
1543 oss << tabS << "------- particle::PdState --------" << std::endl
1544 << std::endl;
1545 oss << tabS << "State active = " << 1 << std::endl;
1546 oss << tabS << "Horizon = " << d_horizon << std::endl;
1547 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
1548 oss << tabS << "Influence fn info: " << std::endl;
1549 oss << influence_fn->printStr(nt + 1, lvl);
1550 oss << tabS << "Peridynamic parameters: " << std::endl;
1551 oss << tabS << " K = " << d_K << std::endl;
1552 oss << tabS << " G = " << d_G << std::endl;
1553 oss << tabS << " s0 = " << d_s0 << std::endl;
1554 oss << tabS << std::endl;
1555
1556 return oss.str();
1557 };
1558
1565 void print(int nt, int lvl) const override {
1566 std::cout << printStr(nt, lvl);
1567 };
1568
1570 void print() const override { print(0, 0); };
1571
1572private:
1579 void computeParameters(inp::MaterialDeck &deck, const size_t &dim) {
1580 //
1581 // Need following elastic and fracture properties
1582 // 1. E or K
1583 // 2. Poisson ratio or shear modulus
1584 // 3. Gc or KIc
1585 //
1586 bool found_E = false;
1587 bool found_K = false;
1588 bool found_G = false;
1589 bool found_nu = false;
1590 size_t num_props = 0;
1591
1592 found_E = util::isGreater(deck.d_matData.d_E, 0.);
1593 if (found_E)
1594 num_props++;
1595
1596 found_K = util::isGreater(deck.d_matData.d_K, 0.);
1597 if (found_K)
1598 num_props++;
1599
1600 found_G = util::isGreater(deck.d_matData.d_G, 0.);
1601 if (found_G)
1602 num_props++;
1603
1604 found_nu = util::isGreater(deck.d_matData.d_nu, 0.);
1605 if (found_nu)
1606 num_props++;
1607
1608 if (num_props != 2) {
1609 std::ostringstream oss;
1610 oss << "Error: Require two different elastic properties for the "
1611 "PdState material. Pairs supported are (E, K), (E, G), "
1612 "(E, nu), (K, G).\n";
1613 oss << deck.printStr(0, 0) << "\n";
1614 std::cout << oss.str();
1615 exit(1);
1616 }
1617
1618 if (util::isLess(deck.d_matData.d_Gc, 0.) &&
1619 util::isLess(deck.d_matData.d_KIc, 0.)) {
1620 std::cerr << "Error: Require either critical energy release rate Gc or "
1621 "critical stress intensity factor KIc to compute the RNP "
1622 "bond-based peridynamic parameters.\n";
1623 exit(1);
1624 } else if (util::isGreater(deck.d_matData.d_Gc, 0.) &&
1625 util::isGreater(deck.d_matData.d_KIc, 0.)) {
1626 std::cout << "Warning: Both critical energy release rate Gc and critical "
1627 "stress intensity factor KIc are provided.\n";
1628 std::cout << "Warning: To compute the RNP bond-based peridynamic "
1629 "parameters, we only require one of those.\n";
1630 std::cout << "Warning: Selecting critical energy release rate Gc to "
1631 "compute parameters.\n";
1632 }
1633
1634 // compute nu if not provided
1635 if (!found_nu) {
1636 if (found_E and found_G)
1637 deck.d_matData.d_nu =
1638 (0.5 * deck.d_matData.d_E / deck.d_matData.d_G) - 1.;
1639
1640 if (found_E and found_K)
1641 deck.d_matData.d_nu =
1642 (3. * deck.d_matData.d_K - deck.d_matData.d_E) /
1643 (6. * deck.d_matData.d_K);
1644
1645 if (found_G and found_K)
1646 deck.d_matData.d_nu =
1647 (3. * deck.d_matData.d_K - 2. * deck.d_matData.d_G) /
1648 (2. * (3. * deck.d_matData.d_K + deck.d_matData.d_G));
1649 }
1650 found_nu = true;
1651
1652 // compute E if not provided
1653 if (!found_E) {
1654 if (found_K)
1655 deck.d_matData.d_E =
1656 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
1657
1658 if (found_G)
1659 deck.d_matData.d_E =
1660 2. * deck.d_matData.d_G * (1. + deck.d_matData.d_nu);
1661 }
1662 found_E = true;
1663
1664 // compute K if not provided
1665 if (!found_K)
1666 deck.d_matData.d_K =
1667 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
1668
1669 found_K = true;
1670
1671
1672 // compute G if not provided
1673 if (!found_G)
1674 deck.d_matData.d_G =
1675 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
1676
1677 found_G = true;
1678
1679 // compute Gc (if not provided) and KIc (if not provided)
1680 if (deck.d_matData.d_Gc > 0.)
1681 deck.d_matData.d_KIc = deck.d_matData.toKIc(
1682 deck.d_matData.d_Gc, deck.d_matData.d_nu, deck.d_matData.d_E);
1683
1684 if (deck.d_matData.d_KIc > 0. && deck.d_matData.d_Gc < 0.)
1685 deck.d_matData.d_Gc = deck.d_matData.toGc(
1686 deck.d_matData.d_KIc, deck.d_matData.d_nu, deck.d_matData.d_E);
1687
1688 // compute lame parameter
1689 deck.d_matData.d_lambda =
1690 deck.d_matData.toLambdaE(deck.d_matData.d_E, deck.d_matData.d_nu);
1691 deck.d_matData.d_mu = deck.d_matData.d_G;
1692
1693 // compute peridynamic parameters
1694 d_K = deck.d_matData.d_K;
1695 d_G = deck.d_matData.d_G;
1696
1697 double d =
1698 (3. * d_G + std::pow(3. / 4., 4) * (d_K - 5. * d_G / 3.)) * d_horizon;
1699 d_s0 = std::sqrt(deck.d_matData.d_Gc / d);
1700 };
1701
1702private:
1705
1708
1715 double d_K;
1716
1718 double d_G;
1719
1721 double d_s0;
1722
1724};
1725
1726} // namespace material
1727
1728#endif // MATERIAL_PD_MATERIAL_H
Collection of methods and database related to peridynamic material.
Definition material.h:76
virtual void print(int nt, int lvl) const
Prints the information about the object.
Definition material.h:237
virtual double getHorizon() const =0
Returns horizon.
Material(std::string name="")
Constructor.
Definition material.h:83
virtual std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const =0
Returns energy and force between bond due to state-based model.
virtual void print() const
Prints the information about the object.
Definition material.h:240
virtual double getMoment(const size_t &i) const =0
Returns the moment of influence function.
virtual ~Material()
Destructor.
Definition material.h:90
virtual double getDensity() const =0
Returns the density of the material.
size_t getDimension()
Returns dimension of the problem.
Definition material.h:102
virtual std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const =0
Returns energy and force between bond due to pairwise interaction.
virtual bool isStateActive() const =0
Returns true if state-based potential is active.
bool isPlaneStrain()
Returns plane-strain condition.
Definition material.h:108
virtual inp::MatData computeMaterialProperties(const size_t &dim) const =0
Computes elastic and fracture material properties and returns the data.
std::string name()
Returns name of the material.
Definition material.h:96
std::string d_name
Name of the material.
Definition material.h:244
virtual util::Point getBondForceDirection(const util::Point &dx, const util::Point &du) const =0
Returns the unit vector along which bond-force acts.
virtual double getS(const util::Point &dx, const util::Point &du) const =0
Returns the bond strain.
virtual double getInfFn(const double &r) const =0
Returns the value of influence function.
virtual std::string printStr(int nt, int lvl) const
Returns the string containing printable information about the object.
Definition material.h:217
virtual double getSc(const double &r) const =0
Returns critical bond strain.
A class providing methods to compute energy density and force of peridynamic material.
Definition material.h:1025
util::Point getBondForceDirection(const util::Point &dx, const util::Point &du) const override
Returns the unit vector along which bond-force acts.
Definition material.h:1123
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const override
Returns energy and force between bond due to pairwise interaction.
Definition material.h:1090
double getMoment(const size_t &i) const override
Returns the moment of influence function.
Definition material.h:1171
double getDensity() const override
Returns the density of the material.
Definition material.h:1150
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:1219
double getS(const util::Point &dx, const util::Point &du) const override
Returns the bond strain.
Definition material.h:1134
PdElastic(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
Constructor.
Definition material.h:1034
inp::MatData computeMaterialProperties(const size_t &dim) const override
Computes elastic and fracture material properties and returns the data.
Definition material.h:1189
double getSc(const double &r) const override
Returns critical bond strain.
Definition material.h:1144
double d_density
Density.
Definition material.h:1313
double getHorizon() const override
Returns horizon.
Definition material.h:1180
bool isStateActive() const override
Returns true if state-based potential is active.
Definition material.h:1079
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:1158
double d_horizon
Horizon.
Definition material.h:1310
double d_c
Parameter C.
Definition material.h:1321
void print() const override
Prints the information about the object.
Definition material.h:1248
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const override
Returns energy and force between bond due to state-based model.
Definition material.h:1110
void print(int nt, int lvl) const override
Prints the information about the object.
Definition material.h:1243
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:1257
A class providing methods to compute energy density and force of peridynamic material.
Definition material.h:1330
double getS(const util::Point &dx, const util::Point &du) const override
Returns the bond strain.
Definition material.h:1449
double d_G
Shear modulus.
Definition material.h:1718
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:1539
void print(int nt, int lvl) const override
Prints the information about the object.
Definition material.h:1565
double getSc(const double &r) const override
Returns critical bond strain.
Definition material.h:1459
inp::MatData computeMaterialProperties(const size_t &dim) const override
Computes elastic and fracture material properties and returns the data.
Definition material.h:1504
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:1579
double d_horizon
Horizon.
Definition material.h:1704
void print() const override
Prints the information about the object.
Definition material.h:1570
double getDensity() const override
Returns the density of the material.
Definition material.h:1465
double getHorizon() const override
Returns horizon.
Definition material.h:1495
util::Point getBondForceDirection(const util::Point &dx, const util::Point &du) const override
Returns the unit vector along which bond-force acts.
Definition material.h:1438
double getMoment(const size_t &i) const override
Returns the moment of influence function.
Definition material.h:1486
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const override
Returns energy and force between bond due to state-based model.
Definition material.h:1416
PdState(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
Constructor.
Definition material.h:1339
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:1473
double d_K
Bulk modulus.
Definition material.h:1715
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const override
Returns energy and force between bond due to pairwise interaction.
Definition material.h:1398
double d_density
Density.
Definition material.h:1707
bool isStateActive() const override
Returns true if state-based potential is active.
Definition material.h:1387
double d_s0
Critical stretch.
Definition material.h:1721
A class providing methods to compute energy density and force of peridynamic material.
Definition material.h:665
double d_density
Density.
Definition material.h:1005
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:919
double getMoment(const size_t &i) const override
Returns the moment of influence function.
Definition material.h:828
void print(int nt, int lvl) const override
Prints the information about the object.
Definition material.h:905
double d_s0
Parameter .
Definition material.h:1016
double d_horizon
Horizon.
Definition material.h:1002
double getDensity() const override
Returns the density of the material.
Definition material.h:807
double getS(const util::Point &dx, const util::Point &du) const override
Returns the bond strain.
Definition material.h:791
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:815
bool isStateActive() const override
Returns true if state-based potential is active.
Definition material.h:721
double getHorizon() const override
Returns horizon.
Definition material.h:837
PmbMaterial(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
Constructor.
Definition material.h:674
void print() const override
Prints the information about the object.
Definition material.h:910
util::Point getBondForceDirection(const util::Point &dx, const util::Point &du) const override
Returns the unit vector along which bond-force acts.
Definition material.h:780
double d_c
Parameter C.
Definition material.h:1013
inp::MatData computeMaterialProperties(const size_t &dim) const override
Computes elastic and fracture material properties and returns the data.
Definition material.h:846
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const override
Returns energy and force between bond due to state-based model.
Definition material.h:767
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const override
Returns energy and force between bond due to pairwise interaction.
Definition material.h:732
double getSc(const double &r) const override
Returns critical bond strain.
Definition material.h:801
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:880
A class providing methods to compute energy density and force of peridynamic material.
Definition material.h:251
double getHorizon() const override
Returns horizon.
Definition material.h:452
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:431
void print(int nt, int lvl) const override
Prints the information about the object.
Definition material.h:527
util::Point getBondForceDirection(const util::Point &dx, const util::Point &du) const override
Returns the unit vector along which bond-force acts.
Definition material.h:394
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const override
Returns energy and force between bond due to pairwise interaction.
Definition material.h:342
double d_invFactor
Inverse of factor = .
Definition material.h:647
double getDensity() const override
Returns the density of the material.
Definition material.h:423
RnpMaterial(inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
Constructor.
Definition material.h:260
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const override
Returns energy and force between bond due to state-based model.
Definition material.h:381
double getS(const util::Point &dx, const util::Point &du) const override
Returns the bond strain.
Definition material.h:405
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:541
void print() const override
Prints the information about the object.
Definition material.h:532
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:498
double getMoment(const size_t &i) const override
Returns the moment of influence function.
Definition material.h:444
bool d_irrevBondBreak
Flag which indicates if the breaking of bond is irreversible.
Definition material.h:658
double d_rbar
Inflection point of nonlinear function = .
Definition material.h:644
bool isStateActive() const override
Returns true if state-based potential is active.
Definition material.h:314
double d_factorSc
Factor to multiply to critical strain to check if bond is fractured.
Definition material.h:655
inp::MatData computeMaterialProperties(const size_t &dim) const override
Computes elastic and fracture material properties and returns the data.
Definition material.h:461
double d_density
Density.
Definition material.h:628
double d_beta
Parameter .
Definition material.h:639
double getSc(const double &r) const override
Returns critical bond strain.
Definition material.h:415
double d_C
Parameter C.
Definition material.h:636
double d_horizon
Horizon.
Definition material.h:625
bool is_plane_strain
Is plane-stress condition active.
Definition material.h:29
double getGlobalInfFn(const double &r)
Returns the value of influence function.
Definition material.h:40
double getGlobalMoment(const size_t &i)
Returns the moment of influence function.
Definition material.h:53
size_t dimension
Dimension of the domain.
Definition material.h:26
std::shared_ptr< material::BaseInfluenceFn > influence_fn
Store pointer to influence function globally.
Definition material.h:32
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40
bool isGreater(const double &a, const double &b)
Returns true if a > b.
Definition function.cpp:15
bool isLess(const double &a, const double &b)
Returns true if a < b.
Definition function.cpp:20
Structure for elastic properties and fracture properties.
double toGc(double KIc, double nu, double E)
Compute critical energy release rate Gc from critical stress-intensity factor KIc,...
double toLambdaE(double E, double nu)
Compute Lame first parameter lambda from Young's modulus E and Poisson's ratio nu.
double d_mu
Lame second parameter.
double toKIc(double Gc, double nu, double E)
Compute critical stress-intensity factor KIc from critical energy release rate Gc,...
double d_KIc
Critical stress intensity factor.
double toK(double E, double nu)
Compute Bulk modulus K from Young's modulus K and Poisson's ratio nu.
double d_K
Bulk modulus.
double d_lambda
Lame first parameter.
double toGE(double E, double nu)
Compute shear modulus from Young's modulus E and Poisson's ratio nu.
double d_nu
Poisson's ratio.
double d_G
Shear modulus or Lame second parameter.
double d_E
Young's elastic modulus.
double d_Gc
Critical energy release rate.
double toE(double K, double nu)
Compute Young's modulus E from Bulk modulus K and Poisson's ratio nu.
Structure to read and store material related data.
bool d_isPlaneStrain
Indicates if the 2-d simulation is of plane-strain type (thick material) or plane-stress type (thin m...
size_t d_influenceFnType
Type of influence function.
std::vector< double > d_bondPotentialParams
List of parameters for pairwise potential.
bool d_computeParamsFromElastic
Compute Peridynamic material properties from elastic properties.
inp::MatData d_matData
List of elastic and fracture properties.
std::vector< double > d_influenceFnParams
List of parameters for influence function.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
A structure to represent 3d vectors.
Definition point.h:30
double dot(const Point &b) const
Computes the dot product of this vector with another point.
Definition point.h:132
double length() const
Computes the Euclidean length of the vector.
Definition point.h:118