Nek5000
SEM for Incompressible NS
|
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "c99.h"
#include "name.h"
#include "fail.h"
#include "types.h"
#include "mem.h"
#include "tensor.h"
#include "poly.h"
Go to the source code of this file.
Classes | |
struct | findpts_el_pt_3 |
struct | findpts_el_gface_3 |
struct | findpts_el_gedge_3 |
struct | findpts_el_gpt_3 |
struct | findpts_el_data_3 |
Macros | |
#define | findpts_el_setup_3 PREFIXED_NAME(findpts_el_setup_3) |
#define | findpts_el_free_3 PREFIXED_NAME(findpts_el_free_3 ) |
#define | findpts_el_3 PREFIXED_NAME(findpts_el_3 ) |
#define | findpts_el_eval_3 PREFIXED_NAME(findpts_el_eval_3 ) |
#define | DIAGNOSTICS_ITERATIONS 0 |
#define | CONVERGED_FLAG (1u<<6) |
#define | FLAG_MASK 0x7fu |
#define | DO_MAX(x) |
#define | SET_FACE(i, base, n) |
#define | SET_EDGE1(j, k, d, rd, rn, base) |
#define | SET_EDGE2(j, d, rd, rn, base) |
#define | SET_EDGE(j, rd, rn, base) |
#define | DXDN1(i, d) (fd->sides+base+(9*(i) +(d))*n) |
#define | D2XDN1(i, d) (fd->sides+base+(9*(i)+3+(d))*n) |
#define | D2XDN2(i, d) (fd->sides+base+(9*(i)+6+(d))*n) |
#define | CHECK_CONSTRAINT(drcd, d3) |
#define | SETDR(d) |
#define | SETR(d) |
#define | EVAL(r, s) -(y[0]*r+y[1]*s)+(r*A[0]*r+(2*r*A[1]+s*A[2])*s)/2 |
#define | SETR(d, d3) |
#define | EVAL(dr) (dr*A-2*y)*dr |
Typedefs | |
typedef void | compute_face_data_fun(struct findpts_el_data_3 *fd) |
typedef void | findpt_fun(struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
Functions | |
static void | lin_solve_3 (double x[3], const double A[9], const double y[3]) |
static void | lin_solve_sym_2 (double x[2], const double A[3], const double y[2]) |
static unsigned | num_constrained (const unsigned flags) |
static unsigned | pt_flags_to_bin_noC (const unsigned flags) |
static unsigned | pt_flags_to_bin (const unsigned flags) |
static unsigned | plus_1_mod_3 (const unsigned x) |
static unsigned | plus_2_mod_3 (const unsigned x) |
static unsigned | which_bit (const unsigned x) |
static unsigned | face_index (const unsigned x) |
static unsigned | edge_index (const unsigned x) |
static unsigned | point_index (const unsigned x) |
static unsigned | work_size (const unsigned nr, const unsigned ns, const unsigned nt, const unsigned npt_max) |
void | findpts_el_setup_3 (struct findpts_el_data_3 *const fd, const unsigned n[3], const unsigned npt_max) |
void | findpts_el_free_3 (struct findpts_el_data_3 *const fd) |
static void | compute_face_data_rs (struct findpts_el_data_3 *fd) |
static void | compute_face_data_st (struct findpts_el_data_3 *fd) |
static void | compute_face_data_tr (struct findpts_el_data_3 *fd) |
static const struct findpts_el_gface_3 * | get_face (struct findpts_el_data_3 *fd, unsigned fi) |
static void | compute_edge_data (struct findpts_el_data_3 *fd, unsigned d) |
static const struct findpts_el_gedge_3 * | get_edge (struct findpts_el_data_3 *fd, unsigned ei) |
static void | compute_pt_data (struct findpts_el_data_3 *fd) |
static const struct findpts_el_gpt_3 * | get_pt (struct findpts_el_data_3 *fd, unsigned pi) |
static int | reject_prior_step_q (struct findpts_el_pt_3 *const out, const double resid[3], const struct findpts_el_pt_3 *const p, const double tol) |
static void | newton_vol (struct findpts_el_pt_3 *const out, const double jac[9], const double resid[3], const struct findpts_el_pt_3 *const p, const double tol) |
static void | newton_face (struct findpts_el_pt_3 *const out, const double jac[9], const double rhes[3], const double resid[3], const unsigned d1, const unsigned d2, const unsigned dn, const unsigned flags, const struct findpts_el_pt_3 *const p, const double tol) |
static void | newton_edge (struct findpts_el_pt_3 *const out, const double jac[9], const double rhes, const double resid[3], const unsigned de, const unsigned dn1, const unsigned dn2, unsigned flags, const struct findpts_el_pt_3 *const p, const double tol) |
static void | findpt_vol (struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
static void | findpt_face (struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
static void | findpt_edge (struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
static void | findpt_pt (struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
static void | seed (struct findpts_el_data_3 *const fd, struct findpts_el_pt_3 *const pt, const unsigned npt) |
void | findpts_el_3 (struct findpts_el_data_3 *const fd, const unsigned npt, const double tol) |
void | findpts_el_eval_3 (double *const out_base, const unsigned out_stride, const double *const r_base, const unsigned r_stride, const unsigned pn, const double *const in, struct findpts_el_data_3 *const fd) |
#define CHECK_CONSTRAINT | ( | drcd, | |
d3 | |||
) |
Referenced by newton_vol().
#define CONVERGED_FLAG (1u<<6) |
Definition at line 72 of file findpts_el_3.c.
Referenced by findpt_pt(), newton_edge(), newton_face(), newton_vol(), and reject_prior_step_q().
Referenced by compute_edge_data().
Referenced by compute_edge_data().
#define DIAGNOSTICS_ITERATIONS 0 |
Definition at line 22 of file findpts_el_3.c.
#define DO_MAX | ( | x | ) |
Referenced by work_size().
Referenced by compute_edge_data().
Referenced by newton_edge(), and newton_face().
#define findpts_el_3 PREFIXED_NAME(findpts_el_3 ) |
Definition at line 16 of file findpts_el_3.c.
#define findpts_el_eval_3 PREFIXED_NAME(findpts_el_eval_3 ) |
Definition at line 17 of file findpts_el_3.c.
#define findpts_el_free_3 PREFIXED_NAME(findpts_el_free_3 ) |
Definition at line 15 of file findpts_el_3.c.
#define findpts_el_setup_3 PREFIXED_NAME(findpts_el_setup_3) |
Definition at line 14 of file findpts_el_3.c.
#define FLAG_MASK 0x7fu |
Definition at line 73 of file findpts_el_3.c.
Referenced by findpt_edge(), findpt_face(), findpt_pt(), findpts_el_3(), and reject_prior_step_q().
#define SET_EDGE | ( | j, | |
rd, | |||
rn, | |||
base | |||
) |
Referenced by findpts_el_setup_3().
#define SET_EDGE1 | ( | j, | |
k, | |||
d, | |||
rd, | |||
rn, | |||
base | |||
) |
#define SET_EDGE2 | ( | j, | |
d, | |||
rd, | |||
rn, | |||
base | |||
) |
Referenced by findpts_el_setup_3().
#define SETDR | ( | d | ) |
Referenced by newton_vol().
#define SETR | ( | d | ) |
Referenced by newton_face(), and newton_vol().
#define SETR | ( | d, | |
d3 | |||
) |
typedef void compute_face_data_fun(struct findpts_el_data_3 *fd) |
Definition at line 289 of file findpts_el_3.c.
typedef void findpt_fun(struct findpts_el_pt_3 *const out, struct findpts_el_data_3 *const fd, const struct findpts_el_pt_3 *const p, const unsigned pn, const double tol) |
Definition at line 915 of file findpts_el_3.c.
|
static |
Definition at line 364 of file findpts_el_3.c.
References D2XDN1, D2XDN2, DXDN1, findpts_el_data_3::edge, get_face(), i, n, findpts_el_data_3::n, nr, ns, plus_1_mod_3(), plus_2_mod_3(), tensor_mtxm, tensor_mxm(), work, findpts_el_data_3::work, findpts_el_data_3::wtend, and x.
Referenced by get_edge().
|
static |
Definition at line 292 of file findpts_el_3.c.
References findpts_el_data_3::face, findpts_el_data_3::n, nr, ns, out, findpts_el_data_3::sides, tensor_mxm(), work, findpts_el_data_3::work, findpts_el_data_3::wtend, findpts_el_gface_3::x, and findpts_el_data_3::x.
Referenced by get_face().
|
static |
Definition at line 310 of file findpts_el_3.c.
References i, findpts_el_data_3::n, nr, ns, out, findpts_el_data_3::sides, tensor_mtxm, work, findpts_el_data_3::work, findpts_el_data_3::wtend, and findpts_el_data_3::x.
Referenced by get_face().
|
static |
Definition at line 327 of file findpts_el_3.c.
References i, findpts_el_data_3::n, nr, ns, out, findpts_el_data_3::sides, tensor_mxm(), work, findpts_el_data_3::work, findpts_el_data_3::wtend, and findpts_el_data_3::x.
Referenced by get_face().
|
static |
Definition at line 414 of file findpts_el_3.c.
References findpts_el_gedge_3::d2xdn1, findpts_el_gedge_3::d2xdn2, findpts_el_gedge_3::dxdn1, findpts_el_gedge_3::dxdn2, get_edge(), findpts_el_gpt_3::hes, i, findpts_el_gpt_3::jac, findpts_el_data_3::n, nr, findpts_el_data_3::pt, tensor_mtxv(), work, findpts_el_data_3::work, findpts_el_data_3::wtend, x, findpts_el_gedge_3::x, and findpts_el_gpt_3::x.
Referenced by get_pt().
|
static |
Definition at line 111 of file findpts_el_3.c.
Referenced by findpt_edge(), and newton_vol().
|
static |
Definition at line 109 of file findpts_el_3.c.
References which_bit().
Referenced by findpt_face(), and newton_vol().
|
static |
Definition at line 1034 of file findpts_el_3.c.
References findpts_el_gedge_3::d2xdn1, findpts_el_gedge_3::d2xdn2, findpts_el_gedge_3::dxdn1, findpts_el_gedge_3::dxdn2, edge_index(), FLAG_MASK, findpts_el_pt_3::flags, get_edge(), i, findpts_el_data_3::lag, findpts_el_data_3::lag_data, n, findpts_el_data_3::n, newton_edge(), newton_face(), newton_vol(), plus_1_mod_3(), plus_2_mod_3(), findpts_el_pt_3::r, reject_prior_step_q(), tensor_dot, tensor_mtxv(), findpts_el_data_3::work, findpts_el_pt_3::x, and findpts_el_gedge_3::x.
Referenced by findpts_el_3().
|
static |
Definition at line 958 of file findpts_el_3.c.
References findpts_el_gface_3::dxdn, face_index(), FLAG_MASK, findpts_el_pt_3::flags, get_face(), findpts_el_gpt_3::hes, i, findpts_el_data_3::lag, findpts_el_data_3::lag_data, findpts_el_data_3::n, newton_face(), newton_vol(), plus_1_mod_3(), plus_2_mod_3(), findpts_el_pt_3::r, reject_prior_step_q(), tensor_dot, tensor_mtxm, tensor_mxm(), findpts_el_data_3::work, findpts_el_pt_3::x, and findpts_el_gface_3::x.
Referenced by findpts_el_3().
|
static |
Definition at line 1115 of file findpts_el_3.c.
References CONVERGED_FLAG, findpts_el_pt_3::dist2p, FLAG_MASK, findpts_el_pt_3::flags, get_pt(), findpts_el_gpt_3::hes, i, findpts_el_gpt_3::jac, newton_edge(), newton_face(), newton_vol(), point_index(), findpts_el_pt_3::r, reject_prior_step_q(), x, findpts_el_pt_3::x, and findpts_el_gpt_3::x.
Referenced by findpts_el_3().
|
static |
Definition at line 921 of file findpts_el_3.c.
References i, findpts_el_data_3::lag, findpts_el_data_3::lag_data, findpts_el_data_3::n, newton_vol(), nr, ns, findpts_el_pt_3::r, reject_prior_step_q(), tensor_i2(), tensor_ig2(), tensor_mxm(), findpts_el_data_3::work, findpts_el_pt_3::x, and findpts_el_data_3::x.
Referenced by findpts_el_3().
void findpts_el_3 | ( | struct findpts_el_data_3 *const | fd, |
const unsigned | npt, | ||
const double | tol | ||
) |
Definition at line 1211 of file findpts_el_3.c.
References findpt_edge(), findpt_face(), findpt_pt(), findpt_vol(), FLAG_MASK, findpts_el_pt_3::flags, i, findpts_el_pt_3::index, n, findpts_el_data_3::n, num_constrained(), p, findpts_el_data_3::p, pt_flags_to_bin(), pt_flags_to_bin_noC(), findpts_el_pt_3::r, seed(), sum(), findpts_el_pt_3::x, and findpts_el_data_3::x.
void findpts_el_eval_3 | ( | double *const | out_base, |
const unsigned | out_stride, | ||
const double *const | r_base, | ||
const unsigned | r_stride, | ||
const unsigned | pn, | ||
const double *const | in, | ||
struct findpts_el_data_3 *const | fd | ||
) |
Definition at line 1294 of file findpts_el_3.c.
References i, findpts_el_data_3::lag, findpts_el_data_3::lag_data, findpts_el_data_3::n, nr, ns, out, findpts_el_pt_3::r, tensor_i2(), tensor_mxm(), and findpts_el_data_3::work.
void findpts_el_free_3 | ( | struct findpts_el_data_3 *const | fd | ) |
Definition at line 283 of file findpts_el_3.c.
References findpts_el_data_3::p, and findpts_el_data_3::z.
void findpts_el_setup_3 | ( | struct findpts_el_data_3 *const | fd, |
const unsigned | n[3], | ||
const unsigned | npt_max | ||
) |
Definition at line 202 of file findpts_el_3.c.
References findpts_el_gface_3::dxdn, findpts_el_data_3::face, gll_lag_setup, gll_lag_size, i, findpts_el_data_3::lag, findpts_el_data_3::lag_data, lobatto_nodes, n, findpts_el_data_3::n, findpts_el_data_3::npt_max, nr, ns, findpts_el_data_3::p, SET_EDGE, SET_FACE, findpts_el_data_3::side_init, findpts_el_data_3::sides, tmalloc, findpts_el_data_3::work, work_size(), findpts_el_data_3::wtend, findpts_el_gface_3::x, and findpts_el_data_3::z.
|
static |
Definition at line 404 of file findpts_el_3.c.
References compute_edge_data(), findpts_el_data_3::edge, and findpts_el_data_3::side_init.
Referenced by compute_pt_data(), and findpt_edge().
|
static |
Definition at line 347 of file findpts_el_3.c.
References compute_face_data_rs(), compute_face_data_st(), compute_face_data_tr(), findpts_el_data_3::face, and findpts_el_data_3::side_init.
Referenced by compute_edge_data(), and findpt_face().
|
static |
Definition at line 459 of file findpts_el_3.c.
References compute_pt_data(), findpts_el_data_3::pt, and findpts_el_data_3::side_init.
Referenced by findpt_pt().
|
static |
Definition at line 30 of file findpts_el_3.c.
Referenced by newton_vol().
|
static |
Definition at line 51 of file findpts_el_3.c.
Referenced by newton_face(), and newton_vol().
|
static |
Definition at line 857 of file findpts_el_3.c.
References A, CONVERGED_FLAG, findpts_el_pt_3::dist2p, EVAL, findpts_el_pt_3::flags, nr, findpts_el_pt_3::r, findpts_el_pt_3::tr, and y.
Referenced by findpt_edge(), and findpt_pt().
|
static |
Definition at line 745 of file findpts_el_3.c.
References A, CONVERGED_FLAG, findpts_el_pt_3::dist2p, EVAL, findpts_el_pt_3::flags, i, lin_solve_sym_2(), findpts_el_pt_3::r, SETR, findpts_el_pt_3::tr, and y.
Referenced by findpt_edge(), findpt_face(), and findpt_pt().
|
static |
Definition at line 534 of file findpts_el_3.c.
References CHECK_CONSTRAINT, CONVERGED_FLAG, findpts_el_pt_3::dist2p, edge_index(), face_index(), findpts_el_pt_3::flags, lin_solve_3(), lin_solve_sym_2(), nr, num_constrained(), plus_1_mod_3(), plus_2_mod_3(), findpts_el_pt_3::r, SETDR, SETR, findpts_el_pt_3::tr, and y.
Referenced by findpt_edge(), findpt_face(), findpt_pt(), and findpt_vol().
|
static |
Definition at line 75 of file findpts_el_3.c.
References y.
Referenced by findpts_el_3(), and newton_vol().
|
static |
Definition at line 95 of file findpts_el_3.c.
Referenced by compute_edge_data(), findpt_edge(), findpt_face(), and newton_vol().
|
static |
Definition at line 96 of file findpts_el_3.c.
References y.
Referenced by compute_edge_data(), findpt_edge(), findpt_face(), and newton_vol().
|
static |
Definition at line 123 of file findpts_el_3.c.
Referenced by findpt_pt().
|
static |
Definition at line 88 of file findpts_el_3.c.
References pt_flags_to_bin_noC().
Referenced by findpts_el_3().
|
static |
Definition at line 81 of file findpts_el_3.c.
Referenced by findpts_el_3(), and pt_flags_to_bin().
|
static |
Definition at line 472 of file findpts_el_3.c.
References CONVERGED_FLAG, findpts_el_pt_3::dist2, findpts_el_pt_3::dist2p, FLAG_MASK, findpts_el_pt_3::flags, findpts_el_pt_3::index, findpts_el_pt_3::oldr, findpts_el_pt_3::r, findpts_el_pt_3::tr, and findpts_el_pt_3::x.
Referenced by findpt_edge(), findpt_face(), findpt_pt(), and findpt_vol().
|
static |
Definition at line 1184 of file findpts_el_3.c.
References findpts_el_pt_3::dist2, i, findpts_el_data_3::n, nr, ns, p, findpts_el_pt_3::r, x, findpts_el_pt_3::x, findpts_el_data_3::x, y, z, findpts_el_data_3::z, zr, zs, and zt.
Referenced by findpts_el_3().
|
static |
Definition at line 103 of file findpts_el_3.c.
References y.
Referenced by face_index().
|
static |
Definition at line 179 of file findpts_el_3.c.
References DO_MAX, nr, and ns.
Referenced by findpts_el_setup_3().