~ubuntu-branches/ubuntu/wily/dolfin/wily-proposed

« back to all changes in this revision

Viewing changes to demo/undocumented/functional/cpp/EnergyNorm.h

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2015-03-17 07:57:11 UTC
  • mfrom: (1.1.18) (19.1.24 experimental)
  • Revision ID: package-import@ubuntu.com-20150317075711-1v207zbty9qmygow
Tags: 1.5.0-1
* New upstream release (closes: #780359).
* debian/control:
  - Bump Standards-Version to 3.9.6 (no changes needed).
  - Bump X-Python-Version to >= 2.7.
  - Update package names for new SONAME 1.5 (libdolfin1.4 ->
    libdolfin1.5, libdolfin1.4-dbg -> libdolfin1.5-dbg and
    libdolfin1.4-dev -> libdolfin1.5-dev).
  - Bump minimum required version for python-instant, python-ufl and
    python-ffc to 1.5.0.
  - Add python-sympy and python-six to Depends for binary package
    python-dolfin.
  - Add dh-python to Build-Depends.
  - Remove libcgal-dev from {Build-}Depends.
* Remove CSGCGALMeshGenerator3D-oom.patch since CGAL is no longer used
  by DOLFIN.
* Move debian/libdolfin1.4.install -> debian/libdolfin1.5.install.
* debian/rules: No longer any non DFSG-free stuff to remove, so update
  get-orig-source target (update debian/watch accordingly).
* Update debian/copyright and debian/copyright_hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// This code conforms with the UFC specification version 1.4.0
2
 
// and was automatically generated by FFC version 1.4.0.
 
1
// This code conforms with the UFC specification version 1.5.0
 
2
// and was automatically generated by FFC version 1.5.0.
3
3
//
4
4
// This code was generated with the option '-l dolfin' and
5
5
// contains DOLFIN-specific wrappers that depend on DOLFIN.
515
515
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
516
516
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
517
517
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
518
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
519
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
518
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
519
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
520
520
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
521
521
      
522
522
      static const double dmats1[6][6] = \
523
523
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
524
524
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
525
525
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
526
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
527
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
528
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
526
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
527
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
528
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
529
529
      
530
530
      // Compute reference derivatives.
531
531
      // Declare array of derivatives on FIAT element.
666
666
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
667
667
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
668
668
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
669
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
670
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
669
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
670
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
671
671
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
672
672
      
673
673
      static const double dmats1[6][6] = \
674
674
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
675
675
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
676
676
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
677
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
678
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
679
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
677
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
678
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
679
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
680
680
      
681
681
      // Compute reference derivatives.
682
682
      // Declare array of derivatives on FIAT element.
817
817
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
818
818
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
819
819
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
820
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
821
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
820
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
821
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
822
822
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
823
823
      
824
824
      static const double dmats1[6][6] = \
825
825
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
826
826
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
827
827
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
828
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
829
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
830
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
828
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
829
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
830
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
831
831
      
832
832
      // Compute reference derivatives.
833
833
      // Declare array of derivatives on FIAT element.
968
968
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
969
969
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
970
970
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
971
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
972
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
971
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
972
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
973
973
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
974
974
      
975
975
      static const double dmats1[6][6] = \
976
976
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
977
977
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
978
978
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
979
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
980
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
981
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
979
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
980
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
981
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
982
982
      
983
983
      // Compute reference derivatives.
984
984
      // Declare array of derivatives on FIAT element.
1119
1119
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1120
1120
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
1121
1121
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1122
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
1123
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
1122
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
1123
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
1124
1124
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
1125
1125
      
1126
1126
      static const double dmats1[6][6] = \
1127
1127
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1128
1128
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
1129
1129
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
1130
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
1131
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
1132
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
1130
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
1131
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
1132
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
1133
1133
      
1134
1134
      // Compute reference derivatives.
1135
1135
      // Declare array of derivatives on FIAT element.
1270
1270
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1271
1271
      {4.89897948556635, 0.0, 0.0, 0.0, 0.0, 0.0},
1272
1272
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1273
 
      {0.0, 9.48683298050514, 0.0, 0.0, 0.0, 0.0},
1274
 
      {4, 0.0, 7.07106781186548, 0.0, 0.0, 0.0},
 
1273
      {0.0, 9.48683298050515, 0.0, 0.0, 0.0, 0.0},
 
1274
      {3.99999999999999, 0.0, 7.07106781186547, 0.0, 0.0, 0.0},
1275
1275
      {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
1276
1276
      
1277
1277
      static const double dmats1[6][6] = \
1278
1278
      {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
1279
1279
      {2.44948974278318, 0.0, 0.0, 0.0, 0.0, 0.0},
1280
1280
      {4.24264068711928, 0.0, 0.0, 0.0, 0.0, 0.0},
1281
 
      {2.58198889747161, 4.74341649025257, -0.912870929175278, 0.0, 0.0, 0.0},
1282
 
      {2.0, 6.12372435695795, 3.53553390593274, 0.0, 0.0, 0.0},
1283
 
      {-2.3094010767585, 0.0, 8.16496580927726, 0.0, 0.0, 0.0}};
 
1281
      {2.58198889747162, 4.74341649025257, -0.91287092917528, 0.0, 0.0, 0.0},
 
1282
      {1.99999999999991, 6.12372435695794, 3.53553390593273, 0.0, 0.0, 0.0},
 
1283
      {-2.30940107675849, 0.0, 8.16496580927727, 0.0, 0.0, 0.0}};
1284
1284
      
1285
1285
      // Compute reference derivatives.
1286
1286
      // Declare array of derivatives on FIAT element.
1850
1850
  }
