21 #ifndef FINITE_ELEMENT_1S_REFERENCE_CURVE_FUNCTIONS_H_
22 #define FINITE_ELEMENT_1S_REFERENCE_CURVE_FUNCTIONS_H_
24 #include "mbsimFlexibleBody/flexible_body/finite_elements/finite_element_1S_reference_curve.h"
26 namespace MBSimFlexibleBody {
37 fmatvec::SymMatV operator()(
const double & xi) {
38 fmatvec::Mat3xV P = refBody->
computeP(xi, 0);
39 fmatvec::SymMatV PTP(P.cols(), INIT, 0.);
40 for (
int i = 0; i < PTP.size(); i++) {
42 for (
int j = i; j < PTP.size(); j++) {
43 PTP(i, j) = scalarProduct(coli, P.col(j));
61 fmatvec::SqrMatV operator()(
const double & xi) {
62 fmatvec::Mat3xV P = refBody->
computeP(xi, 0);
63 fmatvec::Mat3xV dPdxi = refBody->
computeP(xi, 1);
65 SqrMatV ret(P.cols(), INIT, 0.);
66 for (
int i = 0; i < P.cols(); i++) {
68 for (
int j = 0; j < dPdxi.cols(); j++)
69 ret(i, j) = scalarProduct(colP, dPdxi.col(j));
87 fmatvec::SqrMatV operator()(
const double & xi) {
88 fmatvec::Mat3xV P = refBody->
computeP(xi, 0);
89 fmatvec::Mat3xV dPdt(P.cols(), INIT, 0.);
91 SqrMatV ret(P.cols(), INIT, 0.);
95 Vec q = refBody->getq();
99 for (
int qInd = 2; qInd < P.cols(); qInd++) {
100 dPdt.add(0, q(qInd) * refBody->
computeB(qInd, xi, 1, 0));
101 dPdt.add(1, q(qInd) * refBody->
computeB(qInd, xi, 0, 1));
106 for (
int i = 0; i < P.cols(); i++) {
107 Vec3 colP = P.col(i);
108 for (
int j = 0; j < dPdt.cols(); j++)
109 ret(i, j) += scalarProduct(colP, dPdt.col(j));
121 refBody(refBody), qInd(-1) {
124 void setqInd(
int qInd_) {
131 fmatvec::SqrMatV operator()(
const double & xi) {
132 fmatvec::Mat3xV P = refBody->
computeP(xi, 0);
133 fmatvec::Mat3xV dPdqk = refBody->
computedPdqk(xi, qInd);
134 fmatvec::SqrMatV ret(P.cols(), INIT, 0.);
137 int endCol = dPdqk.cols();
141 for (
int i = 0; i < P.cols(); i++) {
143 for (
int j = 0; j < endCol; j++)
144 ret(i, j) = scalarProduct(col, dPdqk.col(j));
160 refBody(refBody), dofDirOfElement(-1) {
163 void setDofDirOfElement(
int qInd_) {
164 dofDirOfElement = qInd_;
170 fmatvec::Vec1 operator()(
const double & xi) {
171 fmatvec::Vec1 retVal;
173 Vec3 drdxi = refBody->
computer(xi, 1, 0);
174 double drdxipw2 = scalarProduct(drdxi, drdxi);
177 Vec3 drdxidqk = refBody->
computedrdqk(xi, 1, dofDirOfElement);
182 double sqrdrdxipw2 = sqrt(drdxipw2);
183 double ForW_gamma = scalarProduct(drdxi, drdxidqk);
184 retVal(0) = (sqrdrdxipw2 - 1.) * ForW_gamma / sqrdrdxipw2;
196 refBody(refBody), qIndLoc(-1) {
199 void setqIndLoc(
int qIndLoc_) {
206 fmatvec::Vec1 operator()(
const double & xi) {
209 return Vec1(INIT, kappan * dkappandqk);
219 refBody(refBody), qIndLoc(-1) {
222 void setqIndLoc(
int qIndLoc_) {
229 fmatvec::Vec1 operator()(
const double & xi) {
232 return Vec1(INIT, kappab * dkappabdqk);
fmatvec::Mat3xV computeP(double xi, int derXi)
compute the P matrix
Definition: finite_element_1S_reference_curve.cc:739
this function returns basically three values. As these share some values it makes sense to not comput...
Definition: finite_element_1S_reference_curve_functions.h:157
double computedKappabdqk(double xiGlob, int qIndLocal)
compute derivative of kappab w.r.t. the given DoF
Definition: finite_element_1S_reference_curve.cc:1010
Definition: finite_element_1S_reference_curve_functions.h:118
fmatvec::Vec3 computeB(int dofDirLocal, double xiGlob, int derXi, int derTheta)
compute the column i of the B matrix (the column that is connected to the localDOF) ...
Definition: finite_element_1S_reference_curve.cc:344
Definition: finite_element_1S_reference_curve_functions.h:78
Definition: finite_element_1S_reference_curve_functions.h:216
double computeKappab(double xiGlob)
compute the bending in t/b-plane
Definition: finite_element_1S_reference_curve.cc:923
Finite-Element class for the body FlexibleBody1SReferenceCurve.
Definition: finite_element_1S_reference_curve.h:37
double computedKappandqk(double xiGlob, int qIndLocal)
compute derivative of kappan w.r.t. the given DoF
Definition: finite_element_1S_reference_curve.cc:928
fmatvec::Vec3 computer(double xi, int derXi=0, int derTheta=0)
compute the position and/or its derivative w.r.t. xi and/or theta
Definition: finite_element_1S_reference_curve.cc:261
Definition: finite_element_1S_reference_curve_functions.h:28
Definition: finite_element_1S_reference_curve_functions.h:193
double computeKappan(double xiGlob)
compute the bending in t/n-plane
Definition: finite_element_1S_reference_curve.cc:915
Definition: finite_element_1S_reference_curve_functions.h:52
fmatvec::Mat3xV computedPdqk(double xi, int dofDirLocal)
compute the P matrix derived wrt the generalized position
Definition: finite_element_1S_reference_curve.cc:754
fmatvec::Vec3 computedrdqk(double xi, int derXi, int qIndLoc)
computes the derivative wrt the generalized position of the local element
Definition: finite_element_1S_reference_curve.cc:275