00001 #include "bnodvalt.h" 00002 00003 bnodvalt::bnodvalt () 00004 { 00005 // number of stored components 00006 nsc=0; 00007 // nodal values defined on boundaries 00008 nodval=NULL; 00009 } 00010 00011 bnodvalt::~bnodvalt () 00012 { 00013 delete [] nodval; 00014 } 00015 00016 /** 00017 function reads input data 00018 00019 @param in - input file 00020 00021 JK, 24.11.2008 00022 */ 00023 void bnodvalt::read (XFILE *in) 00024 { 00025 long i; 00026 00027 // number of stored components 00028 xfscanf (in,"%k%ld", "ncomp", &nsc); 00029 00030 nodval = new gfunct [nsc]; 00031 00032 for (i=0;i<nsc;i++){ 00033 nodval[i].read (in); 00034 } 00035 00036 } 00037 00038 /** 00039 function prints input data 00040 00041 @param out - output file 00042 00043 JK, 24.11.2008 00044 */ 00045 void bnodvalt::print (FILE *out) 00046 { 00047 long i; 00048 00049 // number of stored components 00050 fprintf (out,"%ld\n",nsc); 00051 00052 for (i=0;i<nsc;i++){ 00053 nodval[i].print (out); 00054 } 00055 00056 } 00057 00058 /** 00059 function computes nodal values 00060 it assembles nodal values on end nodes, edges 00061 or surfaces 00062 00063 @param t - input variable, usually time 00064 @param nv - array of nodal values 00065 00066 JK, 24.11.2008 00067 */ 00068 void bnodvalt::give_val (double t,vector &nv) 00069 { 00070 long i; 00071 00072 for (i=0;i<nsc;i++){ 00073 nv[i]=nodval[i].getval (t); 00074 } 00075 }