eg2hprivated.h

Go to the documentation of this file.
00001 
00002 /* ///////////////////////////////////////////////////////////////////////// */
00003 /* This file is a part of the BSTools package                                */
00004 /* written by Przemyslaw Kiciak                                              */
00005 /* ///////////////////////////////////////////////////////////////////////// */
00006 /* (C) Copyright by Przemyslaw Kiciak, 2005, 2008                            */
00007 /* this package is distributed under the terms of the                        */
00008 /* Lesser GNU Public License, see the file COPYING.LIB                       */
00009 /* ///////////////////////////////////////////////////////////////////////// */
00010 
00011 /* this header file is private for g2hole library functions; */
00012 /* it is NOT intended to be #included in application source files */
00013 
00014 #ifndef EG2HPRIVATED_H
00015 #define EG2HPRIVATED_H
00016 
00017 #ifndef EGHPRIVATED_H
00018 #include "eghprivated.h"
00019 #endif
00020 
00021 /* degrees of polynomial junction functions */
00022 #define G2_BF01DEG 2
00023 #define G2_CG01DEG 1
00024 #define G2_BF11DEG 4
00025 #define G2_CG11DEG 3
00026 #define G2_BF02DEG 3
00027 #define G2_CG02DEG 2
00028 #define G2_BF12DEG 5
00029 #define G2_CG12DEG 4
00030 
00031 /* degrees of patch cross derivatives */
00032 #define G2_CROSS00DEG 7  /* == G2H_OMCDEG */
00033 #define G2_CROSS01DEG 8
00034 #define G2_CROSS02DEG 9
00035 #define G2_CROSS10DEG 3
00036 #define G2_CROSS11DEG 6
00037 #define G2_CROSS12DEG 9
00038 
00039 #define G2_CROSSDEGSUM \
00040         (G2_CROSS00DEG+G2_CROSS01DEG+G2_CROSS02DEG+ \
00041          G2_CROSS10DEG+G2_CROSS11DEG+G2_CROSS12DEG)
00042 
00043 /* the following two numbers are relevant for spline bases */
00044 #define G2_AUXDEG0 (G2_CROSS01DEG-G2H_OMCDEG+1)
00045 #define G2_AUXDEG1 (G2_CROSS02DEG-G2H_OMCDEG+2)
00046 
00047 /* the #definitions below are for the construction with */
00048 /* the extended basis */
00049 #define G2_DBDIM 16    /* diagonal block dimension, 4*4 */
00050 #define G2_DIAGBLSIZE (G2_DBDIM*(G2_DBDIM+1)/2)
00051 
00052 
00053 /* number of quadrature knots */
00054 #define G2_NQUAD 16
00055 #define G2_NQUADSQ (G2_NQUAD*G2_NQUAD)
00056 #define G2_QUAD_FACTOR 10  /* for integration of spline basis functions */
00057 
00058 
00059 /* ////////////////////////////////////////////////////////////////////////// */
00060 /* private data of the construction procedures */
00061 typedef struct G2HolePrivateRecd {
00062     int      hole_m;
00063     int      nfunc_a,   /* number of "inner" basis functions */
00064              nfunc_b;   /* number of "outer" basis functions */
00065     char     opt_cp, opt_der1, opt_basis, opt_quad;  /* recorded options */
00066     vector2d *omcbc;    /* boundary conditions for auxiliary patches */
00067     vector2d *omc;      /* auxiliary patches representation */
00068     double   *jfunc;    /* coefficients of junction functions */
00069     vector2d *dicross;  /* curves describing cross derivatives */
00070                         /* of the domain patches */
00071     double   *AuxiMat;  /* matrices of transformations of derivatives */
00072                         /* for composing functions with domain patches */
00073     double   *basis_a,  /* Coons representations of "inner" basis functions */
00074              *basis_b;  /* Coons represetnationf of "outer" basis functions */
00075     unsigned char spdimen[4];   /* numbers of "inner" basis functions: */
00076                                 /* "half polynomial" and "splines" of degree */
00077                                 /* 3 and 4 */
00078     double   *partition;        /* partition of the full angle */
00079     GHoleSgnPartd *spartition;  /* sorted partition, having hole_k-hole_m */
00080                                 /* elements */
00081     double   spart_alpha0;      /* sorted partition bisectrix */
00082     double   *Amat, *Bmat;      /* matrices of scalar products */
00083                                 /* of basis functions */
00084     double   *Lmat;             /* decomposition factor L:  A=LL^T */
00085     double   *EAmat, *EBmat;    /* matrices for the extended basis */
00086     double   *ELmat;            /* decomposition factor for the */
00087                                 /* extended matrix */
00088 
00089     int      nconstr;           /* number of constraint equations */
00090     double   *Cmat, *RCmat;     /* matrices of constraint equations */
00091     int      naconstr, acdim;
00092     double   *ACmat, *ARCmat;
00093     int      extnconstr;        /* number of constraints and */
00094     double   *ECmat, *ERCmat;   /* matrices of constraint equations for */
00095                                 /* the extended matrix */
00096     int      extnaconstr, extacdim;
00097     double   *AECmat, *AERCmat;
00098 
00099     double   *BBmat;            /* matrix of scalar products, for */
00100                                 /* evaluation of the functional */
00101 
00102     int (*GetOption)( GHoleDomaind *domain, int query, int qn,
00103                       int *ndata, int **idata, double **fdata );
00104   } G2HolePrivateRecd;
00105 
00106 
00107 /* private data for the nonlinear constructions */
00108 typedef struct G2HNLPrivated {
00109     int      auxc;    /* patch counter */
00110     vector3d *nldi;   /* NL patches */
00111     vector3d *acoeff;
00112     vector3d *rhole_cp;
00113     vector3d nlnv, reflv;
00114     vector2d *diu, *div, *diuu, *diuv, *divv,
00115              *diuuu, *diuuv, *diuvv, *divvv;
00116     double   *jac;
00117     double   *psiu, *psiv, *psiuu, *psiuv, *psivv,
00118              *psiuuu, *psiuuv, *psiuvv, *psivvv;
00119   } G2HNLPrivated;
00120 
00121 typedef struct G2HNLFuncd {
00122     double   pu, pv, puu, puv, pvv, puuu, puuv, puvv, pvvv, jac;
00123     double   psiu, psiv, psiuu, psiuv, psivv, psiuuu, psiuuv, psiuvv, psivvv,
00124              psju, psjv, psjuu, psjuv, psjvv, psjuuu, psjuuv, psjuvv, psjvvv;
00125     vector2d L, Lpu, Lpv, Lpuu, Lpuv, Lpvv, Lpuuu, Lpuuv, Lpuvv, Lpvvv,
00126              Lpupu, Lpupv, Lpupuu, Lpupuv, Lpupvv, Lpupuuu, Lpupuuv, Lpupuvv,
00127              Lpupvvv, Lpvpv, Lpvpuu, Lpvpuv, Lpvpvv, Lpvpuuu, Lpvpuuv,
00128              Lpvpuvv, Lpvpvvv, Lpuupuu, Lpuupuv, Lpuupvv, Lpuvpuv, Lpuvpvv,
00129              Lpvvpvv, BLT;
00130     double   D, Dpu, Dpv, Dpupu, Dpupv, Dpvpv;
00131     double   B[3], Bpu[3], Bpv[3], Bpupu[3], Bpupv[3], Bpvpv[3];
00132     double   LBLT;
00133   } G2HNLFuncd;
00134 
00135 
00136 /* private data for the spline basis construction */
00137 typedef struct G2HoleSPrivateRecd {
00138     int nk, m1, m2;   /* parameters, which determine the space dimension */
00139     int nsfunc_c, nsfunc_d;
00140                       /* numbers of basis functions of various kinds */
00141     int csize, dsize; /* sizes of the blocks in the form matrix */
00142     int    lastbezknot;
00143     double bezknots[2*(G2H_FINALDEG+1)];  /* knots for Bezier polynomials */
00144     int    lastomcknot;
00145     double *omcknots;  /* knots of basis function auxiliary patches */
00146     int    lastpvknot, lastpvvknot;
00147     double *pvknots, *pvvknots;
00148                       /* knots of the basis functions of the D block */
00149     int lastcknot;
00150     double *cknots;    /* knots of the basis functions of the C block */
00151     double *basis_d;   /* Coons representations of basis functions */
00152 
00153     int lastfpknot;
00154     double *fpknots;   /* knots of the final patches */
00155     double *SAMat, *SBMat;  /* form matrices for the spline basis */
00156     double *SLMat;          /* A=LL^T decomposition factor */
00157 
00158     int    splnconstr; /* number of constraints */
00159     double *SCmat, *SRCmat; /* matrices of constraint equations */
00160     int    splnaconstr, splacdim;
00161     double *ASCmat, *ASRCmat;
00162   } G2HoleSPrivateRecd;
00163 
00164 
00165 /* private data for spline nonlinear constructions */
00166 typedef struct G2HNLSPrivated {
00167     G2HNLPrivated nlpr; /* must be the first field */
00168     int    nkn;         /* number of quadrature knots */
00169     double *tkn;        /* quadrature knots */
00170     int    ftabsize;    /* function values table size */
00171     int    psize;       /* number of control points of each final patch  */
00172     int    *fkn, *lkn;  /* ranges of knots for the functions of block C  */
00173     double *cb, *cbt, *cbtt, *cbttt;  /* B-spline functions and their derivatives */
00174     int    *cfuncvi;    /* indexes of the first samples of C block functions */
00175     int    *dfuncvi;    /* indexes of the first samples of D block functions */
00176   } G2HNLSPrivated;
00177 
00178  
00179 /* ////////////////////////////////////////////////////////////////////////// */
00180 extern G2HNLPrivated *_g2h_nlprivd;
00181 
00182 /* ////////////////////////////////////////////////////////////////////////// */
00183 void _g2h_GetDiPatchCurvesd ( GHoleDomaind *domain, int i,
00184                     point2d **c00, vector2d **c01, vector2d **c02,
00185                     point2d **c10, vector2d **c11, vector2d **c12,
00186                     point2d **d00, vector2d **d01, vector2d **d02,
00187                     point2d **d10, vector2d **d11, vector2d **d12 );
00188 boolean _g2h_GetABasisAuxpd ( GHoleDomaind *domain, int fn,
00189                               double *br0, double *br0cr1, double *br0cr2 );
00190 boolean _g2h_GetBBasisAuxpd ( GHoleDomaind *domain, int fn,
00191                               double *bezfc, double *fcomc,
00192                               double *fcomcd, double *fcomcdd );
00193 void _g2h_GetBFAPatchCurvesd ( GHoleDomaind *domain, int fn, int i,
00194                     double **c00, double **c01, double **c02,
00195                     double **d00, double **d01, double **d02 );
00196 void _g2h_GetBFBPatchCurvesd ( GHoleDomaind *domain, int fn, int i,
00197                     double **c00, double **c01, double **c02,
00198                     double **c10, double **c11, double **c12,
00199                     double **d00, double **d01, double **d02,
00200                     double **d10, double **d11, double **d12 );
00201 
00202 boolean _g2h_TabDiPatchJac3d ( int nkn, const double *kn, const double *hfunc,
00203         const double *dhfunc, const double *ddhfunc, const double *dddhfunc,   
00204         const vector2d *c00, const vector2d *c01, const vector2d *c02,      
00205         const vector2d *c10, const vector2d *c11, const vector2d *c12,      
00206         const vector2d *d00, const vector2d *d01, const vector2d *d02,      
00207         const vector2d *d10, const vector2d *d11, const vector2d *d12,      
00208         double *jac, double *trd );
00209 boolean _g2h_TabLaplacianGradd ( int nkn, const double *tkn,
00210         const double *hfunc, const double *dhfunc, const double *ddhfunc,
00211         const double *dddhfunc,
00212         const double *fc00, const double *fc01, const double *fc02,
00213         const double *fc10, const double *fc11, const double *fc12,
00214         const double *fd00, const double *fd01, const double *fd02,
00215         const double *fd10, const double *fd11, const double *fd12,
00216         const double *trd,
00217         vector2d *lapgrad );
00218 boolean _g2h_TabLaplacianGrad0d ( int nkn, const double *tkn,
00219         const double *hfunc, const double *dhfunc, const double *ddhfunc,
00220         const double *dddhfunc,
00221         const double *fc00, const double *fc01, const double *fc02,
00222         const double *fd00, const double *fd01, const double *fd02,
00223         const double *trd,
00224         vector2d *lapgrad );
00225 
00226 boolean _g2h_VerifyJunctionFunctionsd ( GHoleDomaind *domain );
00227 boolean _g2h_VerifyDomPatchesd ( GHoleDomaind *domain );
00228                                                     
00229 /* ////////////////////////////////////////////////////////////////////////// */
00230 void g2h_ReflectVectorsd ( int n, const vector3d *v, vector3d *w );
00231 void g2h_nonlinoutpatchd ( int n, int m, const double *cp, void *usrptr );
00232 boolean _g2h_StopItd ( int itn, double gn0, double gn,
00233                        double cn, double dcn, double scf );
00234 boolean g2h_GetHoleSurrndPatchd ( GHoleDomaind *domain,       
00235                                   const point3d *hole_cp,
00236                                   int i, int j, point3d *bcp );
00237 boolean _g2h_ComputeNLNormald ( GHoleDomaind *domain,       
00238                                 G2HNLPrivated *nlprivate,       
00239                                 const point3d *hole_cp );
00240 boolean _g2h_TabNLDer0d ( GHoleDomaind *domain,
00241              int nkn, const double *tkn,       
00242              const double *hfunc, const double *dhfunc,
00243              const double *ddhfunc, const double *dddhfunc,
00244              vector2d *diu, vector2d *div,
00245              vector2d *diuu, vector2d *diuv, vector2d *divv,
00246              vector2d *diuuu, vector2d *diuuv, vector2d *diuvv, vector2d *divvv,
00247              double *fc00, double *fc01, double *fc02,
00248              double *fd00, double *fd01, double *fd02,
00249              double *psiu, double *psiv, 
00250              double *psiuu, double *psiuv, double *psivv,
00251              double *psiuuu, double *psiuuv, double *psiuvv, double *psivvv );
00252 boolean _g2h_TabNLDerd ( GHoleDomaind *domain,
00253              int nkn, double *tkn,       
00254              const double *hfunc, const double *dhfunc,
00255              const double *ddhfunc, const double *dddhfunc,
00256              vector2d *diu, vector2d *div,
00257              vector2d *diuu, vector2d *diuv, vector2d *divv,
00258              vector2d *diuuu, vector2d *diuuv, vector2d *diuvv, vector2d *divvv,
00259              double *fc00, double *fc01, double *fc02,
00260              double *fc10, double *fc11, double *fc12,
00261              double *fd00, double *fd01, double *fd02,
00262              double *fd10, double *fd11, double *fd12,
00263              double *psiu, double *psiv, 
00264              double *psiuu, double *psiuv, double *psivv,
00265              double *psiuuu, double *psiuuv, double *psiuvv, double *psivvv );
00266 boolean _g2h_TabNLBasisFunctionsd ( GHoleDomaind *domain,       
00267                                     G2HNLPrivated *nlpr );
00268 void _g2h_IntFunc1ad ( G2HNLFuncd *f, double *funct );
00269 void _g2h_IntFunc1bd ( G2HNLFuncd *f, double *funct );
00270 void _g2h_IntFunc1cd ( G2HNLFuncd *f, double *funct );
00271 void _g2h_IntFunc2bd ( G2HNLFuncd *f, double *grad );
00272 void _g2h_IntFunc2cd ( G2HNLFuncd *f, vector2d *Li, double *Bi, vector2d *BiLT,       
00273                        double *Di, double *grad );
00274 void _g2h_IntFunc3cd ( G2HNLFuncd *f, vector2d *Li, vector2d *Lj,       
00275                        vector2d *BiLT, vector2d *BjLT,       
00276                        double Di, double Dj, double *hessian );
00277  
00278 /* ////////////////////////////////////////////////////////////////////////// */
00279 /* the following horrible macros are used a number of times in the code. */
00280 /* They assume that some variables are declared and have proper initial */
00281 /* values */
00282 #define G2GetPolynomialAddresses(jfunc,b01,c01,f01,g01,b11,c11,f11,g11,\
00283     b02,c02,f02,g02,b12,c12,f12,g12,b01b01,twob01c01,c01c01,\
00284     f01f01,twof01g01,g01g01,b11b11,twob11c11,c11c11,\
00285     f11f11,twof11g11,g11g11)\
00286   b01 = jfunc; \
00287   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00288   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00289   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00290   g11 = &f11[hole_k*(G2_BF11DEG+1)];  b02 = &g11[hole_k*(G2_CG11DEG+1)]; \
00291   c02 = &b02[hole_k*(G2_BF02DEG+1)];  f02 = &c02[hole_k*(G2_CG02DEG+1)]; \
00292   g02 = &f02[hole_k*(G2_BF02DEG+1)];  b12 = &g02[hole_k*(G2_CG02DEG+1)]; \
00293   c12 = &b12[hole_k*(G2_BF12DEG+1)];  f12 = &c12[hole_k*(G2_CG12DEG+1)]; \
00294   g12 = &f12[hole_k*(G2_BF12DEG+1)]; \
00295   b01b01    = &g12[hole_k*(G2_CG12DEG+1)]; \
00296   twob01c01 = &b01b01[hole_k*(2*G2_BF01DEG+1)]; \
00297   c01c01    = &twob01c01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00298   f01f01    = &c01c01[hole_k*(2*G2_CG01DEG+1)]; \
00299   twof01g01 = &f01f01[hole_k*(2*G2_BF01DEG+1)]; \
00300   g01g01    = &twof01g01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00301   b11b11    = &g01g01[hole_k*(2*G2_CG01DEG+1)]; \
00302   twob11c11 = &b11b11[hole_k*(2*G2_BF11DEG+1)]; \
00303   c11c11    = &twob11c11[hole_k*(G2_BF11DEG+G2_CG11DEG+1)]; \
00304   f11f11    = &c11c11[hole_k*(2*G2_CG11DEG+1)]; \
00305   twof11g11 = &f11f11[hole_k*(2*G2_BF11DEG+1)]; \
00306   g11g11    = &twof11g11[hole_k*(G2_BF11DEG+G2_CG11DEG+1)]
00307 
00308 #define G2GetPolynomialAddresses0(jfunc,b01,c01,f01,g01,b11,c11,f11,g11,\
00309     b02,c02,f02,g02,b12,c12,f12,g12,b01b01,twob01c01,c01c01,\
00310     f01f01,twof01g01,g01g01)\
00311   b01 = jfunc; \
00312   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00313   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00314   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00315   g11 = &f11[hole_k*(G2_BF11DEG+1)];  b02 = &g11[hole_k*(G2_CG11DEG+1)]; \
00316   c02 = &b02[hole_k*(G2_BF02DEG+1)];  f02 = &c02[hole_k*(G2_CG02DEG+1)]; \
00317   g02 = &f02[hole_k*(G2_BF02DEG+1)];  b12 = &g02[hole_k*(G2_CG02DEG+1)]; \
00318   c12 = &b12[hole_k*(G2_BF12DEG+1)];  f12 = &c12[hole_k*(G2_CG12DEG+1)]; \
00319   g12 = &f12[hole_k*(G2_BF12DEG+1)]; \
00320   b01b01    = &g12[hole_k*(G2_CG12DEG+1)]; \
00321   twob01c01 = &b01b01[hole_k*(2*G2_BF01DEG+1)]; \
00322   c01c01    = &twob01c01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00323   f01f01    = &c01c01[hole_k*(2*G2_CG01DEG+1)]; \
00324   twof01g01 = &f01f01[hole_k*(2*G2_BF01DEG+1)]; \
00325   g01g01    = &twof01g01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]
00326 
00327 #define G2GetPolyAddr(jfunc,b01,c01,f01,g01,b11,c11,f11,g11)\
00328   b01 = jfunc; \
00329   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00330   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00331   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00332   g11 = &f11[hole_k*(G2_BF11DEG+1)]
00333 
00334 #define G2GetDiCrossAddresses() \
00335   dir0cr1 = privateG2->dicross; \
00336   diq0cr1 = &dir0cr1[hole_k*(G2_CROSS01DEG+1)]; \
00337   dir1cr1 = &diq0cr1[hole_k*(G2_CROSS01DEG+1)]; \
00338   diq1cr1 = &dir1cr1[hole_k*(G2_CROSS11DEG+1)]; \
00339   dir0cr2 = &diq1cr1[hole_k*(G2_CROSS11DEG+1)]; \
00340   diq0cr2 = &dir0cr2[hole_k*(G2_CROSS02DEG+1)]; \
00341   dir1cr2 = &diq0cr2[hole_k*(G2_CROSS02DEG+1)]; \
00342   diq1cr2 = &dir1cr2[hole_k*(G2_CROSS12DEG+1)]
00343 
00344 #define G2GetBFuncACrossAddresses() \
00345   bbr0 = privateG2->basis_a; \
00346   bbr0cr1 = &bbr0[nfunc_a*hole_k*(G2_CROSS00DEG+1)]; \
00347   bbq0cr1 = &bbr0cr1[nfunc_a*hole_k*(G2_CROSS01DEG+1)]; \
00348   bbr0cr2 = &bbq0cr1[nfunc_a*hole_k*(G2_CROSS01DEG+1)]; \
00349   bbq0cr2 = &bbr0cr2[nfunc_a*hole_k*(G2_CROSS02DEG+1)]
00350 
00351 #define G2GetBFuncBCrossAddresses() \
00352   bbr0 = privateG2->basis_b; \
00353   bbr1 = &bbr0[nfunc_b*hole_k*(G2_CROSS00DEG+1)]; \
00354   bbq1 = &bbr1[nfunc_b*hole_k*(G2_CROSS10DEG+1)]; \
00355   bbr0cr1 = &bbq1[nfunc_b*hole_k*(G2_CROSS10DEG+1)]; \
00356   bbq0cr1 = &bbr0cr1[nfunc_b*hole_k*(G2_CROSS01DEG+1)]; \
00357   bbr1cr1 = &bbq0cr1[nfunc_b*hole_k*(G2_CROSS01DEG+1)]; \
00358   bbq1cr1 = &bbr1cr1[nfunc_b*hole_k*(G2_CROSS11DEG+1)]; \
00359   bbr0cr2 = &bbq1cr1[nfunc_b*hole_k*(G2_CROSS11DEG+1)]; \
00360   bbq0cr2 = &bbr0cr2[nfunc_b*hole_k*(G2_CROSS02DEG+1)]; \
00361   bbr1cr2 = &bbq0cr2[nfunc_b*hole_k*(G2_CROSS02DEG+1)]; \
00362   bbq1cr2 = &bbr1cr2[nfunc_b*hole_k*(G2_CROSS12DEG+1)]
00363 
00364 #define G2GetFCAddresses() \
00365   fc01 = &fc00[hole_k*spdimen*(G2_CROSS00DEG+1)]; \
00366   fc02 = &fc01[hole_k*spdimen*(G2_CROSS01DEG+1)]; \
00367   fc10 = &fc02[hole_k*spdimen*(G2_CROSS02DEG+1)]; \
00368   fc11 = &fc10[hole_k*spdimen*(G2_CROSS10DEG+1)]; \
00369   fc12 = &fc11[hole_k*spdimen*(G2_CROSS11DEG+1)]; \
00370   fd00 = &fc12[hole_k*spdimen*(G2_CROSS12DEG+1)]; \
00371   fd01 = &fd00[hole_k*spdimen*(G2_CROSS00DEG+1)]; \
00372   fd02 = &fd01[hole_k*spdimen*(G2_CROSS01DEG+1)]; \
00373   fd10 = &fd02[hole_k*spdimen*(G2_CROSS02DEG+1)]; \
00374   fd11 = &fd10[hole_k*spdimen*(G2_CROSS10DEG+1)]; \
00375   fd12 = &fd11[hole_k*spdimen*(G2_CROSS11DEG+1)]
00376 
00377 /* ///////////////////////////////////////////////////////////////////////// */
00378 #define G2GetSFCAddresses() \
00379   sfc01 = &sfc00[hole_k*spdimen*(lastomcknot-G2_CROSS00DEG)]; \
00380   sfc02 = &sfc01[hole_k*spdimen*(lastpvknot-G2_CROSS01DEG)]; \
00381   sfd00 = &sfc02[hole_k*spdimen*(lastpvvknot-G2_CROSS02DEG)]; \
00382   sfd01 = &sfd00[hole_k*spdimen*(lastomcknot-G2_CROSS00DEG)]; \
00383   sfd02 = &sfd01[hole_k*spdimen*(lastpvknot-G2_CROSS01DEG)]
00384 
00385 /* ///////////////////////////////////////////////////////////////////////// */
00386 boolean _g2h_GetExtBlockAddressesd ( GHoleDomaind *domain,
00387                                      double **Aii, double **Aki, double **Akk,
00388                                      double **Bi, double **Bk, double **Lii );
00389 
00390 boolean _g2h_SetRightSided ( GHoleDomaind *domain,
00391                              int spdimen, CONST_ double *hole_cp,
00392                              double *fc00, double *b );
00393 boolean _g2h_OutputPatchesd ( GHoleDomaind *domain,
00394                        int spdimen, CONST_ double *x, double *fc00, void *usrptr,
00395                        void (*outpatch) ( int n, int m, const double *cp,
00396                                           void *usrptr ) );
00397 
00398 boolean _g2h_SetExtRightSided ( GHoleDomaind *domain,
00399                                 const double *Bi, const double *Bk,
00400                                 int spdimen, CONST_ double *hole_cp,
00401                                 double *fc00, double *b );
00402 boolean _g2h_OutputExtPatchesd ( GHoleDomaind *domain,
00403                            int spdimen, CONST_ double *x, double *fc00, void *usrptr,
00404                            void (*outpatch) ( int n, int m, const double *cp,
00405                                               void *usrptr ) );
00406 
00407 boolean _g2h_TabTensBezPolyDer3d ( int nkn, const double *tkn,
00408              double *tbez, double *tbezu, double *tbezv,
00409              double *tbezuu, double *tbezuv, double *tbezvv,
00410              double *tbezuuu, double *tbezuuv, double *tbezuvv, double *tbezvvv );
00411 
00412 /* ///////////////////////////////////////////////////////////////////////// */
00413 void _g2h_IntFunc1ad ( G2HNLFuncd *f, double *funct );
00414 void _g2h_IntFunc1bd ( G2HNLFuncd *f, double *funct );
00415 void _g2h_IntFunc1cd ( G2HNLFuncd *f, double *funct );
00416 void _g2h_IntFunc2bd ( G2HNLFuncd *f, double *grad ); 
00417 void _g2h_IntFunc2cd ( G2HNLFuncd *f, vector2d *Li, double *Bi, vector2d *BiLT,
00418                        double *Di, double *grad );
00419 void _g2h_IntFunc3cd ( G2HNLFuncd *f, vector2d *Li, vector2d *Lj,
00420                        vector2d *BiLT, vector2d *BjLT,
00421                        double Di, double Dj, double *hessian );
00422 
00423 /* ///////////////////////////////////////////////////////////////////////// */
00424 void g2h_DestroySPrivateDatad ( GHoleDomaind *domain );
00425 boolean _g2h_GetSplDBasisAuxpd ( GHoleDomaind *domain, int fn, int cn,
00426                    int *nzc, double *fcomc, double *fcomcd, double *fcomcdd );
00427 boolean _g2h_GetSplDBasisCrossDerd ( GHoleDomaind *domain, int fn, int cn,
00428                  double *fcomc, double *pv, double *pvv, double *pu, double *puu );
00429 
00430 boolean _g2h_TabBSFuncDer3d ( int deg, int lastknot, const double *knots,
00431                               int i0, int i1,
00432                               int n, const double *tkn, int *fkn, int *lkn,
00433                               double *b, double *bt, double *btt, double *bttt );
00434 void _g2h_TensDer3d ( double p, double pu, double puu, double puuu,
00435                       double q, double qv, double qvv, double qvvv,
00436                       double *pq );
00437 
00438 boolean _g2h_FuncDSuppd ( int hole_k, int nk, int m1, int fn, int i,
00439                           int *nzc, int *i0, int *i1, int *j0, int *j1 );
00440 
00441 boolean _g2h_SetSplRightSided ( GHoleDomaind *domain,
00442                                 int spdimen, CONST_ double *hole_cp,
00443                                 double *fc00, double *b );
00444 boolean _g2h_OutputSplPatchesd ( GHoleDomaind *domain,
00445                 int spdimen, CONST_ double *x, double *fc00, void *usrptr,
00446                 void (*outpatch) ( int n, int lknu, const double *knu,
00447                                    int m, int lknv, const double *knv,
00448                                    const double *cp, void *usrptr ) );
00449 
00450 #endif
00451