00001 #ifndef GEDGE_H 00002 #define GEDGE_H 00003 00004 #include <stdio.h> 00005 #include "gnode.h" 00006 #include "vector.h" 00007 00008 /** 00009 class gedge 00010 00011 this class defines general edge, which can be 00012 used in connection with general finite elements 00013 only topological informations are collected 00014 00015 the class is motivated by solution of hemivariational 00016 inequalities, 00017 in 2D problems, there is a contact between two parts of a body 00018 matching mesh is assumed and therefore two elements share 00019 one edge, the edge has to know four nodes because it will work 00020 with differences of displacements 00021 00022 example: 00023 00024 BODY 1 00025 3 4 5 00026 ---2-------3--------4--------5---- 00027 ---6-------7--------8--------9---- 00028 2 3 4 00029 BODY 2 00030 00031 edge 4 from the body 1 and edge 3 from body 2 are identical, 00032 they are stored in one general edge which has to know nodes 3,7,4,8 00033 nodes in body 1 are ordered first, nodes in body 2 are ordered after 00034 ordering of body 1 00035 number of nodes on edge nn=4 00036 node multiplicity nm=2 00037 list of nodes on edge nlist[0]=3, nlist[1]=7, nlist[2]=4, nlist[3]=8 00038 00039 00040 JK, 9.7.2007 00041 */ 00042 00043 class gedge 00044 { 00045 public: 00046 00047 gedge (); 00048 ~gedge (); 00049 00050 void direction_vector (gnode *gnodes); 00051 void normal_vector (gnode *gnodes); 00052 00053 void print (FILE *out); 00054 00055 void give_dirvect (double *v); 00056 void give_norvect (double *v); 00057 00058 void check_normal (vector &x,vector &y,ivector &nod); 00059 00060 void alloc_cn (long nccnfn,long nccnln); 00061 00062 void give_first_node_numbers (long *fnn); 00063 void give_last_node_numbers (long *lnn); 00064 00065 void give_mult_code_numbers (long fln,long *mcn); 00066 00067 00068 /// the number of nodes on edge 00069 long nn; 00070 /// first node (number of first node) 00071 long fn; 00072 /// last node (number of last node) 00073 long ln; 00074 /// the number of DOFs defined on first nodes 00075 long ndofnf; 00076 /// the number of DOFs defined on last nodes 00077 long ndofnl; 00078 00079 /// previous edge 00080 long prev; 00081 /// next edge 00082 long next; 00083 00084 /// number of reference element 00085 long re; 00086 /// numbers of adjacent elements 00087 long *adjel; 00088 00089 /// node multiplicity 00090 long nm; 00091 /// list of nodes on edge 00092 long *nlist; 00093 /// array of code numbers for the first nodes (code numbers of Lagrange multipliers) 00094 long *cnfn; 00095 /// array of code numbers for the last nodes (code numbers of Lagrange multipliers) 00096 long *cnln; 00097 00098 /// length of the edge 00099 double l; 00100 /// direction %vector 00101 double *dv; 00102 /// normal %vector 00103 double *nv; 00104 00105 /// threshold 00106 double threshold; 00107 00108 }; 00109 00110 #endif