⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 material.cpp

📁 不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.
💻 CPP
字号:
//   file MATERIAL.CXX
 
#include "material.hxx"
#include "domain.hxx"
#include "verbose.def"
#include <stdlib.h>


double  Material :: give (char aProperty)
   // Returns the value of the property aProperty (e.g. the Young's modulus
   // 'E') of the receiver.
{
   double  value ;
 
   if (propertyDictionary -> includes(aProperty))
      value = propertyDictionary -> at(aProperty) ;
   else {                                         // read and store the value
      value = this -> read(aProperty) ;
      propertyDictionary -> add(aProperty,value) ;}
   return value ;
}


void  Material :: instanciateYourself ()
{
   double value ;

#  ifdef VERBOSE
      printf ("\ninstanciating material %d\n",number) ;
#  endif

   if (this->readWhetherHas("E")) {
      value = this -> read("E") ;
      propertyDictionary -> add('E',value) ;}

   if (this->readWhetherHas("n")) {
      value = this -> read("n") ;
      propertyDictionary -> add('n',value) ;}

   if (this->readWhetherHas("d")) {
      value = this -> read("d") ;
      propertyDictionary -> add('d',value) ;}

   if (this->readWhetherHas("A")) {
      value = this -> read("A") ;
      propertyDictionary -> add('A',value) ;}

   if (this->readWhetherHas("t")) {
      value = this -> read("t") ;
      propertyDictionary -> add('t',value) ;}
}


void  Material :: printYourself ()
   // Prints the receiver on screen.
{
   printf ("Material with properties : \n") ;
   propertyDictionary -> printYourself() ;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -