MeshDeformation Namespace Reference

Namespace for the functions associated with the mesh deformation. More...

Functions

void deform_mesh (Mesh *const &mesh_pt)
 Deform the cubic mesh so that its six sides are all parabolic. More...
 
void exact_normal (const unsigned &face, const Vector< double > &x, Vector< double > &n)
 The exact normal vector for each face at global coordinate x. More...
 

Detailed Description

Namespace for the functions associated with the mesh deformation.

Namespace for function that represents the exact (quadratically-varying) outer unit normal. and the function the deforms the mesh

Namespace for functions that deform the cubic mesh into a shape with parabolic sides.

Function Documentation

◆ deform_mesh()

void MeshDeformation::deform_mesh ( Mesh *const &  mesh_pt)

Deform the cubic mesh so that its six sides are all parabolic.

57  {
58  unsigned n_node = mesh_pt->nnode();
59  for(unsigned n=0;n<n_node;n++)
60  {
61  Node* nod_pt = mesh_pt->node_pt(n);
62  double x = nod_pt->x(0) - 4;
63  double y = nod_pt->x(1) - 4;
64 
65  double X_new = 5 - y*y/16;
66  double Y_new = 3 + x*x/16;
67 
68  nod_pt->x(0) = X_new*x/4.0 + 4;
69  nod_pt->x(1) = Y_new*y/4.0 + 4;
70  }
71  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
Definition: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
Scalar * y
Definition: level1_cplx_impl.h:128
list x
Definition: plotDoE.py:28

References n, oomph::Mesh::nnode(), oomph::Mesh::node_pt(), plotDoE::x, oomph::Node::x(), and y.

Referenced by QFaceTestProblem< ELEMENT >::QFaceTestProblem(), TFaceTestProblem< ELEMENT >::TFaceTestProblem(), and TriangleFaceTestProblem< ELEMENT >::TriangleFaceTestProblem().

◆ exact_normal()

void MeshDeformation::exact_normal ( const unsigned face,
const Vector< double > &  x,
Vector< double > &  n 
)

The exact normal vector for each face at global coordinate x.

The outer unit normal of the mesh boundaries that have been deformed into parabolas. The normal is different for each boundary, so the input arguments are the boundary and the global Cartesian coordinate on that boundary, x. The outer unit normal is returned in the vector n.

Return the exact normal on the given face of the cubic mesh N.B. This is slightly different than the case in q_faces_3d.cc because the faces are labelled differently (DOH).

77  {
78  double N[2] = {0.0,0.0};
79  switch(face)
80  {
81  case 0:
82  N[0] = -(x[0]-4.0)/8.0;
83  N[1] = -1.0;
84  break;
85 
86  case 1:
87  N[0] = 1.0;
88  N[1] = (x[1]-4)/8.0;
89  break;
90 
91  case 2:
92  N[0] = -(x[0]-4)/8.0;
93  N[1] = 1.0;
94  break;
95 
96  case 3:
97  N[0] = -1.0;
98  N[1] = (x[1]-4)/8.0;
99  break;
100  }
101  double length = sqrt(N[0]*N[0] + N[1]*N[1]);
102  n[0] = N[0]/length;
103  n[1] = N[1]/length;
104 
105  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
@ N
Definition: constructor.cpp:22

References n, N, sqrt(), and plotDoE::x.

Referenced by QFaceTestProblem< ELEMENT >::QFaceTestProblem(), TFaceTestProblem< ELEMENT >::TFaceTestProblem(), and TriangleFaceTestProblem< ELEMENT >::TriangleFaceTestProblem().