SPR Superconvergent patch recovery. More...
#include <gadaptivity.h>
Public Member Functions | |
patch_averaging (gtopology *gt, long dim, long nvals, long flag) | |
CONSTRUCTOR. | |
void | solve (FILE *out, const matrix *spvalue, vector *nodvalue) |
solve - main function | |
~patch_averaging (void) | |
DESTRUCTOR. | |
Private Member Functions | |
void | compute_patches_spr (const matrix *spvalue, vector *nodvalue, long cut_flag) |
void | insidenod_assembling (void) |
void | nodvalue_assembling_ae (long nadjel, const long *adjel, const vector &coef_normcoord, const vector *a, vector *nodvalue, long nid, ivector &magnitude) |
void | normal_coordinates_ae (long nadjel, const long *adjel, vector &coef_normcoord) |
void | nsp_spcoord_maxcoord_assembling (const matrix *spvalue, char nsma_flag) |
void | polynom (long ncoef, const double *normcoord, double *p) |
void | polynom_coefficients_ae (long nadjel, const long *adjel, const vector &coef_normcoord, vector *a, const matrix *spvalue) |
void | sigma (vector *nodvalue, long ncoef, long nid, const vector &coef_normcoord, const vector *a, ivector &magnitude) |
Private Attributes | |
long | dim |
long | flag |
gtopology * | gt |
actual gtopology | |
long ** | insidenod |
double ** | maxcoord |
long | ne |
number nodes at domain | |
long | nn |
number of smoothed ~ aproximated values | |
long | nvals |
dimension (2 or 3) | |
double ** | spcoord |
number elements at domain |
SPR Superconvergent patch recovery.
Definition at line 37 of file gadaptivity.h.
patch_averaging | ( | gtopology * | gt, | |
long | dim, | |||
long | nvals, | |||
long | flag | |||
) |
CONSTRUCTOR.
Definition at line 19 of file gadaptivity.cpp.
References dim, flag, gt, insidenod, maxcoord, gtopology::ne, ne, gtopology::nn, nn, nvals, and spcoord.
~patch_averaging | ( | void | ) |
Function creates element patch around every vertex node and from sampling points inside of patch interpolates values to nodes.
cut_flag | - flag, whether to null values on the "null border" = border of region where known values are zero |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 467 of file gadaptivity.cpp.
References gtopology::adjelnod, allocv(), gelement::auxinf, destrv(), dim, gtopology::gelements, gt, insidenod, matrix::m, matrix::n, gtopology::nadjelnod, nn, nodvalue_assembling_ae(), normal_coordinates_ae(), nvals, polynom_coefficients_ae(), and print_err().
Referenced by solve().
void insidenod_assembling | ( | void | ) | [private] |
loop 1 : assembles vector of node position in domain 2D: insidenod[i]== 1 -> inside node of domain insidenod[i]==-1 -> node on edge of domain insidenod[i]==-2 -> node at vertex of domain 3D: insidenod[i]== 1 -> inside node of domain insidenod[i]==-1 -> node on boundary area of domain insidenod[i]==-2 -> node on edge of domain insidenod[i]==-3 -> node at vertex of domain
loop 2 : for every "node at vertex of domain"=vn is found "oposite node"=on => => inside[on][inside[on][0]++ - 1] = nv where 'on' is "oposite node" already "inside[on][0]" times.
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
loop 1
loop 2
Definition at line 204 of file gadaptivity.cpp.
References gtopology::adjelnod, gelement::auxinf, edge_position(), gtopology::gelements, gtopology::give_nne(), gt, if(), insidenod, gtopology::nadjelnod, ne, nn, gelement::nne, gelement::nodes, on, opposite_node(), print_err(), and surface_position().
Referenced by solve().
void nodvalue_assembling_ae | ( | long | nadjel, | |
const long * | adjel, | |||
const vector & | coef_normcoord, | |||
const vector * | a, | |||
vector * | nodvalue, | |||
long | nid, | |||
ivector & | magnitude | |||
) | [private] |
Function computes values of `polynoms` in nodes over all patch.
coef_normcoord | - array of coeficients for computing of normed coordinates | |
a | - array of vector of coefficients of `polynoms` | |
id | - id of middle node | |
magnitude | - 2D array of sums of magnitudes of values in sampling points |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 607 of file gadaptivity.cpp.
References gtopology::gelements, gtopology::give_nne(), gt, insidenod, vector::n, nn, gelement::nodes, nodes, and sigma().
Referenced by compute_patches_spr().
void normal_coordinates_ae | ( | long | nadjel, | |
const long * | adjel, | |||
vector & | coef_normcoord | |||
) | [private] |
Function computes coeficients for computing of normed coordinates in patch. This function is called for every patch.
coef_normcoord | - answer = array of coeficients for computing of normed coordinates |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 538 of file gadaptivity.cpp.
References dim, fillv(), and maxcoord.
Referenced by compute_patches_spr().
void nsp_spcoord_maxcoord_assembling | ( | const matrix * | spvalue, | |
char | nsma_flag | |||
) | [private] |
Function fills up arrays: 'nsp' (number of sampling points) by default values, 'spcoord' by natural coordinates of default sampling points, 'maxcoord' by extreme element coordinates.
nsma_flag | - determines which array will be actually filled: 'a' = all arrays, 'm' = only array maxcoord |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 86 of file gadaptivity.cpp.
References vector::a, allocv(), gelement::auxinf, bf_lin_4_2d(), bf_quad_3_2d(), bf_quad_4_2d(), destrv(), dim, gtopology::gelements, gtopology::give_node_coord3d(), gt, matrix::m, maxcoord, maxmin_3(), maxmin_4(), vector::n, ne, gelement::nne, print_err(), scprd(), and spcoord.
Referenced by solve().
void polynom | ( | long | ncoef, | |
const double * | normcoord, | |||
double * | p | |||
) | [private] |
Function computes
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 637 of file gadaptivity.cpp.
References dim.
Referenced by polynom_coefficients_ae(), and sigma().
void sigma | ( | vector * | nodvalue, | |
long | ncoef, | |||
long | nid, | |||
const vector & | coef_normcoord, | |||
const vector * | a, | |||
ivector & | magnitude | |||
) | [private] |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 674 of file gadaptivity.cpp.
References vector::a, dim, gtopology::gnodes, gt, nvals, polynom(), scprd(), gnode::x, gnode::y, and gnode::z.
Referenced by nodvalue_assembling_ae().
solve - main function
SPR Superconvergent patch recovery This is main function of class least_square. It smooths discontinuous 'values' which are known in 'sampling points'. Answer is array of smoothed values in nodes. Sampling points ARE IDENTICAL to main integration points in first block on elements.
spvalue | - 2D array of rough values in sampling points, dimension is (gt->ne) x (nip*tncomp) | |
nodvalue | - answer, 1D array, size is (least_square::nn * least_square::nvals) |
created 3.3.2002, Ladislav Svoboda, termit@cml.fsv.cvut.cz
Definition at line 59 of file gadaptivity.cpp.
References gtopology::adjacelem(), compute_patches_spr(), gt, insidenod_assembling(), gtopology::nadjelnod, ne, nsp_spcoord_maxcoord_assembling(), and spcoord.
Referenced by adaptivityt::spr(), and adaptivity::spr().
long dim [private] |
FOLLOWING CHARACTERISTICS MUST BE IDENTICAL FOR EVERY ELEMENT ALL OVER THE DOMAIN dim,ncomp(ncompother),deg(polynom degree of base functions),material
Definition at line 46 of file gadaptivity.h.
Referenced by compute_patches_spr(), normal_coordinates_ae(), nsp_spcoord_maxcoord_assembling(), patch_averaging(), polynom(), polynom_coefficients_ae(), and sigma().
long flag [private] |
Definition at line 66 of file gadaptivity.h.
Referenced by patch_averaging().
actual gtopology
Definition at line 41 of file gadaptivity.h.
Referenced by compute_patches_spr(), insidenod_assembling(), nodvalue_assembling_ae(), nsp_spcoord_maxcoord_assembling(), patch_averaging(), sigma(), and solve().
long** insidenod [private] |
Definition at line 60 of file gadaptivity.h.
Referenced by compute_patches_spr(), insidenod_assembling(), nodvalue_assembling_ae(), patch_averaging(), and ~patch_averaging().
double** maxcoord [private] |
Definition at line 58 of file gadaptivity.h.
Referenced by normal_coordinates_ae(), nsp_spcoord_maxcoord_assembling(), patch_averaging(), and ~patch_averaging().
long ne [private] |
number nodes at domain
Definition at line 49 of file gadaptivity.h.
Referenced by insidenod_assembling(), nsp_spcoord_maxcoord_assembling(), patch_averaging(), solve(), and ~patch_averaging().
long nn [private] |
number of smoothed ~ aproximated values
Definition at line 48 of file gadaptivity.h.
Referenced by compute_patches_spr(), insidenod_assembling(), nodvalue_assembling_ae(), patch_averaging(), and ~patch_averaging().
long nvals [private] |
dimension (2 or 3)
Definition at line 47 of file gadaptivity.h.
Referenced by compute_patches_spr(), patch_averaging(), polynom_coefficients_ae(), and sigma().
double** spcoord [private] |
number elements at domain
Definition at line 54 of file gadaptivity.h.
Referenced by nsp_spcoord_maxcoord_assembling(), patch_averaging(), polynom_coefficients_ae(), solve(), and ~patch_averaging().