morph_mesh: Morph a mesh

Description Usage Arguments Value Source Examples

Description

The function morphs the mesh according to movements of morphing points, locations of constrains and parameters. The morphing technique is based on Gaussian Processes with zero mean.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
morph_mesh(
  mesh,
  airfoil,
  morph_up,
  morph_lo,
  constr_up,
  constr_lo,
  par_up,
  par_lo,
  theta,
  theta_constr
)

Arguments

mesh

A list containing three elements: head, coord and tail.

airfoil

A data frame having three columns: x coordinates of points, y coordinates of the upper points and y coordinates of the lower points.

morph_up

A list containing a logical vector indicating selected upper points and a data frame consisting of coordinates of the points.

morph_lo

A list containing a logical vector indicating selected lower points and a data frame consisting of coordinates of the points.

constr_up

A list of two elements: a logical vector indicating which points are selected as upper constraints and a data frame containing coordinates of the selected points.

constr_lo

A list of two elements: a logical vector indicating which points are selected as lower constraints and a data frame containing coordinates of the selected points.

par_up

A vector of displacements for the upper morphing points.

par_lo

A vector of displacements for the lower morphing points.

theta

A vector of covariance radii for the morphing points.

theta_constr

A vector of covariance radii for the constraining points.

Value

The output list contains: a head of the file ($head), modified mesh points ($coord) and a file tail ($tail).

Source

https://arxiv.org/abs/1311.6190

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Select constraint points
constr_up <- select_constr(rae2822_airfoil, "up", rbind(c(0, 0), c(1, 1)))
constr_lo <- select_constr(rae2822_airfoil, "lo", rbind(c(0, 0), c(1, 1)))

# Select morphing points
x_coord <- seq(0.15, 0.9, len = 5)
morph_up <- select_morphp(rae2822_airfoil, "up", x_coord)
morph_lo <- select_morphp(rae2822_airfoil, "lo", x_coord)

# Set parameters values
par_up <- rep(0.02, len = 5)
par_lo <- rep(0, len = 5)

# Set covariance radii
theta <- c(0.1, 0.1)
theta_constr <- c(0.01, 0.01)

# Create a modified mesh
mesh_mod <- morph_mesh(
  rae2822_mesh, rae2822_airfoil,
  morph_up, morph_lo, constr_up, constr_lo,
  par_up, par_lo, theta, theta_constr
)

# Plot the modified mesh
plot_mesh(mesh_mod, rae2822_airfoil)

kmarchlewski/morphfoil documentation built on Oct. 8, 2020, 5:34 p.m.