H1Adapt Class Reference
[-adapt hp-Adaptivity]

hp-Adaptivity module for H1 space More...

#include <h1.h>

List of all members.

Classes

struct  ProjKey

Public Types

typedef scalar(* biform_val_t )(int n, double *wt, fn_t< scalar > *u_ext[], fn_t< scalar > *u, fn_t< scalar > *v, geom_t< double > *e, user_data_t< scalar > *)
typedef ord_t(* biform_ord_t )(int n, double *wt, fn_t< ord_t > *u_ext[], fn_t< ord_t > *u, fn_t< ord_t > *v, geom_t< ord_t > *e, user_data_t< ord_t > *)

Public Member Functions

 H1Adapt (Tuple< Space * > sp)
 Initializes the class. 'num' is the number of mesh-space pairs to be adapted. After 'num', exactly that many space pointers must follow.
 H1Adapt (Space *sp)
void init (Tuple< Space * > sp)
 ~H1Adapt ()
double calc_error (Solution *sln, Solution *rsln)
 Type-safe version of calc_error_n() for one solution.
double calc_error_n (Tuple< Solution * > slns, Tuple< Solution * > rslns)
 Calculates the error of the solution. 'n' must be the same as 'num' in the constructor. After that, n coarse solution pointers are passed, followed by n fine solution pointers.
void adapt (double thr)
 Selects elements to refine (based on results from calc_error() or calc_energy_error()) and performs their optimal hp-refinement.
int get_num_refined_elements ()
 Get the number of elements refined in the last adaptivity iteration.
double get_error_time ()
 Return the time need to calculate the error (in secs).
double get_adapt_time ()
 Return the time need to the adaptivity step (in secs).
void set_type (int h_only)
 Set the type of adaptivity.
void set_exponent (double exp)
 Set the type of adaptivity.
void set_aniso (int aniso)
 Allow/disable aniso refinements.
void set_strategy (int strat)
 Set strategy type.
void set_log_file (FILE *log_file)
 Set the log file

  • use for debugging the adaptivity.

void set_error_form (int i, int j, biform_val_t biform, biform_ord_t biform_ord)
 Set the bilinear form on position [i,j] TODO: be more verbose here.
void set_max_order (int order)
 Set maximal order to be used.

Protected Member Functions

void get_optimal_refinement (Mesh *mesh, Element *e, const order3_t &order, Solution *rsln, Shapeset *ss, int &split, order3_t p[8])
 Used by adapt(). Can be utilized in specialized adaptivity procedures, for which adapt() is not sufficient.
double get_projection_error (Element *e, int split, int son, const order3_t &order, Solution *rsln, Shapeset *ss)
int get_dof_count (int split, order3_t order[])
order3_t get_form_order (int marker, const order3_t &ordu, const order3_t &ordv, RefMap *ru, biform_ord_t bf_ord)
scalar eval_error (int marker, biform_val_t bi_fn, biform_ord_t bi_ord, MeshFunction *sln1, MeshFunction *sln2, MeshFunction *rsln1, MeshFunction *rsln2)
scalar eval_norm (int marker, biform_val_t bi_fn, biform_ord_t bi_ord, MeshFunction *rsln1, MeshFunction *rsln2)

Protected Attributes

bool h_only
int strategy
int max_order
bool aniso
double exponent
int num
Space ** spaces
Solution ** sln
Solution ** rsln
double ** errors
double * norms
bool have_errors
double total_err
int2esort
int nact
int reft_elems
double error_time
double adapt_time
biform_val_t ** form
biform_ord_t ** ord
Map< ProjKey, double > proj_err
FILE * log_file

Detailed Description

hp-Adaptivity module for H1 space

TODO


Member Typedef Documentation

typedef ord_t(* H1Adapt::biform_ord_t)(int n, double *wt, fn_t< ord_t > *u_ext[], fn_t< ord_t > *u, fn_t< ord_t > *v, geom_t< ord_t > *e, user_data_t< ord_t > *)
typedef scalar(* H1Adapt::biform_val_t)(int n, double *wt, fn_t< scalar > *u_ext[], fn_t< scalar > *u, fn_t< scalar > *v, geom_t< double > *e, user_data_t< scalar > *)

Constructor & Destructor Documentation

H1Adapt::H1Adapt ( Tuple< Space * >  sp  )  [inline]

Initializes the class. 'num' is the number of mesh-space pairs to be adapted. After 'num', exactly that many space pointers must follow.

H1Adapt::H1Adapt ( Space sp  )  [inline]
H1Adapt::~H1Adapt (  ) 

