亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? domain.cpp

?? 不錯的國外的有限元程序代碼,附帶詳細的manual,可以節省很多的底層工作.
?? CPP
字號:
//   file DOMAIN.CXX
 
#include "domain.hxx"
#include "element.hxx"
#include "timestep.hxx"
#include "node.hxx"
#include "material.hxx"
#include "load.hxx"
#include "loadtime.hxx"
#include "timinteg.hxx"
#include "linsyst.hxx"
#include "string.hxx"
#include "freader.hxx"
#include "clock.h"
#include "debug.def"
#include "verbose.def"


Domain :: Domain ()
   // Constructor. Creates a new domain.
{
   dataFileName          = NULL ;
   elementList           = new List(0) ;
   nodeList              = new List(0) ;
   materialList          = new List(0) ;
   loadList              = new List(0) ;
   loadTimeFunctionList  = new List(0) ;
   timeIntegrationScheme = NULL ;
   inputStream  	 = NULL ;
   outputStream 	 = NULL ;
   numberOfElements      = 0 ;
   linearSystem          = new LinearSystem() ;
}


Domain :: Domain (char* s)
   // Constructor. Creates a new domain with data file 's'.
{
   dataFileName = new char[strlen(s)+1] ;
   strcpy (dataFileName,s) ;

   elementList           = new List(0) ;
   nodeList              = new List(0) ;
   materialList          = new List(0) ;
   loadList              = new List(0) ;
   loadTimeFunctionList  = new List(0) ;
   timeIntegrationScheme = NULL ;
   inputStream  	 = NULL ;
   outputStream 	 = NULL ;
   numberOfElements      = 0 ;
   linearSystem          = new LinearSystem() ;
}


Domain :: ~Domain ()
   // Destructor.
{
   delete dataFileName ;
   delete elementList ;
   delete nodeList ;
   delete materialList ;
   delete loadList ;
   delete loadTimeFunctionList ;
   delete timeIntegrationScheme ;
   delete linearSystem ;
   delete inputStream ;
   if (outputStream)
      fclose(outputStream) ;
}


void  Domain :: formTheSystemAt (TimeStep* stepN)
   // Assembles the system of linear equations, at the current time step.
{
   int i,nNodes ;

   this -> giveNumberOfElements() ;
   for (i=1 ; i<=numberOfElements ; i++)
      this -> giveElement(i) -> assembleYourselfAt(stepN) ;

   nNodes = this -> readNumberOf("Node") ;
   for (i=1 ; i<=nNodes ; i++)
      this -> giveNode(i) -> assembleYourLoadsAt(stepN) ;
}


char*  Domain :: giveDataFileName ()
   // Returns the name of the file containing the data of the problem.
{
   char s[64] ;

   if (! dataFileName) {
      printf ("please enter the name of the data file : \n") ;
      gets (s) ;
      dataFileName = new char[strlen(s)+1] ;
      strcpy (dataFileName,s) ;}

   return dataFileName ;
}


Element*  Domain :: giveElement (int n)
   // Returns the n-th element. Creates this element if it does not exist yet.
{
   Element* elem ;

   if (elementList -> includes(n))
      elem = (Element*) elementList->at(n) ;
   else {
      elem = (Element*) Element(n,this).typed() ;
      elementList -> put(n,elem) ;}

   return elem ;
}


FileReader*  Domain :: giveInputStream ()
   // Returns an input stream on the data file of the receiver.
{
   if (inputStream)
      return inputStream -> reset() ;

   else {
      if (outputStream) {              // flush output stream, if it exists
	 fclose (outputStream) ;
	 outputStream = NULL ;}
      inputStream = new FileReader(this->giveDataFileName()) ;
      return inputStream ;}
}


Load*  Domain :: giveLoad (int n)
   // Returns the n-th load. Creates this load if it does not exist yet.
{
   Load* load ;

   if (loadList -> includes(n))
      load = (Load*) loadList->at(n) ;
   else {
      load = (Load*) Load(n,this).typed() ;
      loadList -> put(n,load) ;}

   return load ;
}


