Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_fcriteria_coulomb.cxx
Go to the documentation of this file.
1 /*
2 Copyright 2016 Pierre SMARS (smars@yuntech.edu.tw)
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #include "a_fcriteria_coulomb.h"
17 #include "a_face_2d4.h"
18 
19 #include "config.h"
20 
21 //---------------------------------------------------------------------------
22 const std::string a_fcriteria_coulomb::help()
23 {
24  std::ostringstream o;
25  o << a_fcriteria::help();
26  o << "********************" << std::endl;
27  o << "a_fcriteria_coulomb:" << std::endl;
28  o << "********************" << std::endl;
29  o << "This class derives from a _fcriteria_in," << std::endl;
30  o << "it implements a specific resistance criterion:" << std::endl;
31  o << "The excentricity of the resultant of the force on a face is required to remain in between specific bounds" << std::endl;
32  o << "And the shear force on a face needs to respect Coulomb criteria: |Q| <= f |N| + c" << std::endl;
33  o << "With |Q| = |Qx + Qy|" << std::endl;
34  o << "f 'value': set the bound (default: 0.5 = 26.6 deg.)" << std::endl;
35  o << "f: get the bound" << std::endl;
36  o << "c 'value': set the cohesion (default: 0.)" << std::endl;
37  o << "c: get the cohesion" << std::endl;
38  return o.str();
39 }
40 //---------------------------------------------------------------------------
41 bool a_fcriteria_coulomb::ok(const a_face * f0) const
42 {
43  if (!a_fcriteria_in::ok(f0))
44  return false;
45  const a_face_2d4 * f = cf_2d4(f0);
46  double N = f->N();
47  if (N>0.)
48  return false;
49  double Qx = f->Qx();
50  double Qy = f->Qy();
51  double Q = sqrt(Qx*Qx+Qy*Qy);
52  if (Q>-f_*N+c_)
53  return false;
54  return true;
55 }
56 //---------------------------------------------------------------------------
57 double a_fcriteria_coulomb::penalty(const a_face * f0) const
58 {
59  double p1 = a_fcriteria_in::penalty(f0);
60  const a_face_2d4 * f = cf_2d4(f0);
61  double N = f->N();
62  double Qx = f->Qx();
63  double Qy = f->Qy();
64  double Q = sqrt(Qx*Qx+Qy*Qy);
65  if (Q<=f_*N+c_)
66  return p1;
67  double p2 = Q-f_*N-c_;
68  if (N!=0)
69  {
70  p2 /= N;
71  return sqrt(p1*p1+p2*p2);
72  }
73  return c_/Q;
74 }
75 //---------------------------------------------------------------------------
a_face_2d4 * cf_2d4(a_face *f)
Definition: a_face_2d4.cxx:26
Definition: a_face.h:33
virtual bool ok(const a_face *f) const
return true if forces on the face are passing through the face and shear is not too high
virtual double penalty(const a_face *f) const
return max excentricity if abs is higher than max (1. by default)
static const std::string help()
get information about the class
double f() const
get max f friction coefficient
virtual double penalty(const a_face *f) const
return max excentricity if abs is higher than max (1. by default)
virtual bool ok(const a_face *f) const
return true if forces on the face are passing through the face
static const std::string help()
get information about the class
Definition: a_fcriteria.cxx:22