示例#1
0
void VortexSegment::BiotSavart(double* pX, double* Uind, bool ImageMethod) {
    /**@brief Calculate self induced velocity at pX.
     *
     */

    //check if contribution is required
    // TODO: consider atTE as condition for zero return
    if (this->Gamma() == 0.0 || atImage == true) {
        Uind[0] = 0.0;
        Uind[1] = 0.0;
        Uind[2] = 0.0;
        return;
    }

    //get object Gamma
    double Gamma = this->Gamma();

    if (ImageMethod == false) {
        C_BiotSegment(pX,p1,p2,Gamma,Uind);
    } else if (ImageMethod == true) {
        C_BiotSegment(pX,p1,p2,Gamma,Uind);

        //add image effect
        double TempTriad[3] = {0.0,0.0,0.0};
        C_BiotSegment_ImageYZ(pX,p1,p2,Gamma,TempTriad);
        AddTriad(Uind,TempTriad,Uind);
    }
}
示例#2
0
void c_wrap_vorticity_biotsegment(double* xp_triad, double* x1_triad, \
									 double* x2_triad, double& Gamma, \
									 double* Uind_triad) {
	/** @brief wrapper for C_BiotSegment.
	  * @details c-style pointers only.
	  */
	C_BiotSegment(xp_triad, x1_triad, x2_triad,\
				  Gamma, Uind_triad);
}
示例#3
0
void c_wrap_test_biotsegment(const int& NumTests) {
	double xp[] = {0.0,0.0,-1.0};
	double x1[] = {-0.5,0.0,0.0};
	double x2[] = {0.5,0.0,0.0};
	double gam  = 1.0;
	double Result[] = {0.0,0.0,0.0};

	//call function
	for (int i = 0; i < NumTests; i++) {
		C_BiotSegment(xp,x1,x2,gam,Result);
	}
	return;
}