~johan-hake/dolfin/dolfin-logger

« back to all changes in this revision

Viewing changes to demo/pde/cahn-hilliard/cpp/CahnHilliard2D.cpp

  • Committer: Anders Logg
  • Date: 2011-05-01 22:01:45 UTC
  • mfrom: (5839.1.29 dolfin-all)
  • Revision ID: logg@simula.no-20110501220145-60ys4e77qbc0mq32
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
3807
3807
    
3808
3808
    
3809
3809
    // Array of quadrature weights.
3810
 
    static const double W9[9] = {0.055814420483044, 0.063678085099885, 0.019396383305959, 0.089303072772871, 0.101884936159816, 0.031034213289535, 0.055814420483044, 0.063678085099885, 0.019396383305959};
3811
 
    // Quadrature points on the UFC reference element: (0.102717654809626, 0.088587959512704), (0.066554067839165, 0.409466864440735), (0.023931132287081, 0.787659461760847), (0.455706020243648, 0.088587959512704), (0.295266567779633, 0.409466864440735), (0.106170269119576, 0.787659461760847), (0.808694385677670, 0.088587959512704), (0.523979067720101, 0.409466864440735), (0.188409405952072, 0.787659461760847)
 
3810
    static const double W6[6] = {0.054975871827661, 0.054975871827661, 0.054975871827661, 0.111690794839005, 0.111690794839005, 0.111690794839005};
 
3811
    // Quadrature points on the UFC reference element: (0.816847572980459, 0.091576213509771), (0.091576213509771, 0.816847572980459), (0.091576213509771, 0.091576213509771), (0.108103018168070, 0.445948490915965), (0.445948490915965, 0.108103018168070), (0.445948490915965, 0.445948490915965)
3812
3812
    
3813
3813
    // Value of basis functions at quadrature points.
3814
 
    static const double FE1_C0[9][3] = \
3815
 
    {{0.808694385677670, 0.102717654809626, 0.088587959512704},
3816
 
    {0.523979067720101, 0.066554067839165, 0.409466864440735},
3817
 
    {0.188409405952072, 0.023931132287081, 0.787659461760847},
3818
 
    {0.455706020243648, 0.455706020243648, 0.088587959512704},
3819
 
    {0.295266567779633, 0.295266567779633, 0.409466864440735},
3820
 
    {0.106170269119576, 0.106170269119577, 0.787659461760847},
3821
 
    {0.102717654809626, 0.808694385677670, 0.088587959512704},
3822
 
    {0.066554067839164, 0.523979067720101, 0.409466864440735},
3823
 
    {0.023931132287081, 0.188409405952072, 0.787659461760847}};
 
3814
    static const double FE1_C0[6][3] = \
 
3815
    {{0.091576213509770, 0.816847572980459, 0.091576213509771},
 
3816
    {0.091576213509770, 0.091576213509771, 0.816847572980459},
 
3817
    {0.816847572980458, 0.091576213509771, 0.091576213509771},
 
3818
    {0.445948490915965, 0.108103018168070, 0.445948490915965},
 
3819
    {0.445948490915965, 0.445948490915965, 0.108103018168070},
 
3820
    {0.108103018168070, 0.445948490915965, 0.445948490915965}};
3824
3821
    
3825
3822
    // Array of non-zero columns
3826
3823
    static const unsigned int nzc0[3] = {0, 1, 2};
3828
3825
    // Array of non-zero columns
3829
3826
    static const unsigned int nzc3[3] = {3, 4, 5};
3830
3827
    
3831
 
    static const double FE1_C0_D01[9][2] = \
 
3828
    static const double FE1_C0_D01[6][2] = \
3832
3829
    {{-1.000000000000000, 1.000000000000000},
3833
3830
    {-1.000000000000000, 1.000000000000000},
3834
3831
    {-1.000000000000000, 1.000000000000000},
3835
3832
    {-1.000000000000000, 1.000000000000000},
3836
3833
    {-1.000000000000000, 1.000000000000000},
3837
 
    {-1.000000000000000, 1.000000000000000},
3838
 
    {-1.000000000000000, 1.000000000000000},
3839
 
    {-1.000000000000000, 1.000000000000000},
3840
3834
    {-1.000000000000000, 1.000000000000000}};
3841
3835
    
3842
3836
    // Array of non-zero columns
3872
3866
    // Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
3873
3867
    
3874
3868
    // Loop quadrature points for integral.
