65 if (
NODEs[i].normal == NULL)
68 delete NODEs[i].normal[j];
93 default:
_errorr (
"Unknown enorm");
115 long j, k, l, regid, nip, nvalcomps, nno;
119 Dvctr n(4), IPvalsR_1, IPvalsR_2, IPvalsF_1, IPvalsF_2;
127 for (elem=0; elem<
nELEMs; elem++) {
135 if (nno == 3 && nip < 3)
_errorr(
"low number of int points");
136 if (nno == 4 && nip < 4)
_errorr(
"low number of int points");
141 for (j=0; j<nno; j++)
146 for (j=0; j<nno; j++)
157 for (j=0; j<nip; j++) {
163 for (k=0; k<nvalcomps; k++)
164 for (l=0; l<nno; l++)
165 IPvalsR_1[k] += n[l] * recovered_nodal_values_1[l][0][k];
169 for (k=0; k<nvalcomps; k++)
170 for (l=0; l<nno; l++)
171 IPvalsR_2[k] += n[l] * recovered_nodal_values_2[l][0][k];
194 default:
_errorr (
"Unsupported enorm");
209 long nsuperelems, superelems[64];
212 for (i=0; i<
nELEMs; i++) {
213 if (
e2i[i] >= 0.0)
continue;
218 for (k=0; k<nsuperelems; k++) {
219 if (
e2i[superelems[k]] >= 0.0) {
220 sum +=
e2i[superelems[k]];
232 double pe = sqrt( e2 / ( e2 + u2 ) );
236 double uaver, em, coeff, ksi;
240 em = coeff * rerror * sqrt( ( u2 + e2 ) /
nELEMs );
241 uaver = sqrt( ( u2 + e2 ) /
nELEMs );
250 for (i=0; i<
nELEMs; i++) {
255 ksi = sqrt(
e2i[i]) / em;
268 for (i=0; i<
nELEMs; i++) {
333 for (regid=0; regid<this->
nREGIONs; regid++) {
342 for (i=0; i<
nNODEs; i++) {
347 if (bp_recovered_nodes.
give_size() == 0)
continue;
354 for (i=0; i<
nNODEs; i++) {
355 if (
NODEs[i].bp_appli) {
375 for (
long i=0; i<
nELEMs; i++) {
379 if (elem->
normal)
continue;
390 else if (elem->
nnodes == 4) {
396 else _errorr(
"Unsupported number of nodes at element");
404 long i, j, k, ncoeff;
406 long nsuperelems, superelems[64];
433 for (i=0; i<
nNODEs; i++) {
443 for (j=0; j<nsuperelems; j++) {
445 if (regid ==
ELEMs[superelems[j]].regid) {
453 if (nsp >= ncoeff) node->
bp_appli = 1;
458 if (boundarytest && nsp) {
461 if (nnodes == 3) node->
boundary = 3;
462 else if (nnodes == 4) node->
boundary = 2;
472 for (k=0; k<patchelem->
nnodes; k++)
473 snodes[patchelem->
nodes[k]]++;
483 for (k=0; k<patchelem->
nnodes; k++)
484 snode = snode + snodes[patchelem->
nodes[k]];
486 if (snode != patchelem->
nnodes-1+2)
break;
497 for (i=0; i<
nNODEs; i++) {
502 if (node->
normal == NULL) {
514 node->
normal[regid] = normal;
519 if (node->
normal[regid] != NULL) {
520 double limit = 0.001;
521 normal = node->
normal[regid];
523 bool normalize =
false;
525 double xa = normal->
x < 0.0 ? -normal->
x : normal->
x;
526 double ya = normal->
y < 0.0 ? -normal->
y : normal->
y;
527 double za = normal->
z < 0.0 ? -normal->
z : normal->
z;
530 if (xa >= ya && xa >= za) {
531 if (normal->
x == 0.0)
_errorr(
"collapsed normal");
534 if (ya/xa < limit && za/xa < limit) {
547 else if (ya >= za && ya >= xa) {
548 if (normal->
y == 0.0)
_errorr(
"collapsed normal");
551 if (xa/ya < limit && za/ya < limit) {
565 if (normal->
z == 0.0)
_errorr(
"collapsed normal");
568 if (xa/za < limit && ya/za < limit) {
569 delete node->
normal[regid];
570 node->
normal[regid] = NULL;
605 bool supernode =
false;
606 bool cornertria =
false;
607 const NODE *patchnode;
623 bp_recovered_nodes.
add(node);
637 else if (boundarytest) {
641 if (patchnode->
boundary == 3) cornertria =
true;
646 if (node->
boundary) supernode =
true;
652 if (boundarytest && node->
boundary && supernode && !cornertria) {
660 long e, i, j, k, n, elemid;
663 const double *IP_values;
670 const NODE *mnode = bp_recovered_nodes[0];
675 PoinT mnode_loc_coords, ip_loc_coords, node_loc_coords;
676 bool mnormal = mnode->
normal[regid] ?
true :
false;
687 rhs =
new Dvctr[nvalcomps];
688 for (i=0; i<nvalcomps; i++) {
702 ip_loc_coords.
sub(&mnode_loc_coords);
703 coords = &ip_loc_coords;
711 for (j=0; j<ncoeff; j++) {
712 for (k=0; k<nvalcomps; k++)
713 rhs[k][j] += pol[j] * IP_values[k];
715 for (k=0; k<ncoeff; k++)
716 eqs(j,k) += pol[j] * pol[k];
723 if (! eqs.
GaussSolve (coeffs, rhs, nvalcomps))
729 Dvctr vals(nvalcomps);
732 for (n=0; n<bp_recovered_nodes.
give_size(); n++) {
733 node = bp_recovered_nodes[n];
738 node_loc_coords.
sub(&mnode_loc_coords);
740 coords = &node_loc_coords;
749 for (i=0; i<nvalcomps; i++)
750 for (j=0; j<ncoeff; j++)
751 vals[i] += pol[j] * coeffs[i][j];
755 if (values[node->
id] == NULL) {
756 values[node->
id] =
new Dvctr(nvalcomps);
758 cavalues[node->
id] = 0;
761 values[node->
id]->
add(&vals);
762 cavalues[node->
id]++;
772 default:
_errorr(
"Unknown SPR patch type");
783 pol[1] = coords[0].
x;
784 pol[2] = coords[0].
y;
786 default:
_errorr(
"Unknown SPR patch type");
806 answer[0] = ncoords[0];
807 answer[1] = ncoords[1];
808 answer[2] = ncoords[2];
812 answer[0] = 0.25 * (1 + ncoords[0]) * (1 + ncoords[1]);
813 answer[1] = 0.25 * (1 - ncoords[0]) * (1 + ncoords[1]);
814 answer[2] = 0.25 * (1 - ncoords[0]) * (1 - ncoords[1]);
815 answer[3] = 0.25 * (1 + ncoords[0]) * (1 - ncoords[1]);
819 answer[0] = 0.25 * (1 - ncoords[0]) * (1 - ncoords[1]);
820 answer[1] = 0.25 * (1 + ncoords[0]) * (1 - ncoords[1]);
821 answer[2] = 0.25 * (1 + ncoords[0]) * (1 + ncoords[1]);
822 answer[3] = 0.25 * (1 - ncoords[0]) * (1 + ncoords[1]);
824 default:
_errorr (
"Unknown edi");
841 default:
_errorr (
"Unknown edi");
2 dimensions; 4 nodes; bilinear interpolation // takto to ma nastavene OOFEM pro ctyruhelniky cisla u...
long nIPs1
number of integration points for integration set 1, i.e. integration of stiffness matrix ...
int boundary
node at boundary
VectoR * beP2P(const PoinT *p1, const PoinT *p2)
Receiver is set to vector from p1 to p2, i.e. 'this = p2 - p1'.
MEER_SPRboundaryPatchType SPR_boundary
Použitá strategie vytváření patchí na okraji regionu.
long regid
identifikační číslo (ID) regionu (číslováno od nuly) do kterého příslušný element patří...
VectoR ** normal
normala k plose v bode; 2d pole [nREGIONs, 1] predpoklad - v ramci jednoho regionu muze byt jen jedna...
2 dimensions; 3 nodes; linear interpolation // l1,l2,l3 (0;1) ...
long * nodes
pole délky nnodes s identifikačními čísly (číslováno od nuly) uzlů
double give_sum(void) const
Dvctr *** refined_node_values_1
Pole hodnot.
virtual void give_superelems_to_node(long nodeID, long &nsuperelems, long *superelems) const =0
NODES.
GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T...
long nELEMs
počet konečných prvků (elementů) sítě.
double MEER_mesh_refinement(double rerror)
rerror == required error
double give_dotproduct(const Dvctr &v)
long nREGIONs
počet regionů v konstrukci
double eval_interpol_fces_at_IPs2(long elementID, int ipid, double *answer) const
evaluate interpolation functions at element at IP with coordinates
void MEER_SPR_bp_recovered_nodes_detection(const NODE *node, GPA< const NODE > &bp_recovered_nodes)
vytvori seznam uzlu "bp_recovered_nodes", ktere se budou pocitat z dane patche == patche kolem uzlu "...
T * add(T *val)
add (assign) new pointer to the end; enlarge the receiver if too small
double give_element_characteristic_size(long elementID)
compute characteristic size of element = length of equidistant edge
void beRotatedPoint(const Dmtrx *rot, const PoinT *point)
Receiver will be point 'point' rotated by matrix 'rot'. this = rot . point.
energy norm - error^2 = strain_T * stress
PoinT coords
souradnice uzlu == global coordinates
void resize_ignore_vals(long r, long c)
print yourself
void MEER_SPR_compute_normals_at_elements(void)
Funkce spocita normaly na elementech, pokud jsou neinicializovane, tj. pokud nejsou predem spocteny e...
2 dimensions; 4 nodes; bilinear interpolation // takto to ma nastavene brnensky FEM pro prvek MITC4 c...
double h_min_ratio
minimalni povolene zmenseni elementu; je vhodne zadat asi 0.5 a mene
void set_alloc_REGIONs(long n)
allocate arrays
long give_size(void) const
void MEER_SPR_patch_recovered_nodes_compute(long regid, GPA< const NODE > &bp_recovered_nodes, MEER_IPValues valtype, Dvctr **values, Lvctr &cavalues)
void set_alloc_ELEMs(long n)
double solve(double req_error)
Funkce solve je hlavní, a jediná, výkonná funkce knihovny MEER.
void add(const Dvctr &src)
Structs Elem3D, PoinT and VectoR; classes Array, Array1d, Xscal, Dscal, Xvctr, Lvctr, Dvctr, Xmtrx, Lmtrx and Dmtrx.
void MEER_error_estimatior(void)
virtual long give_number_of_IPs2(long elementID) const =0
give number of integration points for integration set 1, i.e. integration of stiffness matrix ...
void MEER_SPR_basic_patch_detection(long regid)
bool GaussSolve(Dvctr &x, const Dvctr &rhs)
gaussian eliminatio
Patch se dělá v každém P1 bodě a interpoluje se navíc do všech P2 bodů na patchi. ...
void set_boundary_nodes(void)
PoinT * IPs1_coords
global coordinates of integration points for integration set 1
MEER_IPValues
Hodnoty v integracnich bodech, ktere budou vylepsovany a bude se z nich pocitat chyba.
virtual const double * give_IPs2_values(long elementID, int ipID, MEER_IPValues valtype) const =0
give values at integration points of IP set 2 spocte napeti z FEM v IP s coordinatama ...
long nNODEs
počet uzlů sítě konečných prvků v konstrukci
Dvctr *** refined_node_values_2
Dmtrx rotmat
rotation matrix, bude jen jedna, pri pocitani dalsiho regionu se prepise u normaly to tak nemuze byt...
MEER_ErrorNorm enorm
Typ použitého integrálního meřítka chyby.
bool normal_at_nodes
normaly v uzlech jsou zname/spoctene
virtual const double * give_IPs1_values(long elementID, int ipID, MEER_IPValues valtype) const =0
aby se ty cisla nemusely kopirovat sem tam, tak to mam zatim udelany tak, ze se posila const ukazatel...
void MEER_SPR_give_polynom(long sprtype, const PoinT *coords, Dvctr &pol)
void sbt(const Dvctr &src)
virtual double give_element_area(long elementID) const =0
give element area => u 1d prvku to ale asi bude delka, tak pak to budu muset predelat ...
virtual MEER_ElemDisplInterpol give_element_EDI(long elementID) const =0
ELEMENTS.
double h_max_ratio
maximalni povolene zvetseni elementu; je vhodne zadat asi 2.0 a vice
virtual double give_IPs2_coords_natural(long elementID, int ipID, double *ncoords) const =0
give weight as return value, and natural coordinates of node-th IP
Dvctr * assign_array(double *array, long s)
virtual ~MEER(void)
DESTRUCTOR.
virtual double give_element_thickness(long elementID) const =0
give element thickness
void set_alloc_NODEs(long n)
L2 norm - error^2 = stress_T * stress.
VectoR * beVectProduct(const VectoR *v1, const VectoR *v2)
vector product v1 x v2 (cross product)
void copy_row(long r, const Dvctr &v)
long nnodes
počet uzlů na elementu
void add(long val)
add value to size++ position
a) Patch se dělá v každém P1 bodě který není PB a interpoluje se navíc do všech PB a P2 bodů na patch...
long id
identification number
ELEMENT * ELEMs
pole delky 'nELEMs' struktur ELEMENT, v kterych jsou uchovany informace o prvcich ...
Dvctr * resize_ignore_vals(long newsize)
void MEER_SPR_nodal_recovery(void)
SPR nodal recovery.
Elem3D * add(const Elem3D *p)
void add_unique(T *src)
add new pointer "src" if unique
VectoR * normal
normala (vektor kolmy k plose prvku) delky 2*A (2 x plocha prvku), pro (zborceny) 4uhelnik staci spoc...
virtual long give_size(void) const
MEER_ElemDisplInterpol
pomoci tohoto enumu se predava nekolik informaci:
virtual double give_element_thickness_reduced(long elementID) const =0
give element thickness, !!! reduced, pro shelly to bude vzdy 1, protoze tam jsou integralni veliciny ...
int MEER_SPR_give_number_coefficients(long sprtype)
MEER_SPRpatchType
Typ spr patche, závisí na typu/geometrii elementů.
NODE * NODEs
pole delky 'nNODEs' struktur NODE, v kterych jsou uchovany informace o uzlu
Elem3D * sub(const Elem3D *p)
void realloc(long newsize)
reallocate up receiver
MEER_IPValues valtype_1
Hodnoty interpolovane do uzlu.
Lvctr * resize_ignore_vals(long newsize)
resize, ignore values
REGION * REGIONs
pole delky 'nREGIONs' struktur REGION, v kterych jsou uchovany informace o regionu ...