Ignore:
Timestamp:
Apr 24, 2012, 2:26:14 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
b51c3b
Parents:
e3dbbf
Message:

Fix energy calculation.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1729 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/samples/bspline.cpp

    re3dbbf r716da7  
    2929
    3030BSpline::BSpline(const vmg_float& width) :
    31   spline_nom(BSPLINE_DEGREE/2+1),
    32   spline_denom(BSPLINE_DEGREE/2+1),
    33   potential_nom(BSPLINE_DEGREE/2+2),
    34   potential_denom(BSPLINE_DEGREE/2+2),
    35   intervals(BSPLINE_DEGREE/2+1),
     31  spline_nom((BSPLINE_DEGREE+1)/2),
     32  spline_denom((BSPLINE_DEGREE+1)/2),
     33  potential_nom((BSPLINE_DEGREE+1)/2+1),
     34  potential_denom((BSPLINE_DEGREE+1)/2+1),
     35  intervals((BSPLINE_DEGREE+1)/2),
    3636  R(width)
    3737{
     
    5656
    5757  potential_nom[1] = Polynomial(5,
    58                                 2.0*POW(R,5),
    59                                 -405.0*POW(R,4),
     58                                2.0     * POW(R,5),
     59                                -405.0  * POW(R,4),
    6060                                0.0,
    61                                 810.0*POW(R,2),
    62                                 -810.0*R,
     61                                810.0   * POW(R,2),
     62                                -810.0  * R,
    6363                                243.0);
    6464
     
    6969  potential_denom[2] = Polynomial(0, 1.0);
    7070
    71   antid = 13.0 / 48.0 * R;
     71  antid = 39.0 / (16.0 * R);
     72
     73#elif BSPLINE_DEGREE == 6
     74
     75  spline_nom[0] = Polynomial(5,
     76                             297.0     * POW(R,5),
     77                             0.0,
     78                             -2430.0   * POW(R,3),
     79                             0.0,
     80                             10935.0   * R,
     81                             -10935.0);
     82
     83  spline_nom[1] = Polynomial(5,
     84                             459.0    * POW(R,5),
     85                             2025.0   * POW(R,4),
     86                             -17010.0 * POW(R,3),
     87                             36450.0  * POW(R,2),
     88                             -32805.0 * R,
     89                             10935.0);
     90
     91  spline_nom[2] = Polynomial(5,
     92                             2187.0   * POW(R,5),
     93                             -10935.0 * POW(R,4),
     94                             21870.0  * POW(R,3),
     95                             -21870.0 * POW(R,2),
     96                             10935.0  * R,
     97                             -2187.0);
     98
     99  spline_denom[0] = Polynomial(0, 20.0 * Math::pi * POW(R,8));
     100  spline_denom[1] = Polynomial(0, 40.0 * Math::pi * POW(R,8));
     101  spline_denom[2] = Polynomial(0, 40.0 * Math::pi * POW(R,8));
     102
     103  potential_nom[0] = Polynomial(8,
     104                                0.0,
     105                                -956.0   * POW(R,7),
     106                                0.0,
     107                                2772.0   * POW(R,5),
     108                                0.0,
     109                                -6804.0  * POW(R,3),
     110                                0.0,
     111                                14580.0  * R,
     112                                -10935.0);
     113
     114  potential_nom[1] = Polynomial(8,
     115                                -5.0      * POW(R,8),
     116                                -5676.0   * POW(R,7),
     117                                0.0,
     118                                12852.0   * POW(R,5),
     119                                28350.0   * POW(R,4),
     120                                -142884.0 * POW(R,3),
     121                                204120.0  * POW(R,2),
     122                                -131220.0 * R,
     123                                32805.0);
     124
     125  potential_nom[2] = Polynomial(8,
     126                                169.0    * POW(R,8),
     127                                -2916.0  * POW(R,7),
     128                                0.0,
     129                                20412.0  * POW(R,5),
     130                                -51030.0 * POW(R,4),
     131                                61236.0  * POW(R,3),
     132                                -40824.0 * POW(R,2),
     133                                14580.0  * R,
     134                                -2187.0);
     135
     136  potential_nom[3]  = Polynomial(0, -1.0);
     137
     138  potential_denom[0] = Polynomial(0, 280.0 * POW(R,8));
     139  potential_denom[1] = Polynomial(0, 1680.0 * POW(R,8));
     140  potential_denom[2] = Polynomial(0, 560.0 * POW(R,8));
     141  potential_denom[3] = Polynomial(0, 0.0);
     142
     143  antid = 239.0 / (70.0 * R);
    72144
    73145#else
    74 #error B-Spline degree not supported. Choose 3.
     146#error B-Spline degree not supported. Choose 3 or 6.
    75147#endif /* BSPLINE_DEGREE */
    76148}
Note: See TracChangeset for help on using the changeset viewer.