~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/mesh/ale/cpp/main.cpp

  • Committer: Anders Logg
  • Date: 2008-05-27 18:23:04 UTC
  • mto: (2668.1.38 trunk)
  • mto: This revision was merged to the branch mainline in revision 2670.
  • Revision ID: logg@simula.no-20080527182304-f37ol6ke7jyp30ig
Add first version of Hermite interpolation for ALE smoothing from Solveig

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
int main()
18
18
{
19
19
  // Create mesh
20
 
  UnitSquare mesh(32, 32);
 
20
  //UnitSquare mesh(3, 3);
 
21
  UnitCube mesh(3, 3, 3);
21
22
  plot(mesh);
22
23
 
23
24
  // Create boundary mesh
24
25
  MeshFunction<unsigned int> vertex_map;
25
 
  BoundaryMesh boundary(mesh, vertex_map);
 
26
  MeshFunction<unsigned int> cell_map;
 
27
  BoundaryMesh boundary(mesh, vertex_map, cell_map);
26
28
 
27
29
  // Move vertices in boundary
28
30
  for (VertexIterator v(boundary); !v.end(); ++v)
29
31
  {
30
32
    real* x = v->x();
31
33
    x[0] *= 3.0;
32
 
    x[1] += 0.1*sin(5.0*x[0]);
 
34
    //x[1] += 0.1*sin(5.0*x[0]);
33
35
  }
34
36
  plot(boundary);
35
 
 
 
37
 
36
38
  // Move mesh
37
 
  mesh.move(boundary, vertex_map);
 
39
  mesh.move(boundary, vertex_map, cell_map, hermite);
38
40
  plot(mesh);
39
41
 
40
42
  return 0;