/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGSBRepEndC_HH_ #define _MGSBRepEndC_HH_ #include #include #include "mg/MGCL.h" #include "mg/Vector.h" #include "mg/BPointSeq.h" // MGSBRepEndC.h // class MGNDDArray; class MGCoons; class MGBSumSurf; /** @file */ /** @addtogroup GEORelated * @{ */ /// Defines End Condition of Surface B-Representation. ///Class for MGSBRep constructor like: /// MGSBRep( ///BLG4SP...Derivative Inf. /// MGSBRepEndC& endc, ///end condition /// const MGNDDArray& utaui, ///Data point of u-direction of value /// const MGNDDArray& vtaui, ///Data point of v-direction of value /// const MGSPointSeq& value, ///Data point ordinate /// int &error); ///Error flag. ///Provides four perimeter end conditions and four corners end conditions. ///For a perimeter, four types of conditions can be applied: /// MGENDC_NO: no end cond(only positional data) /// MGENDC_1D: 1st deravative provided. /// MGENDC_2D: 2nd deravative provided. /// MGENDC_12D: both 1st and 2nd deravatives provided. ///When m_cond[0]=MGENDC_1D and m_cond[1]=MGENDC_1D, twist vector d2f/(du*dv) ///is necessary at the corner of u=max and v=min. Although users can provide ///the data, complete_corner_deriv computes the data from given data ///if not provided. ///At other corners or for other conditions, the same. /// ///To construct MGSBRepEndC, first construct through void constructor. ///Then use set_1st(), set_2nd, set_11d(), set_12d(), set_21d(), or ///set_22d() to complete. Any of set_11d(), set_12d(), set_21d(), or ///set_22d() can be omitted. complete_corner_deriv will compute instead. ///This is done in SBRep constructor. class MG_DLL_DECLR MGSBRepEndC { public: //////////// String stream Function. //////////// MG_DLL_DECLR friend std::ostream& operator<< (std::ostream&, const MGSBRepEndC& ); //////////// Constructor //////////// ///Default Constructor. MGSBRepEndC(); ///Construct from a Coon's patch. MGSBRepEndC( const MGNDDArray& utau, const MGNDDArray& vtau, const MGCoons& coons ); ///Construct from a Coon's patch. MGSBRepEndC( const MGNDDArray& utau, const MGNDDArray& vtau, const MGBSumSurf& bssurf ); ///Copy Constructor. MGSBRepEndC(const MGSBRepEndC& ec); //////////// Destructor //////////// ~MGSBRepEndC(); //////////// Operator overload. //////////// MGSBRepEndC& operator=(const MGSBRepEndC& ec); //////////// Member Function //////////// /// Complete corner derivatives(twist vectors and higher order derivatives) void complete_corner_deriv (const MGNDDArray& utau, ///& first_derivp); ///Set 2nd deriv of i-th perimeter and change condition type ///to MGENDC_2D or MGENDC_12D. ///For i=0 and 2, first_deriv=d2f/dv**2, ///for i=1 and 3 first_deriv=d2f/du**2 ///1st form is to copy second_deriv, and 2nd form is to transfer the ownership ///of the second_derivp to SBRepEndC. ///2nd form is recommended since no copy takes place. void set_2nd(int i, const MGBPointSeq& second_deriv); void set_2nd(int i, std::unique_ptr& second_derivp); ///Set m_11d[i] inf(d2f/(du*dv)) of i-th corner. void set_11d(int i, const MGVector& deriv); ///Set m_12d[i] inf(d3f/(du*dv**2)) of i-th corner. void set_12d(int i, const MGVector& deriv); ///Set m_21d[i] inf(d3f/(du**2*dv)) of i-th corner. void set_21d(int i, const MGVector& deriv); ///Set m_22d[i] inf(d4f/du**2*dv**2) of i-th corner. void set_22d(int i, const MGVector& deriv); private: //////////// Member Data ///////// MGENDCOND m_cond[4]; ///< Type of end conditions of 4 perimeters. ///< m_cond[0]: v=min boundary line, m_cond[1]: u=max boundary line ///< m_cond[2]: v=max boundary line, m_cond[3]: u=min boundary line MGBPointSeq* m_1deriv[4]; ///<1st derivative stored in m_1deriv[i] ///