Flow123d
JS_before_hm-62-ge56f9d5
|
#include <dh_cell_accessor.hh>
Public Member Functions | |
ElementAccessor () | |
Default invalid accessor. More... | |
ElementAccessor (const Mesh *mesh, RegionIdx r_idx) | |
Regional accessor. More... | |
ElementAccessor (const Mesh *mesh, unsigned int idx) | |
Element accessor. More... | |
void | inc () |
Incremental function of the Element iterator. More... | |
vector< arma::vec3 > | vertex_list () const |
Return list of element vertices. More... | |
double | measure () const |
Computes the measure of the element. More... | |
double | tetrahedron_jacobian () const |
arma::vec::fixed< spacedim > | centre () const |
Computes the barycenter. More... | |
double | quality_measure_smooth (SideIter side) const |
SideIter | side (const unsigned int loc_index) |
const SideIter | side (const unsigned int loc_index) const |
bool | is_regional () const |
bool | is_elemental () const |
bool | is_valid () const |
unsigned int | dim () const |
const Element * | element () const |
Region | region () const |
RegionIdx | region_idx () const |
bool | is_boundary () const |
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular mesh. More... | |
unsigned int | idx () const |
Return local idx of element in boundary / bulk part of element vector. More... | |
unsigned int | mesh_idx () const |
Return global idx of element in full element vector. More... | |
unsigned int | index () const |
unsigned int | proc () const |
const Node * | node (unsigned int ni) const |
NodeAccessor< 3 > | node_accessor (unsigned int ni) const |
BoundingBox | bounding_box () const |
bool | operator== (const ElementAccessor< spacedim > &other) |
const Element * | operator-> () const |
Private Attributes | |
unsigned int | dim_ |
Dimension of reference element. More... | |
const Mesh * | mesh_ |
Pointer to the mesh owning the element. More... | |
bool | boundary_ |
True if the element is boundary. More... | |
unsigned int | element_idx_ |
Index into Mesh::element_vec_ array. More... | |
RegionIdx | r_idx_ |
Region index. More... | |
Static Private Attributes | |
static const unsigned int | undefined_dim_ = 100 |
Element accessor templated just by dimension of the embedding space, used by Fields. This should allow algorithms over elements where dimension of particular element is runtime parameter.
This class suites as interface of Fields to the mesh elements, in particular this accessor knows directly the region, and also can be used as an accessor that works on the whole region if used by Fields that do not depend on particular elements as FieldConstant, FiledFormula, and FieldPython.
TODO:
Ideas: need function to calculate intersection (object) of two ElementAccessors, but this definitely should be templated by dimension of the ref. element (or rather shape of ref. element), here we can have case dispatch
Navrh algoritmu pro hledani pruniku elementu dvou siti (libovlnych dimenzi) algoritmus postupuje od bodu pruniku pres usecky a polygony k mnohostenum
Vstup: Sit1 dimenze d1 a Sit2 dimenze d2 predpoladam d1<=d2
1) hladam body na hranici pruniku tj. Intersection<d> <d_e1,d_e2> .. prunik ma dimenzi d a pronikaji se simplexy dimenze d_e1, a d_e2
Intersection<0><0,0> .. totozne vrcholy El<0> Intersection<0><0,1> a <1,0> .. vrchol jedne site lezi na hrane druhe site Intersection<0><0,n> a <n,0> .. vrchol lezi na El<n> druhe site
Intersection<0><1,1> .. bodovy prusecik dvou usecek v rovine Intersection<0><1,2> a <2,1> ... prusecik hrany a trojuhelnika ... dalsi zvlastni pripady vcetne <0><3,3> .. tetrahedrony s vrcholem na povrchu druheho
2) liniove pruniky Intersection<1>: Intersection<1><1,1> .. usecky na spolecne primce Intersection<1><1,2> a <2,1>.. usecka v rovine trojuhelnika Intersection<1><1,3> a <3,1> .. usecka a tetrahedron Intersection<1><2,2> .. prusecik dvou trojuhelniku Intersection<1><2,3> a <3,2> .. trojuhelnik a hrana tetrahedronu ..
... doprcic je to fakt hodne moznosti a je otazka, zda je nutne je vsechny rozlisovat
Algoritmus by mel probuhat takto:
1) Najdu vrchol V site 1 a element E site 2 aby V byl v E (to neni tak trivialni, pokud site nepokryvaji stejnou oblast ale snad by to slo hledat v pruniku obalovych boxu) 2) najdu pruseciky P_i hran z vrcholu V s povrchem E, konstruuju vsechny potrebne pruniky elementu majici vrchol V s elementem E
Sousedni elementy spolu s hranami ktere do nich vedou ulozim do prioritni fronty.
3) Vyberu z prioritni fronty novy E, pricemz vyuzivam spositane pruseciky psislusne steny a okoli vrcholu V tj. jdu po hranach po kterych jsem do noveho lementu prisel a najdu vsechny hranove pruniky, pak konstuuju slozitejsi pruniky az mam vsechny pruniky s novym elementem ...
...
Prioritni fronta by preferovala elementy do kterych jsem se nejvicekrat dostal, tim se snazim minimalizovat povrch projite oblasti. Je ale mozne, ze to algoritmus naopak zpomali, pokud je prioritni fronta log(n).
Zpracovani jednoho elementu tedy zahrnuje 1) trasovani hran: pro hranu H: testuju hledam prusecik se ctyrstenem: ANO -> pamatuju si hranovy prunik a ke stene (resp. sousednimu elementu) kde hrana vychazi pridam vychozi hranu NE -> konci ve vrcholu, dalsi hrany vychazejici z vrcholu pridam na seznam hran vchazejicich do elementu
2) po nalezeni pruniku vsech hran, hledam pruniky vsech vchazejicich ploch: jedna plocha ma se vstupni stenou useckovy prunik na jehoz konci jsou: *vstupni hrana
3) Podobne trasuju vchazejici objemy
?? lze nejak vyuzit pokud ma element vice vstupnich sten minimalne se da kontrolovat ...
Struktura systemu pruniku do budoucna: 1) trida IntersectionManager, ma matici vektoru. Na poli A(i,j) je vektor lokalnich souradnic na elementu dimenze i (chodi od 1 do 3) pruniku dimenze j (chodi od 0 do 3 resp do 2 pokud nebudu chtit prekryvy siti stejne dimenze)
2) Jeden intersection objekt je pak iterator dvou elementu a dva indexy lokalnich souradnic v prislusnych vektorech.
Prozatim to zjednodusime tak, ze vektory lokalnich souradnic budu alokovat zvlast a nebudu je zdruzovat
Nakonec potrebuju pocitat integral pres prunik z nejake funkce f(phi_a(x), phi_b(x)), kde phi_a je bazova funkce na jednom elementu a phi_b na druhem. To budu delat numerickou kvadraturou, takze potrebuji zobrazit prunik na jednotkovy simplex. Pro uzel kvardatury x_i musim najit body a_i a b_i na referencnich elementech A a B. Tj potrebuju lokalni souradnice (to jsou souradnice na referencnich elementech) kvadraturnich bodu. V nic pak umim spocitat hodnotu bazovych funkci a pak i hodnotu funkce f.
K tomu staci mit matici transformace pruniku na referencni element. Takze bych pro jednotlive dvojice element - prunik mel matici + posouvaci vektor z armadila.
Definition at line 30 of file dh_cell_accessor.hh.
|
inline |
Default invalid accessor.
Default invalid accessor.
Definition at line 25 of file accessors_impl.hh.
|
inline |
|
inline |
|
inline |
Return bounding box of the element. Simpler code, but need to check performance penelty.
Definition at line 210 of file accessors.hh.
|
inline |
Computes the barycenter.
SET THE "CENTRE[]" FIELD IN STRUCT ELEMENT
Definition at line 112 of file accessors_impl.hh.
|
inline |
|
inline |
|
inline |
Return local idx of element in boundary / bulk part of element vector.
Definition at line 180 of file accessors.hh.
|
inline |
Incremental function of the Element iterator.
Definition at line 53 of file accessors_impl.hh.
|
inline |
|
inline |
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular mesh.
Definition at line 175 of file accessors.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Computes the measure of the element.
SET THE "METRICS" FIELD IN STRUCT ELEMENT
Definition at line 82 of file accessors_impl.hh.
|
inline |
Return global idx of element in full element vector.
Definition at line 186 of file accessors.hh.
|
inline |
|
inline |
|
inline |
-> dereference operator
Allow simplify calling of element() method. Example:
Definition at line 229 of file accessors.hh.
|
inline |
Definition at line 214 of file accessors.hh.
|
inline |
|
inline |
Quality of the element based on the smooth and scale-invariant quality measures proposed in: J. R. Schewchuk: What is a Good Linear Element?
We scale the measure so that is gives value 1 for regular elements. Line 1d elements have always quality 1.
Definition at line 128 of file accessors_impl.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 165 of file accessors_impl.hh.
|
inline |
Computes the Jacobian of the element. J = det ( 1 1 1 1 ) x1 x2 x3 x4 y1 y2 y3 y4 z1 z2 z3 z4
Definition at line 69 of file accessors_impl.hh.
|
inline |
Return list of element vertices.
Definition at line 62 of file accessors_impl.hh.
|
private |
True if the element is boundary.
Definition at line 247 of file accessors.hh.
|
private |
Dimension of reference element.
Definition at line 242 of file accessors.hh.
|
private |
Index into Mesh::element_vec_ array.
Definition at line 250 of file accessors.hh.
|
private |
Pointer to the mesh owning the element.
Definition at line 245 of file accessors.hh.
|
private |
Region index.
Definition at line 253 of file accessors.hh.
|
staticprivate |
When dim_ == undefined_dim_ ; the value of element_idx_ is invalid. Is used for ElementAccessors for whole region
Definition at line 239 of file accessors.hh.