MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
SymbolicCLR< T, Tder > Struct Template Reference
Inheritance diagram for SymbolicCLR< T, Tder >:
Collaboration diagram for SymbolicCLR< T, Tder >:

Public Member Functions

virtual ConstitutiveLaw< T,
Tder > * 
Read (const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
 
- Public Member Functions inherited from ConstitutiveLawRead< T, Tder >
virtual ~ConstitutiveLawRead (void)
 

Detailed Description

template<class T, class Tder>
struct SymbolicCLR< T, Tder >

Definition at line 595 of file constltp_impl.cc.

Member Function Documentation

template<class T , class Tder >
virtual ConstitutiveLaw<T, Tder>* SymbolicCLR< T, Tder >::Read ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)
inlinevirtual

Implements ConstitutiveLawRead< T, Tder >.

Reimplemented in SymbolicViscoElasticCLR< T, Tder >, SymbolicViscousCLR< T, Tder >, and SymbolicElasticCLR< T, Tder >.

Definition at line 597 of file constltp_impl.cc.

References ASSERT, ConstLawType::ELASTIC, IncludeParser::GetLineData(), GetPreStress(), HighParser::GetStringWithDelims(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, SAFENEWWITHCONSTRUCTOR, ConstLawType::VISCOELASTIC, and ConstLawType::VISCOUS.

Referenced by SymbolicElasticCLR< T, Tder >::Read(), SymbolicViscousCLR< T, Tder >::Read(), and SymbolicViscoElasticCLR< T, Tder >::Read().

597  {
598  ConstitutiveLaw<T, Tder>* pCL = 0;
599 
600  unsigned dim;
601  if (typeid(T) == typeid(doublereal)) {
602  dim = 1;
603 
604  } else if (typeid(T) == typeid(Vec3)) {
605  dim = 3;
606 
607  } else if (typeid(T) == typeid(Vec6)) {
608  dim = 6;
609 
610  } else {
611  silent_cerr("Invalid dimensionality "
612  "for symbolic constitutive law "
613  "at line " << HP.GetLineData()
614  << std::endl);
616  }
617 
618  std::vector<std::string> epsilon;
619  if (CLType & ConstLawType::ELASTIC) {
620  if (!HP.IsKeyWord("epsilon")) {
621  silent_cerr("keyword \"epsilon\" expected at line " << HP.GetLineData() << std::endl);
623  }
624 
625  epsilon.resize(dim);
626 
627  for (unsigned row = 0; row < dim; row++) {
628  const char *tmp = HP.GetStringWithDelims();
629 
630  if (tmp == 0) {
631  silent_cerr("unable to get \"epsilon\" "
632  "symbol #" << row << " "
633  "at line " << HP.GetLineData() << std::endl);
635  }
636  epsilon[row] = tmp;
637  }
638  }
639 
640  std::vector<std::string> epsilonPrime;
641  if (CLType & ConstLawType::VISCOUS) {
642  if (!HP.IsKeyWord("epsilon" "prime")) {
643  silent_cerr("keyword \"epsilon prime\" expected at line " << HP.GetLineData() << std::endl);
645  }
646 
647  epsilonPrime.resize(dim);
648 
649  for (unsigned row = 0; row < dim; row++) {
650  const char *tmp = HP.GetStringWithDelims();
651 
652  if (tmp == 0) {
653  silent_cerr("unable to get \"epsilonPrime\" "
654  "symbol #" << row << " "
655  "at line " << HP.GetLineData() << std::endl);
657  }
658  epsilonPrime[row] = tmp;
659  }
660  }
661 
662  if (!HP.IsKeyWord("expression")) {
663  silent_cerr("keyword \"expression\" expected at line " << HP.GetLineData() << std::endl);
665  }
666 
667  std::vector<std::string> expression(dim);
668  for (unsigned row = 0; row < dim; row++) {
669  const char *tmp = HP.GetStringWithDelims();
670  if (tmp == 0) {
671  silent_cerr("unable to get \"expression\" "
672  "#" << row << " "
673  "at line " << HP.GetLineData()
674  << std::endl);
676  }
677  expression[row] = tmp;
678  }
679 
680  /* Prestress and prestrain */
681  T PreStress(mb_zero<T>());
682  GetPreStress(HP, PreStress);
683 #ifdef USE_GINAC
684  TplDriveCaller<T>* pTplDC =
685 #endif /* ! USE_GINAC */
686  GetPreStrain<T>(pDM, HP);
687 
688  switch (CLType) {
689  case ConstLawType::ELASTIC: {
690 #ifdef USE_GINAC
692  SAFENEWWITHCONSTRUCTOR(pCL, L,
693  L(pTplDC, PreStress,
694  epsilon,
695  expression));
696 #else /* ! USE_GINAC */
697  silent_cerr("symbolic constitutive law not supported "
698  "at line " << HP.GetLineData() << std::endl);
700 #endif /* ! USE_GINAC */
701  break;
702  }
703 
704  case ConstLawType::VISCOUS: {
705 #ifdef USE_GINAC
707  SAFENEWWITHCONSTRUCTOR(pCL, L,
708  L(PreStress, epsilonPrime, expression));
709 #else /* ! USE_GINAC */
710  silent_cerr("symbolic constitutive law not supported "
711  "at line " << HP.GetLineData() << std::endl);
713 #endif /* ! USE_GINAC */
714  break;
715  }
716 
718 #ifdef USE_GINAC
720  SAFENEWWITHCONSTRUCTOR(pCL, L,
721  L(pTplDC, PreStress,
722  epsilon, epsilonPrime,
723  expression));
724 #else /* ! USE_GINAC */
725  silent_cerr("symbolic constitutive law not supported "
726  "at line " << HP.GetLineData() << std::endl);
728 #endif /* ! USE_GINAC */
729  break;
730  }
731 
732  default:
733  ASSERT(0);
735  }
736 
737  return pCL;
738  };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
Definition: matvec6.h:37
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
Definition: parser.cc:1228
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
void GetPreStress(MBDynParser &HP, T &PreStress)
double doublereal
Definition: colamd.c:52
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:


The documentation for this struct was generated from the following file: