#include <cfloat>
Go to the source code of this file.
Classes | |
struct | lagrange_data |
struct | findpt_data_2 |
struct | findpt_data_3 |
struct | opt_face_data_3 |
struct | opt_edge_data_3 |
struct | opt_point_data_3 |
struct | opt_data_3 |
struct | opt_edge_data_2 |
struct | opt_point_data_2 |
struct | opt_data_2 |
Macros | |
#define | INTEGER int |
#define | GLOBAL_INT long |
#define | floorr floor |
#define | ceilr ceil |
#define | sqrtr sqrt |
#define | fabsr fabs |
#define | cosr cos |
#define | sinr sin |
#define | EPS ( 128 * DBL_EPSILON ) |
#define | PI 3.1415926535897932384626433832795028841971693993751058209749445923 |
#define | uint uint_ |
#define | ulong ulong_ |
#define | sint sint_ |
#define | slong slong_ |
Typedefs | |
typedef double | real |
typedef signed INTEGER | sint |
typedef unsigned INTEGER | uint |
typedef signed GLOBAL_INT | slong |
typedef unsigned GLOBAL_INT | ulong |
typedef int(* | findpt_func) (void *, const real *, int, uint *, real *, real *) |
Functions | |
void | legendre_matrix (const real *x, int m, real *P, int n) |
void | legendre_matrix_t (const real *x, int m, real *P, int n) |
void | legendre_row (real x, real *P, int n) |
void | gauss_nodes (real *z, int n) |
void | lobatto_nodes (real *z, int n) |
void | gauss_weights (const real *z, real *w, int n) |
void | lobatto_weights (const real *z, real *w, int n) |
void | gauss_to_legendre (const real *z, const real *w, int n, real *J) |
void | gauss_to_legendre_t (const real *z, const real *w, int n, real *J) |
void | lobatto_to_legendre (const real *z, const real *w, int n, real *J) |
void | lagrange_weights (const real *z, unsigned n, const real *x, unsigned m, real *J, real *work) |
void | lagrange_weights_deriv (const real *z, unsigned n, const real *x, unsigned m, real *J, real *D, real *work) |
void | lagrange_setup (lagrange_data *p, const real *z, unsigned n) |
void | lagrange_free (lagrange_data *p) |
void | lagrange_0 (lagrange_data *p, real x) |
void | lagrange_1 (lagrange_data *p, real x) |
void | lagrange_2 (lagrange_data *p, real x) |
void | lagrange_2u (lagrange_data *p) |
void | tensor_c1 (const real *R, unsigned mr, unsigned nr, const real *u, real *v) |
void | tensor_r1 (const real *R, unsigned mr, unsigned nr, const real *u, real *v) |
void | tensor_c2 (const real *R, unsigned mr, unsigned nr, const real *S, unsigned ms, unsigned ns, const real *u, real *v, real *work) |
void | tensor_r2 (const real *R, unsigned mr, unsigned nr, const real *S, unsigned ms, unsigned ns, const real *u, real *v, real *work) |
void | tensor_c3 (const real *R, unsigned mr, unsigned nr, const real *S, unsigned ms, unsigned ns, const real *T, unsigned mt, unsigned nt, const real *u, real *v, real *work1, real *work2) |
void | tensor_r3 (const real *R, unsigned mr, unsigned nr, const real *S, unsigned ms, unsigned ns, const real *T, unsigned mt, unsigned nt, const real *u, real *v, real *work1, real *work2) |
real | tensor_i1 (const real *Jr, unsigned nr, const real *u) |
real | tensor_i2 (const real *Jr, unsigned nr, const real *Js, unsigned ns, const real *u, real *work) |
real | tensor_i3 (const real *Jr, unsigned nr, const real *Js, unsigned ns, const real *Jt, unsigned nt, const real *u, real *work) |
real | tensor_ig1 (const real *Jr, const real *Dr, unsigned nr, const real *u, real *g) |
real | tensor_ig2 (const real *Jr, const real *Dr, unsigned nr, const real *Js, const real *Ds, unsigned ns, const real *u, real *g, real *work) |
real | tensor_ig3 (const real *Jr, const real *Dr, unsigned nr, const real *Js, const real *Ds, unsigned ns, const real *Jt, const real *Dt, unsigned nt, const real *u, real *g, real *work) |
findpt_data_2 * | findpt_setup_2 (const real *const xw[2], const unsigned n[2], uint nel, uint max_hash_size, real bbox_tol) |
findpt_data_3 * | findpt_setup_3 (const real *const xw[3], const unsigned n[3], uint nel, uint max_hash_size, real bbox_tol) |
void | findpt_free_2 (findpt_data_2 *p) |
void | findpt_free_3 (findpt_data_3 *p) |
const real * | findpt_allbnd_2 (const findpt_data_2 *p) |
const real * | findpt_allbnd_3 (const findpt_data_3 *p) |
int | findpt_2 (findpt_data_2 *p, const real x[2], int guess, uint *el, real r[2], real *dist) |
int | findpt_3 (findpt_data_3 *p, const real x[3], int guess, uint *el, real r[3], real *dist) |
void | findpt_weights_2 (findpt_data_2 *p, const real r[2]) |
void | findpt_weights_3 (findpt_data_3 *p, const real r[3]) |
double | findpt_eval_2 (findpt_data_2 *p, const real *u) |
double | findpt_eval_3 (findpt_data_3 *p, const real *u) |
void | opt_alloc_3 (opt_data_3 *p, lagrange_data *ld) |
void | opt_free_3 (opt_data_3 *p) |
double | opt_findpt_3 (opt_data_3 *p, const real *const elx[3], const real xstar[3], real r[3], unsigned *constr) |
void | opt_vol_set_intp_3 (opt_data_3 *p, const real r[3]) |
void | opt_alloc_2 (opt_data_2 *p, lagrange_data *ld) |
void | opt_free_2 (opt_data_2 *p) |
double | opt_findpt_2 (opt_data_2 *p, const real *const elx[2], const real xstar[2], real r[2], unsigned *constr) |
Variables | |
const unsigned | opt_no_constraints_2 = 3 + 1 |
const unsigned | opt_no_constraints_3 = 9 + 3 + 1 |
#define ceilr ceil |
Definition at line 54 of file SpectralFuncs.hpp.
#define cosr cos |
Definition at line 57 of file SpectralFuncs.hpp.
#define EPS ( 128 * DBL_EPSILON ) |
Definition at line 59 of file SpectralFuncs.hpp.
#define fabsr fabs |
Definition at line 56 of file SpectralFuncs.hpp.
#define floorr floor |
Definition at line 53 of file SpectralFuncs.hpp.
#define GLOBAL_INT long |
Definition at line 27 of file SpectralFuncs.hpp.
#define INTEGER int |
Definition at line 18 of file SpectralFuncs.hpp.
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923 |
Definition at line 60 of file SpectralFuncs.hpp.
#define sinr sin |
Definition at line 58 of file SpectralFuncs.hpp.
#define sint sint_ |
Definition at line 66 of file SpectralFuncs.hpp.
#define slong slong_ |
Definition at line 67 of file SpectralFuncs.hpp.
#define sqrtr sqrt |
Definition at line 55 of file SpectralFuncs.hpp.
#define uint uint_ |
Definition at line 64 of file SpectralFuncs.hpp.
#define ulong ulong_ |
Definition at line 65 of file SpectralFuncs.hpp.
Definition at line 417 of file SpectralFuncs.hpp.
typedef double real |
Definition at line 52 of file SpectralFuncs.hpp.
Definition at line 69 of file SpectralFuncs.hpp.
typedef signed GLOBAL_INT slong |
Definition at line 74 of file SpectralFuncs.hpp.
Definition at line 70 of file SpectralFuncs.hpp.
typedef unsigned GLOBAL_INT ulong |
Definition at line 75 of file SpectralFuncs.hpp.
int findpt_2 | ( | findpt_data_2 * | p, |
const real | x[2], | ||
int | guess, | ||
uint * | el, | ||
real | r[2], | ||
real * | dist | ||
) |
Definition at line 2251 of file findpt.c.
References findpt_data_2::end, findpt_guess_2(), findpt_hash_2(), findpt_pass_2(), and findpt_data_2::sorted.
int findpt_3 | ( | findpt_data_3 * | p, |
const real | x[3], | ||
int | guess, | ||
uint * | el, | ||
real | r[3], | ||
real * | dist | ||
) |
Definition at line 2259 of file findpt.c.
References findpt_data_3::end, findpt_guess_3(), findpt_hash_3(), findpt_pass_3(), and findpt_data_3::sorted.
const real* findpt_allbnd_2 | ( | const findpt_data_2 * | p | ) |
Definition at line 2107 of file findpt.c.
References hash_data_2::bnd, and findpt_data_2::hash.
const real* findpt_allbnd_3 | ( | const findpt_data_3 * | p | ) |
Definition at line 2112 of file findpt.c.
References hash_data_3::bnd, and findpt_data_3::hash.
|
inline |
Definition at line 434 of file SpectralFuncs.hpp.
References lagrange_data::J, findpt_data_2::ld, lagrange_data::n, findpt_data_2::od_work, and tensor_i2().
|
inline |
Definition at line 439 of file SpectralFuncs.hpp.
References lagrange_data::J, findpt_data_3::ld, lagrange_data::n, findpt_data_3::od_work, and tensor_i3().
void findpt_free_2 | ( | findpt_data_2 * | p | ) |
Definition at line 2079 of file findpt.c.
References findpt_data_2::hash, hash_free_2(), findpt_data_2::list, findpt_data_2::od, opt_free_2(), findpt_data_2::sorted, and findpt_data_2::z.
void findpt_free_3 | ( | findpt_data_3 * | p | ) |
Definition at line 2093 of file findpt.c.
References findpt_data_3::hash, hash_free_3(), findpt_data_3::list, findpt_data_3::od, opt_free_3(), findpt_data_3::sorted, and findpt_data_3::z.
findpt_data_2* findpt_setup_2 | ( | const real *const | xw[2], |
const unsigned | n[2], | ||
uint | nel, | ||
uint | max_hash_size, | ||
real | bbox_tol | ||
) |
Definition at line 2011 of file findpt.c.
References findpt_data_2::hash, hash_build_2(), lagrange_setup(), findpt_data_2::ld, findpt_data_2::list, lobatto_nodes(), hash_data_2::max, findpt_data_2::nptel, findpt_data_2::od, findpt_data_2::od_work, opt_alloc_2(), findpt_data_2::sorted, tmalloc, opt_data_2::work, findpt_data_2::xw, and findpt_data_2::z.
findpt_data_3* findpt_setup_3 | ( | const real *const | xw[3], |
const unsigned | n[3], | ||
uint | nel, | ||
uint | max_hash_size, | ||
real | bbox_tol | ||
) |
Definition at line 2045 of file findpt.c.
References findpt_data_3::hash, hash_build_3(), lagrange_setup(), findpt_data_3::ld, findpt_data_3::list, lobatto_nodes(), hash_data_3::max, findpt_data_3::nptel, findpt_data_3::od, findpt_data_3::od_work, opt_alloc_3(), findpt_data_3::sorted, tmalloc, opt_data_3::work, findpt_data_3::xw, and findpt_data_3::z.
|
inline |
Definition at line 421 of file SpectralFuncs.hpp.
References lagrange_0(), and findpt_data_2::ld.
|
inline |
void gauss_nodes | ( | real * | z, |
int | n | ||
) |
Definition at line 155 of file poly.c.
References legendre(), legendre_d1(), mbabs, mbcos, MOAB_POLY_EPS, and MOAB_POLY_PI.
void lagrange_0 | ( | lagrange_data * | p, |
real | x | ||
) |
Definition at line 414 of file poly.c.
References lagrange_data::d, lagrange_data::J, lagrange_data::n, lagrange_data::u0, lagrange_data::v0, lagrange_data::w, and lagrange_data::z.
Referenced by moab::SpectralQuad::evalFcn(), moab::Element::SpectralHex::evaluate(), moab::Element::SpectralQuad::evaluate(), moab::element_utility::Spectral_hex_map< _Matrix >::evaluate(), moab::Element::SpectralHex::evaluate_scalar_field(), moab::Element::SpectralQuad::evaluate_scalar_field(), moab::element_utility::Spectral_hex_map< _Matrix >::evaluate_scalar_field(), findpt_weights_2(), findpt_weights_3(), and moab::ElemUtil::hex_eval().
void lagrange_1 | ( | lagrange_data * | p, |
real | x | ||
) |
Definition at line 427 of file poly.c.
References lagrange_data::D, lagrange_data::d, lagrange_data::J, lagrange_data::n, lagrange_data::u0, lagrange_data::u1, lagrange_data::v0, lagrange_data::v1, lagrange_data::w, and lagrange_data::z.
Referenced by opt_area_set_2(), opt_edge_set_2(), opt_edge_set_3(), opt_face_set_3(), and opt_vol_set_3().
void lagrange_2 | ( | lagrange_data * | p, |
real | x | ||
) |
Definition at line 440 of file poly.c.
References lagrange_data::D, lagrange_data::d, lagrange_data::D2, lagrange_data::J, lagrange_data::n, lagrange_data::u0, lagrange_data::u1, lagrange_data::u2, lagrange_data::v0, lagrange_data::v1, lagrange_data::v2, lagrange_data::w, and lagrange_data::z.
Referenced by lagrange_setup().
void lagrange_2u | ( | lagrange_data * | p | ) |
Definition at line 456 of file poly.c.
References lagrange_data::d, lagrange_data::D2, lagrange_data::n, lagrange_data::u0, lagrange_data::u1, lagrange_data::u2, lagrange_data::v0, lagrange_data::v1, lagrange_data::v2, and lagrange_data::w.
Referenced by opt_edge_hess_2(), opt_edge_hess_3(), and opt_face_hess_3().
void lagrange_free | ( | lagrange_data * | p | ) |
Definition at line 497 of file poly.c.
References lagrange_data::w.
Referenced by moab::element_utility::Spectral_hex_map< _Matrix >::free_data(), moab::Element::SpectralHex::freedata(), moab::Element::SpectralQuad::freedata(), moab::ElemUtil::hex_eval(), and moab::ElemUtil::hex_findpt().
void lagrange_setup | ( | lagrange_data * | p, |
const real * | z, | ||
unsigned | n | ||
) |
Definition at line 467 of file poly.c.
References lagrange_data::D, lagrange_data::d, lagrange_data::D2, lagrange_data::D2_z0, lagrange_data::D2_zn, lagrange_data::D_z0, lagrange_data::D_zn, lagrange_data::J, lagrange_data::J_z0, lagrange_data::J_zn, lagrange_2(), lagrange_data::n, tmalloc, lagrange_data::u0, lagrange_data::u1, lagrange_data::u2, lagrange_data::v0, lagrange_data::v1, lagrange_data::v2, lagrange_data::w, and lagrange_data::z.
Referenced by findpt_setup_2(), findpt_setup_3(), moab::ElemUtil::hex_eval(), moab::ElemUtil::hex_findpt(), moab::Element::SpectralHex::Init(), moab::Element::SpectralQuad::Init(), moab::SpectralHex::initFcn(), and moab::element_utility::Spectral_hex_map< _Matrix >::initialize_spectral_hex().
void lagrange_weights | ( | const real * | z, |
unsigned | n, | ||
const real * | x, | ||
unsigned | m, | ||
real * | J, | ||
real * | work | ||
) |
void lagrange_weights_deriv | ( | const real * | z, |
unsigned | n, | ||
const real * | x, | ||
unsigned | m, | ||
real * | J, | ||
real * | D, | ||
real * | work | ||
) |
Definition at line 354 of file poly.c.
Referenced by lob_bnd_base_setup(), obbox_setup_2(), and obbox_setup_3().
Definition at line 87 of file poly.c.
References legendre_row_even(), and legendre_row_odd().
Referenced by gauss_to_legendre().
Definition at line 75 of file poly.c.
References legendre_row_even(), and legendre_row_odd().
void lobatto_nodes | ( | real * | z, |
int | n | ||
) |
Definition at line 193 of file poly.c.
References lobatto_nodes_aux().
Referenced by findpt_setup_2(), findpt_setup_3(), hash_getbb_2(), hash_getbb_3(), moab::ElemUtil::hex_eval(), moab::ElemUtil::hex_findpt(), moab::Element::SpectralHex::Init(), moab::Element::SpectralQuad::Init(), moab::SpectralHex::initFcn(), and moab::element_utility::Spectral_hex_map< _Matrix >::initialize_spectral_hex().
Definition at line 275 of file poly.c.
References legendre_row_even(), legendre_row_odd(), and moab::sum().
Definition at line 211 of file poly.c.
References legendre().
Referenced by hash_getbb_2(), and hash_getbb_3().
void opt_alloc_2 | ( | opt_data_2 * | p, |
lagrange_data * | ld | ||
) |
Definition at line 1662 of file findpt.c.
References opt_data_2::ed, opt_edge_data_2::fd1, opt_data_2::ld, lagrange_data::n, nr, opt_data_2::size, tmalloc, umax_2, opt_data_2::work, and opt_edge_data_2::x.
Referenced by findpt_setup_2(), and moab::Element::SpectralQuad::Init().
void opt_alloc_3 | ( | opt_data_3 * | p, |
lagrange_data * | ld | ||
) |
Definition at line 1251 of file findpt.c.
References opt_data_3::ed, opt_data_3::fd, opt_edge_data_3::fd1, opt_edge_data_3::fd2, opt_face_data_3::fdn, opt_data_3::ld, lagrange_data::n, nr, opt_data_3::size, tmalloc, opt_data_3::work, opt_face_data_3::x, and opt_edge_data_3::x.
Referenced by findpt_setup_3(), moab::ElemUtil::hex_findpt(), moab::Element::SpectralHex::Init(), moab::SpectralHex::initFcn(), and moab::element_utility::Spectral_hex_map< _Matrix >::initialize_spectral_hex().
double opt_findpt_2 | ( | opt_data_2 * | p, |
const real *const | elx[2], | ||
const real | xstar[2], | ||
real | r[2], | ||
unsigned * | constr | ||
) |
Definition at line 1818 of file findpt.c.
References opt_edge_data_2::constraints, opt_point_data_2::constraints, opt_edge_data_2::d1, opt_edge_data_2::de, DIAGNOSTICS, opt_data_2::ed, opt_data_2::elx, opt_data_2::jac, mat_app_2c(), MOAB_POLY_EPS, opt_area_set_intp_2(), opt_constr_num_2, opt_constr_pack_2(), opt_constr_unpack_2(), opt_edge_hess_2(), opt_edge_set_2(), opt_edge_set_intp_2(), opt_no_constraints_2, opt_point_set_2(), opt_point_set_intp_2(), opt_data_2::pd, r1norm_2(), r2norm_2(), tinyla_solve_2(), and opt_data_2::x.
Referenced by findpt_guess_2(), findpt_pass_2(), moab::Element::SpectralQuad::ievaluate(), and moab::SpectralQuad::reverseEvalFcn().
double opt_findpt_3 | ( | opt_data_3 * | p, |
const real *const | elx[3], | ||
const real | xstar[3], | ||
real | r[3], | ||
unsigned * | constr | ||
) |
Definition at line 1512 of file findpt.c.
References opt_face_data_3::constraints, opt_edge_data_3::constraints, opt_point_data_3::constraints, opt_face_data_3::d1, opt_edge_data_3::d1, opt_face_data_3::d2, opt_edge_data_3::d2, opt_edge_data_3::de, DIAGNOSTICS, opt_face_data_3::dn, opt_data_3::ed, opt_data_3::elx, opt_data_3::fd, opt_data_3::jac, mat_app_3c(), MOAB_POLY_EPS, opt_constr_num_3, opt_constr_pack_3(), opt_constr_unpack_3(), opt_edge_hess_3(), opt_edge_set_3(), opt_edge_set_intp_3(), opt_face_hess_3(), opt_face_set_3(), opt_face_set_intp_3(), opt_no_constraints_3, opt_point_set_3(), opt_point_set_intp_3(), opt_vol_set_intp_3(), opt_data_3::pd, r1norm_3(), r2norm_3(), tinyla_solve_3(), tinyla_solve_sym_2(), and opt_data_3::x.
Referenced by findpt_guess_3(), findpt_pass_3(), moab::ElemUtil::hex_findpt(), and moab::Element::SpectralHex::ievaluate().
void opt_free_2 | ( | opt_data_2 * | p | ) |
Definition at line 1676 of file findpt.c.
References opt_data_2::work.
Referenced by findpt_free_2(), and moab::Element::SpectralQuad::freedata().
void opt_free_3 | ( | opt_data_3 * | p | ) |
Definition at line 1278 of file findpt.c.
References opt_data_3::work.
Referenced by findpt_free_3(), moab::element_utility::Spectral_hex_map< _Matrix >::free_data(), moab::Element::SpectralHex::freedata(), and moab::ElemUtil::hex_findpt().
void opt_vol_set_intp_3 | ( | opt_data_3 * | p, |
const real | r[3] | ||
) |
Definition at line 1301 of file findpt.c.
References opt_vol_intp_3(), and opt_vol_set_3().
Referenced by moab::Element::SpectralHex::integrate_scalar_field(), moab::element_utility::Spectral_hex_map< _Matrix >::integrate_scalar_field(), moab::Element::SpectralHex::jacobian(), moab::element_utility::Spectral_hex_map< _Matrix >::jacobian(), and opt_findpt_3().
void tensor_c3 | ( | const real * | R, |
unsigned | mr, | ||
unsigned | nr, | ||
const real * | S, | ||
unsigned | ms, | ||
unsigned | ns, | ||
const real * | T, | ||
unsigned | mt, | ||
unsigned | nt, | ||
const real * | u, | ||
real * | v, | ||
real * | work1, | ||
real * | work2 | ||
) |
Definition at line 255 of file tensor.c.
Referenced by opt_edge_hess_2(), opt_edge_hess_3(), opt_edge_intp_2(), and opt_edge_intp_3().
real tensor_i2 | ( | const real * | Jr, |
unsigned | nr, | ||
const real * | Js, | ||
unsigned | ns, | ||
const real * | u, | ||
real * | work | ||
) |
Definition at line 261 of file tensor.c.
References inner(), mxv_r(), and nr.
Referenced by moab::SpectralQuad::evalFcn(), moab::Element::SpectralQuad::evaluate(), moab::Element::SpectralQuad::evaluate_scalar_field(), findpt_eval_2(), opt_face_hess_3(), and opt_face_intp_3().
real tensor_i3 | ( | const real * | Jr, |
unsigned | nr, | ||
const real * | Js, | ||
unsigned | ns, | ||
const real * | Jt, | ||
unsigned | nt, | ||
const real * | u, | ||
real * | work | ||
) |
Definition at line 273 of file tensor.c.
References inner(), mxv_r(), and nr.
Referenced by moab::Element::SpectralHex::evaluate(), moab::element_utility::Spectral_hex_map< _Matrix >::evaluate(), moab::Element::SpectralHex::evaluate_scalar_field(), moab::element_utility::Spectral_hex_map< _Matrix >::evaluate_scalar_field(), findpt_eval_3(), and moab::ElemUtil::hex_eval().
Definition at line 304 of file tensor.c.
Referenced by opt_edge_intp_2(), and opt_edge_intp_3().
real tensor_ig2 | ( | const real * | Jr, |
const real * | Dr, | ||
unsigned | nr, | ||
const real * | Js, | ||
const real * | Ds, | ||
unsigned | ns, | ||
const real * | u, | ||
real * | g, | ||
real * | work | ||
) |
Definition at line 311 of file tensor.c.
References inner(), mxv_r(), and nr.
Referenced by obbox_calc_2(), opt_area_intp_2(), opt_face_hess_3(), and opt_face_intp_3().
real tensor_ig3 | ( | const real * | Jr, |
const real * | Dr, | ||
unsigned | nr, | ||
const real * | Js, | ||
const real * | Ds, | ||
unsigned | ns, | ||
const real * | Jt, | ||
const real * | Dt, | ||
unsigned | nt, | ||
const real * | u, | ||
real * | g, | ||
real * | work | ||
) |
Definition at line 330 of file tensor.c.
References inner(), mxv_r(), and nr.
Referenced by obbox_calc_3(), and opt_vol_intp_3().
void tensor_r3 | ( | const real * | R, |
unsigned | mr, | ||
unsigned | nr, | ||
const real * | S, | ||
unsigned | ms, | ||
unsigned | ns, | ||
const real * | T, | ||
unsigned | mt, | ||
unsigned | nt, | ||
const real * | u, | ||
real * | v, | ||
real * | work1, | ||
real * | work2 | ||
) |
const unsigned opt_no_constraints_2 = 3 + 1 |
Definition at line 485 of file SpectralFuncs.hpp.
const unsigned opt_no_constraints_3 = 9 + 3 + 1 |
Definition at line 486 of file SpectralFuncs.hpp.