3875
 
    // Number of operations to compute element tensor for following IP loop = 1755
3876
 
    for (unsigned int ip = 0; ip < 9; ip++)
 
3869
    // Number of operations to compute element tensor for following IP loop = 1170
 
3870
    for (unsigned int ip = 0; ip < 6; ip++)
3877
3871
    {
3878
3872
      
3879
3873
      // Coefficient declarations.
3888
3882
      // Number of operations to compute ip constants: 12
3889
3883
      double I[8];
3890
3884
      // Number of operations: 1
3891
 
      I[0] = W9[ip]*det;
 
3885
      I[0] = W6[ip]*det;
3892
3886
      
3893
3887
      // Number of operations: 5
3894
 
      I[1] = W9[ip]*(G[0] + F0*(G[2] + F0*G[1]));
3895
 
      
3896
 
      // Number of operations: 1
3897
 
      I[2] = G[3]*W9[ip];
3898
 
      
3899
 
      // Number of operations: 1
3900
 
      I[3] = G[4]*W9[ip];
3901
 
      
3902
 
      // Number of operations: 1
3903
 
      I[4] = G[5]*W9[ip];
3904
 
      
3905
 
      // Number of operations: 1
3906
 
      I[5] = G[6]*W9[ip];
3907
 
      
3908
 
      // Number of operations: 1
3909
 
      I[6] = G[7]*W9[ip];
3910
 
      
3911
 
      // Number of operations: 1
3912
 
      I[7] = G[8]*W9[ip];
 
3888
      I[1] = W6[ip]*(G[0] + F0*(G[2] + F0*G[1]));
 
3889
      
 
3890
      // Number of operations: 1
 
3891
      I[2] = G[3]*W6[ip];
 
3892
      
 
3893
      // Number of operations: 1
 
3894
      I[3] = G[4]*W6[ip];
 
3895
      
 
3896
      // Number of operations: 1
 
3897
      I[4] = G[5]*W6[ip];
 
3898
      
 
3899
      // Number of operations: 1
 
3900
      I[5] = G[6]*W6[ip];
 
3901
      
 
3902
      // Number of operations: 1
 
3903
      I[6] = G[7]*W6[ip];
 
3904
      
 
3905
      // Number of operations: 1
 
3906
      I[7] = G[8]*W6[ip];
3913
3907
      
3914
3908
      
3915
3909
      // Number of operations for primary indices: 81
4008
4002
    
4009
4003
    
4010
4004
    // Array of quadrature weights.
4011
 
    static const double W9[9] = {0.055814420483044, 0.063678085099885, 0.019396383305959, 0.089303072772871, 0.101884936159816, 0.031034213289535, 0.055814420483044, 0.063678085099885, 0.019396383305959};
4012
 
    // Quadrature points on the UFC reference element: (0.102717654809626, 0.088587959512704), (0.066554067839165, 0.409466864440735), (0.023931132287081, 0.787659461760847), (0.455706020243648, 0.088587959512704), (0.295266567779633, 0.409466864440735), (0.106170269119576, 0.787659461760847), (0.808694385677670, 0.088587959512704), (0.523979067720101, 0.409466864440735), (0.188409405952072, 0.787659461760847)
 
4005
    static const double W6[6] = {0.054975871827661, 0.054975871827661, 0.054975871827661, 0.111690794839005, 0.111690794839005, 0.111690794839005};
 
4006
    // Quadrature points on the UFC reference element: (0.816847572980459, 0.091576213509771), (0.091576213509771, 0.816847572980459), (0.091576213509771, 0.091576213509771), (0.108103018168070, 0.445948490915965), (0.445948490915965, 0.108103018168070), (0.445948490915965, 0.445948490915965)
4013
4007
    
4014
4008
    // Value of basis functions at quadrature points.
4015
 
    static const double FE1_C0[9][3] = \
4016
 
    {{0.808694385677670, 0.102717654809626, 0.088587959512704},
4017
 
    {0.523979067720101, 0.066554067839165, 0.409466864440735},
4018
 
    {0.188409405952072, 0.023931132287081, 0.787659461760847},
4019
 
    {0.455706020243648, 0.455706020243648, 0.088587959512704},
4020
 
    {0.295266567779633, 0.295266567779633, 0.409466864440735},
4021
 
    {0.106170269119576, 0.106170269119577, 0.787659461760847},
4022
 
    {0.102717654809626, 0.808694385677670, 0.088587959512704},
4023
 
    {0.066554067839164, 0.523979067720101, 0.409466864440735},
4024
 
    {0.023931132287081, 0.188409405952072, 0.787659461760847}};
 
4009
    static const double FE1_C0[6][3] = \
 
4010
    {{0.091576213509770, 0.816847572980459, 0.091576213509771},
 
4011
    {0.091576213509770, 0.091576213509771, 0.816847572980459},
 
4012
    {0.816847572980458, 0.091576213509771, 0.091576213509771},
 
4013
    {0.445948490915965, 0.108103018168070, 0.445948490915965},
 
4014
    {0.445948490915965, 0.445948490915965, 0.108103018168070},
 
4015
    {0.108103018168070, 0.445948490915965, 0.445948490915965}};
4025
4016
    
4026
4017
    // Array of non-zero columns
4027
4018
    static const unsigned int nzc0[3] = {0, 1, 2};
4029
4020
    // Array of non-zero columns
4030
4021
    static const unsigned int nzc3[3] = {3, 4, 5};
4031
4022
    
4032
 
    static const double FE1_C0_D01[9][2] = \
 
4023
    static const double FE1_C0_D01[6][2] = \
4033
4024
    {{-1.000000000000000, 1.000000000000000},
4034
4025
    {-1.000000000000000, 1.000000000000000},
4035
4026
    {-1.000000000000000, 1.000000000000000},
4036
4027
    {-1.000000000000000, 1.000000000000000},
4037
4028
    {-1.000000000000000, 1.000000000000000},
4038
 
    {-1.000000000000000, 1.000000000000000},
4039
 
    {-1.000000000000000, 1.000000000000000},
4040
 
    {-1.000000000000000, 1.000000000000000},
4041
4029
    {-1.000000000000000, 1.000000000000000}};
4042
4030
    
4043
4031
    // Array of non-zero columns
4076
4064
    // Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
4077
4065
    
4078
4066
    // Loop quadrature points for integral.
4079
 
    // Number of operations to compute element tensor for following IP loop = 945
4080
 
    for (unsigned int ip = 0; ip < 9; ip++)
 
4067
    // Number of operations to compute element tensor for following IP loop = 630
 
4068
    for (unsigned int ip = 0; ip < 6; ip++)
4081
4069
    {
4082
4070
      
4083
4071
      // Coefficient declarations.
4113
4101
      // Number of operations to compute ip constants: 35
4114
4102
      double I[6];
4115
4103
      // Number of operations: 8
4116
 
      I[0] = W9[ip]*(F4*(G[2] + F4*(G[1] + F4*G[0])) + F8*det);
 
4104
      I[0] = W6[ip]*(F4*(G[2] + F4*(G[1] + F4*G[0])) + F8*det);
4117
4105
      
4118
4106
      // Number of operations: 3
4119
 
      I[1] = W9[ip]*det*(F4 - F5);
4120
 
      
4121
 
      // Number of operations: 8
4122
 
      I[2] = W9[ip]*(F0*G[3] + F1*G[4] + F2*G[5] + F3*G[6]);
4123
 
      
4124
 
      // Number of operations: 4
4125
 
      I[3] = W9[ip]*(F6*G[7] + F7*G[8]);
4126
 
      
4127
 
      // Number of operations: 4
4128
 
      I[4] = W9[ip]*(F6*G[8] + F7*G[9]);
4129
 
      
4130
 
      // Number of operations: 8
4131
 
      I[5] = W9[ip]*(F0*G[4] + F1*G[10] + F2*G[6] + F3*G[11]);
 
4107
      I[1] = W6[ip]*det*(F4 - F5);
 
4108
      
 
4109
      // Number of operations: 8
 
4110
      I[2] = W6[ip]*(F0*G[3] + F1*G[4] + F2*G[5] + F3*G[6]);
 
4111
      
 
4112
      // Number of operations: 4
 
4113
      I[3] = W6[ip]*(F6*G[7] + F7*G[8]);
 
4114
      
 
4115
      // Number of operations: 4
 
4116
      I[4] = W6[ip]*(F6*G[8] + F7*G[9]);
 
4117
      
 
4118
      // Number of operations: 8
 
4119
      I[5] = W6[ip]*(F0*G[4] + F1*G[10] + F2*G[6] + F3*G[11]);
4132
4120
      
4133
4121
      
4134
4122
      // Number of operations for primary indices: 12