LoadTimeFunction*  Domain :: giveLoadTimeFunction (int n)
   // Returns the n-th load-time function. Creates this fuction if it does
   // not exist yet.
{
   LoadTimeFunction* ltf ;

   if (loadTimeFunctionList -> includes(n))
      ltf = (LoadTimeFunction*) loadTimeFunctionList->at(n) ;
   else {
      ltf = (LoadTimeFunction*) LoadTimeFunction(n,this).typed() ;
      loadTimeFunctionList -> put(n,ltf) ;}

   return ltf ;
}


Material*  Domain :: giveMaterial (int n)
   // Returns the n-th material. Creates this material if it does not exist
   // yet.
{
   Material* mat ;

   if (materialList -> includes(n))
      mat = (Material*) materialList -> at(n) ;
   else {
      mat = new Material(n,this) ;
      materialList  -> put(n,mat) ;}

   return mat ;
}


Node*  Domain :: giveNode (int n)
   // Returns the n-th node. Creates this node if it does not exist yet.
{
   Node *node ;

   if (nodeList -> includes(n))
      node = (Node*) nodeList -> at(n) ;
   else {
      node = new Node(n,this) ;
      nodeList  -> put(n,node) ;}

   return node ;
}


int  Domain :: giveNumberOfElements ()
   // Returns the number of elements the problem consists of.
{
   if (! numberOfElements)
      numberOfElements = this -> readNumberOf("Element") ;
   return numberOfElements ;
}


FILE*  Domain :: giveOutputStream ()
   // Returns an output stream on the data file of the receiver.
{
   if (! outputStream) {
      if (inputStream) {                // flush input stream, if it exists
	 delete inputStream ;
	 inputStream = NULL ;}
      outputStream = fopen (dataFileName,"a") ;}

   return outputStream ;
}


TimeIntegrationScheme*  Domain :: giveTimeIntegrationScheme ()
   // Returns the time integration algorithm. Creates it if it does not
   // exist yet.
{
   TimeIntegrationScheme* scheme ;

   if (timeIntegrationScheme)
      return  timeIntegrationScheme ;
   else {
      scheme                = TimeIntegrationScheme(1,this).typed() ;
      timeIntegrationScheme = scheme ;
      return scheme ;}
}


void  Domain :: instanciateYourself ()
   // Creates all objects mentioned in the data file.
   // Exception : time step 2 and subsequent ones are not instanciated.
{
   int i,n ;

#  ifdef VERBOSE
      printf ("Reading all data from input file \n") ;
#  endif

   this -> giveTimeIntegrationScheme () ;

   n = this->readNumberOf("Node") ;
   nodeList -> growTo(n) ;
   for (i=1 ; i<=n ; i++)
      this -> giveNode(i) -> instanciateYourself() ;

   n = this->giveNumberOfElements() ;
   elementList -> growTo(n) ;
   for (i=1 ; i<=n ; i++)
      this -> giveElement(i) -> instanciateYourself() ;

   n = this->readNumberOf("Material") ;
   materialList -> growTo(n) ;
   for (i=1 ; i<=n ; i++)
      this -> giveMaterial(i) -> instanciateYourself() ;

   n = this->readNumberOf("Load") ;
   loadList -> growTo(n) ;
   for (i=1 ; i<=n ; i++)
      this -> giveLoad(i) -> instanciateYourself() ;

   n = this->readNumberOf("LoadTimeFunction") ;
   loadTimeFunctionList -> growTo(n) ;
   for (i=1 ; i<=n ; i++)
      this -> giveLoadTimeFunction(i) -> instanciateYourself() ;

   linearSystem -> carveYourselfFor(this) ;
}


int  Domain :: readNumberOf (char* type)
   // Gets from the data file the number of objects of type 'type' (e.g.
   // Element, or Node) that the receiver possesses.
{
   char value[8] ;

   this -> giveInputStream() -> read(type,value) ;
   return atoi(value) ;
}


void  Domain :: solveYourself ()
   // Solves the problem described by the receiver.
{
   TimeStep* currentStep ;

   this -> giveTimeIntegrationScheme() ;
   while (currentStep = timeIntegrationScheme->giveNextStep())
      this -> solveYourselfAt(currentStep) ;
}