Member Function Documentation

void H1Adapt::adapt ( double  thr  ) 

Selects elements to refine (based on results from calc_error() or calc_energy_error()) and performs their optimal hp-refinement.

double H1Adapt::calc_error ( Solution sln,
Solution rsln 
) [inline]

Type-safe version of calc_error_n() for one solution.

double H1Adapt::calc_error_n ( Tuple< Solution * >  slns,
Tuple< Solution * >  rslns 
)

Calculates the error of the solution. 'n' must be the same as 'num' in the constructor. After that, n coarse solution pointers are passed, followed by n fine solution pointers.

scalar H1Adapt::eval_error ( int  marker,
biform_val_t  bi_fn,
biform_ord_t  bi_ord,
MeshFunction sln1,
MeshFunction sln2,
MeshFunction rsln1,
MeshFunction rsln2 
) [protected]
scalar H1Adapt::eval_norm ( int  marker,
biform_val_t  bi_fn,
biform_ord_t  bi_ord,
MeshFunction rsln1,
MeshFunction rsln2 
) [protected]
double H1Adapt::get_adapt_time (  )  [inline]

Return the time need to the adaptivity step (in secs).

int H1Adapt::get_dof_count ( int  split,
order3_t  order[] 
) [protected]
double H1Adapt::get_error_time (  )  [inline]

Return the time need to calculate the error (in secs).

order3_t H1Adapt::get_form_order ( int  marker,
const order3_t ordu,
const order3_t ordv,
RefMap ru,
biform_ord_t  bf_ord 
) [protected]
int H1Adapt::get_num_refined_elements (  )  [inline]

Get the number of elements refined in the last adaptivity iteration.

void H1Adapt::get_optimal_refinement ( Mesh mesh,
Element e,
const order3_t order,
Solution rsln,
Shapeset ss,
int &  split,
order3_t  p[8] 
) [protected]

Used by adapt(). Can be utilized in specialized adaptivity procedures, for which adapt() is not sufficient.

double H1Adapt::get_projection_error ( Element e,
int  split,
int  son,
const order3_t order,
Solution rsln,
Shapeset ss 
) [protected]
void H1Adapt::init ( Tuple< Space * >  sp  ) 
void H1Adapt::set_aniso ( int  aniso  )  [inline]

Allow/disable aniso refinements.

Parameters:
[in] aniso - set to true to allow aniso refts, false to disable them
void H1Adapt::set_error_form ( int  i,
int  j,
biform_val_t  biform,
biform_ord_t  biform_ord 
)

Set the bilinear form on position [i,j] TODO: be more verbose here.

void H1Adapt::set_exponent ( double  exp  )  [inline]

Set the type of adaptivity.

Parameters:
[in] h_only - true if h-adaptivity should be performed
void H1Adapt::set_log_file ( FILE *  log_file  )  [inline]

Set the log file

  • use for debugging the adaptivity.

void H1Adapt::set_max_order ( int  order  )  [inline]

Set maximal order to be used.

void H1Adapt::set_strategy ( int  strat  )  [inline]

Set strategy type.

Parameters:
[in] strat - type of the strategy

  • 0 = adapt until the error drop below certain threshold
  • 1 = adapt until specified percentage of elements is refined
void H1Adapt::set_type ( int  h_only  )  [inline]

Set the type of adaptivity.

Parameters:
[in] h_only - true if h-adaptivity should be performed

Member Data Documentation

double H1Adapt::adapt_time [protected]
bool H1Adapt::aniso [protected]
double H1Adapt::error_time [protected]
double** H1Adapt::errors [protected]
int2* H1Adapt::esort [protected]
double H1Adapt::exponent [protected]
biform_val_t** H1Adapt::form [protected]
bool H1Adapt::h_only [protected]
bool H1Adapt::have_errors [protected]
FILE* H1Adapt::log_file [protected]
int H1Adapt::max_order [protected]
int H1Adapt::nact [protected]
double* H1Adapt::norms [protected]
int H1Adapt::num [protected]
biform_ord_t** H1Adapt::ord [protected]
Map<ProjKey, double> H1Adapt::proj_err [protected]
int H1Adapt::reft_elems [protected]
Solution** H1Adapt::rsln [protected]
Solution** H1Adapt::sln [protected]
Space** H1Adapt::spaces [protected]
int H1Adapt::strategy [protected]
double H1Adapt::total_err [protected]

The documentation for this class was generated from the following files:
Generated on Fri Sep 3 09:22:20 2010 for Hermes3D Library: Real Version by  doxygen 1.6.3