00001 #include "endnodem.h" 00002 #include "global.h" 00003 #include "globmat.h" 00004 #include <string.h> 00005 00006 /** 00007 constructor 00008 00009 JK, 1.3.2009 00010 */ 00011 endnodem::endnodem (void) 00012 { 00013 // number of approximated functions 00014 napfun = 0; 00015 if (napfun<1){ 00016 print_err("wrong number of approximated functions is required",__FILE__,__LINE__,__func__); 00017 } 00018 00019 // number of assigned general endnode from GEFEL 00020 nen = 0; 00021 00022 // nodal displacements in the global coordinate system 00023 u1=0.0; u2=0.0; 00024 v1=0.0; v2=0.0; 00025 00026 // jumps in the displacement field 00027 ju=0.0; jv=0.0; 00028 00029 // type of material model 00030 tm = NULL; 00031 // id of material model 00032 idm = NULL; 00033 00034 // auxiliary array for nodal displacements 00035 // this class serves only for 2D problems 00036 // it means that nodes contain 2 DOFs 00037 r = new double [2]; 00038 } 00039 00040 endnodem::~endnodem (void) 00041 { 00042 delete [] tm; 00043 delete [] idm; 00044 delete [] r; 00045 } 00046 00047 00048 /** 00049 function assembles nodal displacements 00050 00051 @param lcid - load case id 00052 00053 JK, 1.3.2009 00054 */ 00055 void endnodem::nodal_displacements (long lcid) 00056 { 00057 long nid; 00058 00059 // first node at the end node 00060 nid=Gtm->endnodes[nen].fn; 00061 // nodal displacements 00062 noddispl (lcid,r,nid); 00063 u1=r[0]; v1=r[1]; 00064 00065 // second node on the end node 00066 nid=Gtm->gedges[nen].ln; 00067 // nodal displacements 00068 noddispl (lcid,r,nid); 00069 u2=r[0]; v2=r[1]; 00070 00071 } 00072 00073 /** 00074 computes jumps in displacement field at the end node 00075 00076 JK, 1.3.2009 00077 */ 00078 void endnodem::compute_jumps () 00079 { 00080 ju = u2-u1; 00081 jv = v2-v1; 00082 } 00083 00084 /** 00085 function computes derivative of the end node functional with respect 00086 to the nodal displacements 00087 the end node functional is called lipschitz continuous perturbation or 00088 local lipschitz functional 00089 00090 @param lcid - load case id 00091 @param v - array containing the %vector of derivative 00092 00093 JK, 1.3.2009 00094 */ 00095 void endnodem::compute_endnode_functional_derivative (long lcid,double *v) 00096 { 00097 // nodal displacements at nodes on edge 00098 nodal_displacements (lcid); 00099 // magnitudes of jumps between two subdomains 00100 compute_jumps (); 00101 00102 } 00103