void  Domain :: solveYourselfAt (TimeStep* stepN)
   // Solves the problem at the current time step.
{
   printf ("start forming the system : %.1f\n",timeNow()) ;
   this -> formTheSystemAt(stepN) ;

   printf ("start solving the system : %.1f\n",timeNow()) ;
     linearSystem -> solveYourself() ;

   printf ("start step termination   : %.1f\n",timeNow()) ;
     this -> terminate(stepN) ;

   printf ("end of step :              %.1f\n",timeNow()) ;
}


void  Domain :: terminate (TimeStep* stepN)
   // Performs all operations (printings and updates) for terminating time
   // step stepN.
{
   TimeStep* nextStep ;
   Element*  elem ;
   int       i,nNodes ;
   FILE*     File ;

   File = this -> giveOutputStream() ;
   fprintf (File,"\nSolution %d\n",stepN->giveNumber()) ;

   nNodes = nodeList -> giveSize() ;
   for (i=1 ; i<=nNodes ; i++)
      this -> giveNode(i) -> printOutputAt(stepN) ;

   for (i=1 ; i<=numberOfElements ; i++) {
      elem = this -> giveElement(i) ;
      elem -> printOutputAt(stepN) ;
      elem -> updateYourself() ;}

   nNodes = nodeList -> giveSize() ;
   for (i=1 ; i<=nNodes ; i++)
      this -> giveNode(i) -> updateYourself() ;

   if (stepN->isNotTheLastStep()) {
      nextStep = new TimeStep(stepN->giveNumber()+1,timeIntegrationScheme) ;
      if (nextStep->requiresNewLhs())
	 linearSystem -> updateYourself() ;
      else
	 linearSystem -> updateYourselfExceptLhs() ;
      delete nextStep ;}

   timeIntegrationScheme -> updateYourself() ;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频一区在线观看| 国产日韩欧美在线一区| 精品一区二区三区久久久| 欧美电影免费观看高清完整版在 | 国产日韩精品一区| 日本精品裸体写真集在线观看 | 亚洲乱码国产乱码精品精98午夜| 欧美日韩在线观看一区二区| 国产一区欧美二区| 亚洲自拍偷拍网站| 欧美国产激情一区二区三区蜜月| 欧美日韩一区二区不卡| 国产成人综合在线观看| 亚洲自拍偷拍欧美| 国产精品网曝门| 欧美一级久久久| 色综合 综合色| 东方欧美亚洲色图在线| 麻豆精品视频在线观看| 午夜精品在线看| 亚洲第一av色| 亚洲曰韩产成在线| 亚洲影视在线观看| 一区二区三区国产精华| 亚洲欧美日韩中文字幕一区二区三区 | 日韩一区国产二区欧美三区| 欧美三级中文字幕| 欧美亚洲国产一区二区三区va| www.亚洲色图| 不卡视频在线观看| 菠萝蜜视频在线观看一区| 国产精品一区二区男女羞羞无遮挡| 日本不卡免费在线视频| 日韩二区三区四区| 日本不卡一二三| 美腿丝袜一区二区三区| 麻豆精品国产传媒mv男同| 美女视频网站久久| 久久精品国内一区二区三区| 久久疯狂做爰流白浆xx| 精品一区二区在线观看| 狠狠网亚洲精品| 国产精品99久久久久久有的能看| 国产乱子伦一区二区三区国色天香 | 久久精品欧美日韩精品| 国产亚洲一区字幕| 国产精品乱人伦| 国产精品激情偷乱一区二区∴| 亚洲欧美中日韩| 亚洲柠檬福利资源导航| 午夜精品爽啪视频| 蜜桃传媒麻豆第一区在线观看| 蜜桃视频在线观看一区二区| 国产中文一区二区三区| 国产mv日韩mv欧美| 91免费观看国产| 51午夜精品国产| 欧美videossexotv100| 国产亚洲一二三区| 亚洲男人都懂的| 午夜视频在线观看一区二区 | 亚洲国产精品t66y| 综合激情成人伊人| 五月天精品一区二区三区| 久久精品国产网站| 成人午夜视频福利| 欧美日韩精品一区二区三区四区 | 亚洲女性喷水在线观看一区| 亚洲国产精品久久久久秋霞影院 | 亚洲成人一区在线| 国产麻豆一精品一av一免费| av在线不卡免费看| 欧美妇女性影城| 国产亚洲精品中文字幕| 亚洲一区二区av电影| 美女脱光内衣内裤视频久久影院| 成人精品国产福利| 在线播放亚洲一区| 中文字幕一区二区在线观看| 日韩电影免费一区| 成人免费观看视频| 91精品国产综合久久小美女 | 精品无码三级在线观看视频| 成人网男人的天堂| 欧美日韩免费一区二区三区视频| 久久嫩草精品久久久精品 | 国产传媒久久文化传媒| 欧美日韩视频在线第一区 | 国产亚洲精品免费| 亚洲不卡一区二区三区| 粉嫩高潮美女一区二区三区| 91黄视频在线观看| 国产欧美精品区一区二区三区| 五月婷婷欧美视频| 成人晚上爱看视频| 日韩欧美色电影| 亚洲自拍偷拍麻豆| 成人毛片老司机大片| 日韩欧美专区在线| 亚洲与欧洲av电影| 91免费版pro下载短视频| 久久精品亚洲精品国产欧美kt∨| 午夜精品福利在线| 91成人免费网站| 中文字幕国产一区二区| 蜜臀av一区二区在线观看| 欧美亚洲高清一区| 日韩一区欧美一区| 粉嫩av亚洲一区二区图片| 日韩欧美中文字幕精品| 午夜精彩视频在线观看不卡| 91丝袜呻吟高潮美腿白嫩在线观看| 久久免费的精品国产v∧| 琪琪久久久久日韩精品| 欧美视频一区二区在线观看| 亚洲三级电影网站| aaa欧美大片| 国产精品青草综合久久久久99| 国产一区 二区| 精品欧美久久久| 奇米精品一区二区三区在线观看一| 欧美色视频在线观看| 亚洲一区影音先锋| 91麻豆免费在线观看| 中文字幕制服丝袜一区二区三区 | 午夜国产精品影院在线观看| 色一情一伦一子一伦一区| 亚洲欧美国产毛片在线| 色综合天天综合给合国产| 国产精品久99| av在线播放不卡| 国产精品成人在线观看| 99精品国产91久久久久久| 综合色天天鬼久久鬼色| 色悠久久久久综合欧美99| 亚洲精品videosex极品| 欧美在线视频全部完| 亚洲第一福利一区| 777欧美精品| 美国一区二区三区在线播放| 欧美精品一区二区精品网| 狠狠色丁香久久婷婷综合丁香| 精品久久久久久久久久久院品网| 久草热8精品视频在线观看| 欧美精品一区二区三区四区| 国产成人精品免费网站| 中文字幕一区二区三区在线不卡 | 在线观看国产日韩| 亚洲va国产天堂va久久en| 欧美夫妻性生活| 麻豆视频一区二区| 久久久青草青青国产亚洲免观| 国产高清无密码一区二区三区| 国产精品天美传媒| 色婷婷激情一区二区三区| 视频一区视频二区中文| 欧美成人video| jiyouzz国产精品久久| 一区二区三区四区五区视频在线观看 | 欧美日韩国产首页| 紧缚奴在线一区二区三区| 中国av一区二区三区| 一本一本大道香蕉久在线精品| 亚洲图片欧美色图| 欧美成人伊人久久综合网| 成人高清av在线| 午夜精品久久久久影视| 2020国产成人综合网| 色悠久久久久综合欧美99| 久久国产精品露脸对白| 国产精品电影院| 欧美日韩成人在线一区| 国产精品66部| 一区二区三区欧美在线观看| 欧美大肚乱孕交hd孕妇| 91同城在线观看| 久久 天天综合| 亚洲久本草在线中文字幕| 美女www一区二区| 欧美v国产在线一区二区三区| 国内精品免费在线观看| 久久综合色8888| 久久亚洲影视婷婷| 亚洲一区二区三区在线播放| 亚洲超碰97人人做人人爱| 成人av网站免费| 在线观看视频91| 亚洲欧洲美洲综合色网| 国产高清在线精品| 国产三区在线成人av| 国产一二三精品| 精品久久久久久久人人人人传媒| 欧美国产精品一区二区三区| 91蜜桃传媒精品久久久一区二区| 亚洲五码中文字幕| 欧美xxx久久| 色综合天天综合网国产成人综合天| 亚洲一区二区黄色| 国产精品二区一区二区aⅴ污介绍| 欧美性感一区二区三区|