1851
1851
 
1852
1852
  /// Tabulate the coordinates of all dofs on a cell
1853
 
  virtual void tabulate_coordinates(double** dof_coordinates,
 
1853
  virtual void tabulate_coordinates(double* dof_coordinates,
1854
1854
                                    const double* vertex_coordinates) const
1855
1855
  {
1856
 
    dof_coordinates[0][0] = vertex_coordinates[0];
1857
 
    dof_coordinates[0][1] = vertex_coordinates[1];
1858
 
    dof_coordinates[1][0] = vertex_coordinates[2];
1859
 
    dof_coordinates[1][1] = vertex_coordinates[3];
1860
 
    dof_coordinates[2][0] = vertex_coordinates[4];
1861
 
    dof_coordinates[2][1] = vertex_coordinates[5];
1862
 
    dof_coordinates[3][0] = 0.5*vertex_coordinates[2] + 0.5*vertex_coordinates[4];
1863
 
    dof_coordinates[3][1] = 0.5*vertex_coordinates[3] + 0.5*vertex_coordinates[5];
1864
 
    dof_coordinates[4][0] = 0.5*vertex_coordinates[0] + 0.5*vertex_coordinates[4];
1865
 
    dof_coordinates[4][1] = 0.5*vertex_coordinates[1] + 0.5*vertex_coordinates[5];
1866
 
    dof_coordinates[5][0] = 0.5*vertex_coordinates[0] + 0.5*vertex_coordinates[2];
1867
 
    dof_coordinates[5][1] = 0.5*vertex_coordinates[1] + 0.5*vertex_coordinates[3];
 
1856
    dof_coordinates[0] = vertex_coordinates[0];
 
1857
    dof_coordinates[1] = vertex_coordinates[1];
 
1858
    dof_coordinates[2] = vertex_coordinates[2];
 
1859
    dof_coordinates[3] = vertex_coordinates[3];
 
1860
    dof_coordinates[4] = vertex_coordinates[4];
 
1861
    dof_coordinates[5] = vertex_coordinates[5];
 
1862
    dof_coordinates[6] = 0.5*vertex_coordinates[2] + 0.5*vertex_coordinates[4];
 
1863
    dof_coordinates[7] = 0.5*vertex_coordinates[3] + 0.5*vertex_coordinates[5];
 
1864
    dof_coordinates[8] = 0.5*vertex_coordinates[0] + 0.5*vertex_coordinates[4];
 
1865
    dof_coordinates[9] = 0.5*vertex_coordinates[1] + 0.5*vertex_coordinates[5];
 
1866
    dof_coordinates[10] = 0.5*vertex_coordinates[0] + 0.5*vertex_coordinates[2];
 
1867
    dof_coordinates[11] = 0.5*vertex_coordinates[1] + 0.5*vertex_coordinates[3];
1868
1868
  }
1869
1869
 
1870
1870
  /// Return the number of sub dofmaps (for a mixed element)
1952
1952
    {-0.0847304930939778, -0.048208377815512, -0.0482083778155119, 0.795480226200906, 0.192833511262048, 0.192833511262048}};
