gausspnt.cpp
来自「不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.」· C++ 代码 · 共 64 行
CPP
64 行
// file GAUSSPNT.CXX
#include "gausspnt.hxx"
#include "element.hxx"
#include "domain.hxx"
#include "string.hxx"
#include "debug.def"
GaussPoint :: GaussPoint (Element* e, int n, FloatArray* a, double w)
// Constructor. Creates a Gauss point belonging to element e, with number
// n, with coordinates a, with weight w.
{
element = e ;
number = n ;
coordinates = a ;
weight = w ;
strainVector = NULL ;
stressVector = NULL ;
}
GaussPoint :: ~GaussPoint ()
// Destructor.
{
delete coordinates ;
delete strainVector ;
delete stressVector ;
}
void GaussPoint :: printOutput ()
// Prints the strains and stresses on the data file.
{
FILE *File ;
int i,n ;
File = element -> giveDomain() -> giveOutputStream() ;
fprintf (File," GP %d : strains ",number) ;
n = strainVector -> giveSize() ;
for (i=1 ; i<=n ; i++)
fprintf (File," % .4e",strainVector->at(i)) ;
fprintf (File,"\n stresses",number) ;
n = stressVector -> giveSize() ;
for (i=1 ; i<=n ; i++)
fprintf (File," % .4e",stressVector->at(i)) ;
fprintf (File,"\n") ;
}
void GaussPoint :: updateYourself ()
// Performs end-of-step updates.
{
delete strainVector ;
delete stressVector ;
strainVector = NULL ;
stressVector = NULL ;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?