~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/pde/elasticity/cpp/main.cpp

  • Committer: Anders Logg
  • Date: 2008-05-19 14:45:28 UTC
  • mfrom: (2668.4.3 trunk)
  • mto: (2668.8.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2670.
  • Revision ID: logg@simula.no-20080519144528-yu63r1268tq6408h
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Copyright (C) 2006-2007 Johan Jansson and Anders Logg.
2
2
// Licensed under the GNU LGPL Version 2.1.
3
3
//
4
 
// Modified by Garth N. Wells 2008
5
 
//
6
4
// First added:  2006-02-07
7
 
// Last changed: 2008-05-21
 
5
// Last changed: 2007-08-20
8
6
//
9
7
// This demo program solves the equations of static
10
8
// linear elasticity for a gear clamped at two of its
30
28
      values[1] = 0.0;
31
29
      values[2] = 0.0;
32
30
    }
 
31
 
33
32
  };
34
33
 
35
34
  // Sub domain for clamp at left end
66
65
      values[1] = y - x[1];
67
66
      values[2] = z - x[2];
68
67
    }
 
68
 
69
69
  };
70
70
 
71
71
  // Sub domain for rotation at right end
98
98
  bcs.push_back(&bcl);
99
99
  bcs.push_back(&bcr);
100
100
 
101
 
  // Set elasticity parameters
102
 
  real E  = 10.0;
103
 
  real nu = 0.3;
104
 
  Function mu(mesh, E / (2*(1 + nu)));
105
 
  Function lambda(mesh, E*nu / ((1 + nu)*(1 - 2*nu)));
106
 
 
107
101
  // Set up PDE
108
 
  ElasticityBilinearForm a(mu, lambda);
 
102
  ElasticityBilinearForm a;
109
103
  ElasticityLinearForm L(f);
110
104
  LinearPDE pde(a, L, mesh, bcs);
111
105