1953
1953
    
1954
1954
    static const double FE0_D01[6][5] = \
1955
 
    {{0.633695145960921, -0.633695145960916, 3.26739029192183, 0.0, -3.26739029192184},
1956
 
    {0.63369514596092, 2.26739029192184, 0.366304854039083, -2.90108543788276, -0.366304854039083},
1957
 
    {-2.26739029192183, -0.633695145960916, 0.366304854039083, 2.90108543788275, -0.366304854039083},
1958
 
    {-0.78379396366386, 0.78379396366386, 0.432412072672279, 0.0, -0.432412072672279},
1959
 
    {-0.783793963663859, -0.567587927327719, 1.78379396366386, 1.35138189099158, -1.78379396366386},
1960
 
    {0.567587927327721, 0.78379396366386, 1.78379396366386, -1.35138189099158, -1.78379396366386}};
 
1955
    {{0.633695145960915, -0.633695145960916, 3.26739029192182, 0.0, -3.26739029192184},
 
1956
    {0.633695145960915, 2.26739029192184, 0.366304854039066, -2.90108543788275, -0.366304854039082},
 
1957
    {-2.26739029192184, -0.633695145960916, 0.366304854039073, 2.90108543788276, -0.366304854039083},
 
1958
    {-0.783793963663865, 0.783793963663862, 0.432412072672267, 0.0, -0.432412072672279},
 
1959
    {-0.783793963663864, -0.567587927327719, 1.78379396366385, 1.35138189099159, -1.78379396366386},
 
1960
    {0.567587927327715, 0.783793963663862, 1.78379396366385, -1.35138189099157, -1.78379396366386}};
1961
1961
    
1962
1962
    // Array of non-zero columns
1963
1963
    static const unsigned int nzc0[5] = {0, 2, 3, 4, 5};
1964
1964
    
1965
1965
    static const double FE0_D10[6][5] = \
1966
 
    {{0.63369514596092, 2.26739029192184, 0.366304854039083, -0.366304854039083, -2.90108543788276},
1967
 
    {0.633695145960921, -0.633695145960916, 3.26739029192183, -3.26739029192183, 0.0},
1968
 
    {-2.26739029192183, -0.633695145960916, 0.366304854039083, -0.366304854039083, 2.90108543788275},
1969
 
    {-0.78379396366386, -0.56758792732772, 1.78379396366386, -1.78379396366386, 1.35138189099158},
1970
 
    {-0.78379396366386, 0.78379396366386, 0.432412072672279, -0.432412072672279, 0.0},
1971
 
    {0.56758792732772, 0.78379396366386, 1.78379396366386, -1.78379396366386, -1.35138189099158}};
 
1966
    {{0.633695145960923, 2.26739029192184, 0.366304854039083, -0.366304854039083, -2.90108543788276},
 
1967
    {0.633695145960919, -0.633695145960917, 3.26739029192183, -3.26739029192183, 0.0},
 
1968
    {-2.26739029192183, -0.633695145960919, 0.366304854039083, -0.366304854039083, 2.90108543788275},
 
1969
    {-0.78379396366386, -0.567587927327721, 1.78379396366386, -1.78379396366386, 1.35138189099158},
 
1970
    {-0.783793963663859, 0.783793963663859, 0.432412072672279, -0.432412072672279, 0.0},
 
1971
    {0.567587927327721, 0.783793963663861, 1.78379396366386, -1.78379396366386, -1.35138189099158}};
1972
1972
    
1973
1973
    // Array of non-zero columns
1974
1974
    static const unsigned int nzc1[5] = {0, 1, 3, 4, 5};
1997
1997
      // Total number of operations to compute function values = 20
