void ANCFBeamBE2D::GetdPosdqT(const Vector2D& p_loc, Matrix& dpdqi) { //p = S(p.x,p.y,p.z)*q; d(p)/dq dpdqi.SetSize(SOS(),Dim()); dpdqi.FillWithZeros(); //d = S + ... for (int i = 1; i <= NS(); i++) { double s = GetS0(p_loc.X(), i); dpdqi((i-1)*Dim()+1,1) = s; dpdqi((i-1)*Dim()+2,2) = s; } if (p_loc.Y() != 0) { double y = p_loc.Y(); Vector2D rx = GetPosx2D(p_loc.X()); Vector2D n(-rx.X(), rx.Y()); n /= rx.Norm(); for (int i = 1; i <= NS(); i++) { double sx = GetS0x(p_loc.X(), i) * 2./GetLx(); //y/|n|*dn/dq dpdqi((i-1)*Dim()+1,2) += y*sx; dpdqi((i-1)*Dim()+2,1) += -y*sx; //y*n/|n|*(r_x1*S_x1 + r_x2*S_x2) dpdqi((i-1)*Dim()+1,1) += y*n.X()*(rx.X()*sx); dpdqi((i-1)*Dim()+1,2) += y*n.Y()*(rx.X()*sx); dpdqi((i-1)*Dim()+2,1) += y*n.X()*(rx.Y()*sx); dpdqi((i-1)*Dim()+2,2) += y*n.Y()*(rx.Y()*sx); } } };
double FieldVariableDescriptor::GetComponent(const Vector2D & v) const { assert(component_index_1 != FVCI_none && component_index_2 == FVCI_none); if(component_index_1 == FVCI_magnitude) return v.Norm(); if(component_index_1 == FVCI_z) return FIELD_VARIABLE_NO_VALUE; // this may happen if there are 3D and 2D elements mixed in the system return v(component_index_1); }
Vector2D ANCFBeamBE2D::GetInplaneUnitVectorP2D(const double& p_loc) const { Vector2D rx = GetPosx2D(p_loc); Vector2D vx = GetVelx2D(p_loc); double rxn = rx.Norm(); double rxnp = 1./rxn*(rx(1)*vx(1) + rx(2)*vx(2)); return 1./rxn * (Vector2D(-vx(2),vx(1)) - rxnp/rxn * Vector2D(-rx(2),rx(1))); };
void ANCFBeamBE2D::GetDeltaEpsAxial(const double& p_loc, Vector& delta_eps) { Vector2D rx = GetPosx2D(p_loc); double d = 1./rx.Norm(); for (int j = 1; j <= NS(); j++) { double sx = GetS0x(p_loc, j) * 2./GetLx(); delta_eps(2*j-1) = d * rx(1) * sx; delta_eps(2*j ) = d * rx(2) * sx; } };
Circle(const Point2D < T > &Point, const Vector2D < T > &Vector) { this->Centre = Point; this->R = Vector.Norm(); }
Vector2D < T > Norm(const Vector2D < T > &Vector) { return Vector2D < T > (Vector.x / Vector.Norm(), Vector.y / Vector.Norm()); }
double ANCFBeamBE2D::GetEpsAxialD(const double& p_loc) const { Vector2D rx = GetPosx2DD(p_loc); return rx.Norm() - 1.0; };