file: Hlib/src/Element.c
/**************************************************************************/
// //
// Author: T.Warburton //
// Design: T.Warburton && S.Sherwin //
// Date : 12/4/96 //
// //
// Copyright notice: This code shall not be replicated or used without //
// the permission of the author. //
// //
/**************************************************************************/
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <polylib.h>
#include "veclib.h"
#include "hotel.h"
#include "nekstruct.h"
int QGmax,LGmax;
/* zero physical and transformed storage */
void zerofield(Element *U){
while(U){
dzero(U->qa*U->qb, *U->h, 1); /* zero physical space */
dzero(U->Nmodes,U->vert->hj,1); /* zero jacobi space */
U = U->next;
}
}
#define ERR fprintf(stderr,"Accessing virtual function\n");
Element::Element(){
id = -1;
type = '-';
state = '-';
Nverts = Nedges = Nfaces = 0;
interior_l = lmax = 0;
Nmodes = Nbmodes= 0;
qa = qb = qc = 0;
vert = (Vert*) NULL;
edge = (Edge*) NULL;
face = (Face*) NULL;
curve = (Curve*)NULL;
curvX = (Cmodes*)NULL;
geom = (Geom*)NULL;
next = (Element*)NULL;
}
Element::Element(Element *E){
(*this) = (*E);
return;
}
Element::Element(const Element &E){
id = E.id;
type = E.type;
state = E.state;
Nverts = E.Nverts;
Nedges = E.Nedges;
Nfaces = E.Nfaces;
vert = (Vert *)calloc(Nverts,sizeof(Vert));
memcpy (vert,E.vert,Nverts*sizeof(Vert));
edge = (Edge *)calloc(Nedges,sizeof(Edge));
memcpy (edge,E.edge,Nedges*sizeof(Edge));
face = (Face *)calloc(Nfaces,sizeof(Face));
memcpy (face,E.face,Nfaces*sizeof(Face));
}
void Element::EdgeJbwd(double *d, int edg){
Basis *b = getbasis(); //OVERLOAD CALL: getbasis: Basis.c(Tri), Basis.c(Quad), Basis.c(Tet), Basis.c(Pyr), Basis.c(Prism), Basis.c(Hex), Basis.c(Element)
int va = vnum(edg,0); //OVERLOAD CALL: vnum: Nums.c(Quad), Nums.c(Tet), Nums.c(Pyr), Nums.c(Prism), Nums.c(Hex), Nums.c(Element), Nums.c(Tri)
int vb = vnum(edg,1), i; //OVERLOAD CALL: vnum: Nums.c(Quad), Nums.c(Tet), Nums.c(Pyr), Nums.c(Prism), Nums.c(Hex), Nums.c(Element), Nums.c(Tri)
dsmul(qa, vert[va].hj[0], b->vert[0].a, 1, d, 1);
daxpy(qa, vert[vb].hj[0], b->vert[1].a, 1, d, 1);
for(i = 0; i < edge[edg].l;++i)
daxpy(qa, edge[edg].hj[i], b->edge[0][i].a, 1, d, 1);
}
void Element::set_curved(Curve*){ERR;} // fix curve sides //OVERLOAD CALL: ERR: Element.c(?), hotel.h(?)
C++ to HTML Conversion by ctoohtml