Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
ParametricCurve.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_PARAMETRICCURVE_H_
9#define model_PARAMETRICCURVE_H_
10
11#include <Eigen/Dense>
12
13#include <Quadrature.h>
14
15
16namespace model {
17
18
19
20
101
102
103
104
105
106
107 template <typename Derived, short unsigned int dim>
109 {
110
111 typedef Eigen::Matrix<double, dim, 1> VectorDim;
112
113 private:
114
116 Derived& derivedCurve() { return *static_cast<Derived*>(this); }
117 Derived* p_derivedCurve() { return static_cast<Derived*>(this); }
118 const Derived& derivedCurve() const { return *static_cast<const Derived*>(this); }
119 const Derived* p_derivedCurve() const { return static_cast<const Derived*>(this); }
120
121 public:
122
123/*************************************************************/
124 double get_j(const double & u) const {
130 return p_derivedCurve()->get_ru(u).norm();
131 }
132
133 /*************************************************************/
134 double get_jSquare(const double & u) const {
135 return p_derivedCurve()->get_ru(u).squaredNorm();
136 }
137
138 /*************************************************************/
139 VectorDim get_rl(const double & u) const {
140 return p_derivedCurve()->get_ru(u).normalized();
141 }
142
143 /*************************************************************/
144 double get_ju(const double & u) const {
150 return get_rl(u).dot(p_derivedCurve()->get_ruu(u));
151 }
152
153
154 /*************************************************************/
155 VectorDim get_rll(const double & u) const {
161 const double j2(get_jSquare(u));
162 VectorDim ru (p_derivedCurve()->get_ru (u));
163 VectorDim ruu(p_derivedCurve()->get_ruu(u));
164 return (ruu - ru*ru.dot(ruu)/j2)/j2;
165 }
166
167
168 /*************************************************************/
170 double get_kappa(const double & u) const {
176 return get_rll(u).norm();
177 }
178
179
180 /*************************************************************/
181 template <short unsigned int qOrder, template <short unsigned int, size_t> class QuadratureRule>
182 double arcLength() const {
183 double L(0.0);
185 return L;
186 }
187
188 /*************************************************************/
189 template <short unsigned int qOrder, template <short unsigned int, size_t> class QuadratureRule>
190 VectorDim rm() const {
191 VectorDim temp(VectorDim::Zero());
192 Quadrature<1,qOrder,QuadratureRule>::integrate(this,temp,&Derived::rm_integrand);
194 }
195
196 VectorDim rm_integrand(const double& u) const {
197 return p_derivedCurve()->get_r(u)*get_j(u);
198 }
199
200 };
201
202} // namespace model
203#endif
204
205
Class template that computes tangent, curvature and torsion of a parametric curve in arbitrary dimen...
double get_j(const double &u) const
double get_kappa(const double &u) const
the scalar curvature
double get_ju(const double &u) const
VectorDim get_rl(const double &u) const
VectorDim rm_integrand(const double &u) const
VectorDim get_rll(const double &u) const
double get_jSquare(const double &u) const
static void integrate(IntegrandType(*fp)(const double &), IntegrandType &intgrl)
Definition Quadrature.h:81
REAL u[4]
vertex temp