loadtime.cpp
来自「不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.」· C++ 代码 · 共 55 行
CPP
55 行
// file LOADTIME.CXX
#include "loadtime.hxx"
#include "constant.hxx"
#include "peak.hxx"
#include "piecewis.hxx"
#include "domain.hxx"
#include <stdlib.h>
#include <stdio.h>
LoadTimeFunction* LoadTimeFunction :: ofType (char* aClass)
// Returns a new function, which has the same number than the receiver,
// but which also is typed (ConstantFunction, PeakFunction,...).
{
LoadTimeFunction* newLTF ;
if (! strncmp(aClass,"ConstantFunction",5))
newLTF = new ConstantFunction(number,domain) ;
else if (! strncmp(aClass,"PeakFunction",5))
newLTF = new PeakFunction(number,domain) ;
else if (! strncmp(aClass,"PiecewiseLinFunction",5))
newLTF = new PiecewiseLinFunction(number,domain) ;
else {
printf("%s : unknown type of load-time function \n",aClass) ;
exit(0) ;}
return newLTF ;
}
LoadTimeFunction* LoadTimeFunction :: typed ()
// Returns a new load, which has the same number than the receiver,
// but is typed.
{
LoadTimeFunction* newLTF ;
char type[32] ;
this -> readString("class",type) ;
newLTF = this -> ofType(type) ;
return newLTF ;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?