1998
1998
      for (unsigned int r = 0; r < 5; r++)
1999
1999
      {
2000
 
        F0 += FE0_D10[ip][r]*w[0][nzc1[r]];
2001
 
        F1 += FE0_D01[ip][r]*w[0][nzc0[r]];
 
2000
        F1 += FE0_D10[ip][r]*w[0][nzc1[r]];
 
2001
        F2 += FE0_D01[ip][r]*w[0][nzc0[r]];
2002
2002
      } // end loop over 'r'
2003
2003
      
2004
2004
      // Total number of operations to compute function values = 12
2005
2005
      for (unsigned int r = 0; r < 6; r++)
2006
2006
      {
2007
 
        F2 += FE0[ip][r]*w[0][r];
 
2007
        F0 += FE0[ip][r]*w[0][r];
2008
2008
      } // end loop over 'r'
2009
2009
      
2010
2010
      // Number of operations to compute ip constants: 11
2011
2011
      double I[1];
2012
2012
      // Number of operations: 11
2013
 
      I[0] = W6[ip]*(F0*F0*G[0] + F1*(F0*G[1] + F1*G[2]) + F2*F2*det);
 
2013
      I[0] = W6[ip]*(F0*F0*det + F1*F1*G[0] + F2*(F1*G[1] + F2*G[2]));
2014
2014
      
2015
2015
      
2016
2016
      // Number of operations for primary indices: 1
2055
2055
  /// Return a string identifying the form
2056
2056
  virtual const char* signature() const
2057
2057
  {
2058
 
    return "0dfd02d62d6d8945b65768d880c6f92821097a1b9d0bc75f4f0a0cf0bcdbd257bbe2cad5401378a9dfb6e8fa63365373ddbbd17cb32517470b6d465580e6edf2";
 
2058
    return "98490660aa6f7c8728372c63f409769bc868518e4583907f9c1ca3093729a7af8e533376366146a5fd039bdec9ed300b3e1481d7ff5a82cbc29fb3070bcece2f";
 
2059
  }
 
2060
 
 
2061
  /// Return original coefficient position for each coefficient (0 <= i < n)
 
2062
  virtual std::size_t original_coefficient_position(std::size_t i) const
 
2063
  {
 
2064
    static const std::vector<std::size_t> position({0});
 
2065
    return position[i];
2059
2066
  }
2060
2067
 
2061
2068
  /// Return the rank of the global tensor (r)
2229
2236
 
2230
2237
// DOLFIN includes
2231
2238
#include <dolfin/common/NoDeleter.h>
2232
 
#include <dolfin/mesh/Restriction.h>
2233
2239
#include <dolfin/fem/FiniteElement.h>
2234
2240
#include <dolfin/fem/DofMap.h>
2235
2241
#include <dolfin/fem/Form.h>
2287
2293
    // Do nothing
2288
2294
  }
2289
2295
 
2290
 
  //--- Constructors for restricted function space, 2 different versions ---
2291
 
 
2292
 
  // Create restricted function space (reference version)
2293
 
  CoefficientSpace_v(const dolfin::Restriction& restriction):
2294
 
    dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction.mesh()),
2295
 
                          std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new energynorm_finite_element_0()))),
2296
 
                          std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new energynorm_dofmap_0()),
2297
 
                                                                                     reference_to_no_delete_pointer(restriction))))
2298
 
  {
2299
 
    // Do nothing
2300
 
  }
2301
 
 
2302
 
  // Create restricted function space (shared pointer version)
2303
 
  CoefficientSpace_v(std::shared_ptr<const dolfin::Restriction> restriction):
2304
 
    dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction->mesh()),
2305
 
                          std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new energynorm_finite_element_0()))),
2306
 
                          std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new energynorm_dofmap_0()),
2307
 
                                                                                     restriction)))
2308
 
  {
2309
 
    // Do nothing
2310
 
  }
2311
 
 
2312
 
  // Copy constructor
2313
 
  ~CoefficientSpace_v()
2314
 
  {
2315
 
  }
2316
 
 
2317
2296
};
2318
2297
 
2319
2298
typedef CoefficientSpace_v Form_M_FunctionSpace_0;