~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/pde/convection-diffusion/cpp/main.cpp

  • Committer: Garth N. Wells
  • Date: 2008-03-29 09:34:25 UTC
  • Revision ID: gnw20@cam.ac.uk-20080329093425-3ea2vhjvccq56zvi
Add some basic build & install instructions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
using namespace dolfin;
17
17
 
18
 
int main(int argc, char *argv[])
 
18
int main()
19
19
{
20
20
  // Read mesh and sub domain markers
21
21
  Mesh mesh("../../../../data/meshes/dolfin-2.xml.gz");
43
43
  // Solution vector
44
44
  Function u1(mesh, x, a);
45
45
 
46
 
  // LU
47
 
  LUSolver lu;
48
 
 
49
46
  // Assemble matrix
50
47
  assemble(A, a, mesh);
51
 
  assemble(b, L, mesh);
52
 
  bc.apply(A, b, a);
53
 
  //lu.factorize(A);
54
 
 
 
48
  
55
49
  // Parameters for time-stepping
56
50
  real T = 2.0;
57
51
  real k = 0.05;
69
63
    bc.apply(A, b, a);
70
64
    
71
65
    // Solve the linear system
72
 
    //lu.factorized_solve(x, b);
73
 
    lu.solve(A, x, b);
 
66
    solve(A, x, b);
74
67
    
75
68
    // Save the solution to file
76
69
    file << u1;