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

📄 print_problemstructure.c

📁 cfd求解器使用与gmsh网格的求解
💻 C
📖 第 1 页 / 共 4 页
字号:
	     List_Pointer(Problem->Group, CPR->RegionIndex))->Name) ;	if (CPR->SubRegionIndex >= 0)	  Msg(CHECK, " SubRegion %s ;",	      ((struct Group *)	       List_Pointer(Problem->Group, CPR->SubRegionIndex))->Name) ;	if (CPR->Type != CO->Type)	  Msg(CHECK, " Type %s ;", Get_StringForDefine(Constraint_Type, CPR->Type)) ;	switch (CPR->Type) {	case ASSIGN :	case INIT :	  Msg(CHECK, " Value Exp[%s] ;",	      Get_ExpressionName(Problem, CPR->Case.Fixed.ExpressionIndex)) ;	  break;	case ASSIGNFROMRESOLUTION :	case INITFROMRESOLUTION :	  Msg(CHECK, " NameOfResolution %s ;", CPR->Case.Solve.ResolutionName) ;	  break;	}	  	if (CPR->TimeFunctionIndex >= 0)	  Msg(CHECK, " TimeFunction Exp[%s] ;",	      Get_ExpressionName(Problem, CPR->TimeFunctionIndex)) ;	Msg(CHECK, " }\n") ;      }    }    Msg(CHECK, "    }\n");    Msg(CHECK, "  }\n") ;  }  Msg(CHECK, "\n");  Msg(CHECK, "}\n") ;  GetDP_End ;}/* ------------------------------------------------------- *//*  -->  P r i n t _ J a c o b i a n                       *//* ------------------------------------------------------- */void  Print_Jacobian(struct Problem  * Problem) {  int    i, Nbr, j, Nbrj, k ;  struct JacobianMethod *JM ;   struct JacobianCase *JC ;  GetDP_Begin("Print_Jacobian");  Nbr = List_Nbr(Problem->JacobianMethod) ;  Msg(CHECK, "Jacobian {  /* nbr = %d */\n", Nbr) ;  Msg(CHECK, "\n") ;  for (i = 0 ; i < Nbr ; i++) {    Msg(CHECK, " /* Num : %d */\n", i) ;    JM = (struct JacobianMethod*)List_Pointer(Problem->JacobianMethod, i) ;    Msg(CHECK, "  { Name %s ;\n", JM->Name) ;    Msg(CHECK, "    Case {\n") ;    Nbrj = List_Nbr(JM->JacobianCase) ;    for (j = 0 ; j < Nbrj ; j++) {      JC = (struct JacobianCase*)List_Pointer(JM->JacobianCase, j) ;      Msg(CHECK, "      { Region ") ;      if (JC->RegionIndex >= 0)	Msg(CHECK, "%s ;", ((struct Group *)			    List_Pointer(Problem->Group, JC->RegionIndex))->Name) ;      else  Msg(CHECK, "All ;") ;      Msg(CHECK, " Jacobian %s",	  Get_StringForDefine1Nbr(Jacobian_Type, JC->TypeJacobian)) ;      if (JC->NbrParameters) {	for (k = 0 ; k < JC->NbrParameters ; k++) {	  if (k)  Msg(CHECK, ",") ;  else  Msg(CHECK, " {") ;	  Msg(CHECK, " %.10g", JC->Para[k]) ;	}  Msg(CHECK, " }") ;      }      Msg(CHECK, " ; }\n") ;    }    Msg(CHECK, "    }\n");    Msg(CHECK, "  }\n") ;  }  Msg(CHECK, "\n");  Msg(CHECK, "}\n") ;  GetDP_End ;}/* ------------------------------------------------------- *//*  -->  P r i n t _ I n t e g r a t i o n                 *//* ------------------------------------------------------- */void  Print_Integration (struct Problem  * Problem) {  int    i, j, k, Nbrm, Nbrc, Nbrq ;  struct IntegrationMethod *IM ;    struct IntegrationCase *IC ;  struct Quadrature *Q ;  GetDP_Begin("Print_Integration");  Nbrm = List_Nbr(Problem->IntegrationMethod) ;  Msg(CHECK, "Integration {  /* nbr = %d */\n", Nbrm) ;  Msg(CHECK, "\n") ;  for (i = 0 ; i < Nbrm ; i++) {    Msg(CHECK, " /* Num : %d */\n", i) ;    IM = (struct IntegrationMethod*)List_Pointer(Problem->IntegrationMethod, i) ;    Msg(CHECK, "  { Name %s ; \n", IM->Name);    if(IM->CriterionIndex>=0)      Msg(CHECK, "    Criterion Exp[%s] ; \n", 	  Get_ExpressionName(Problem, IM->CriterionIndex));    Nbrc = List_Nbr(IM->IntegrationCase) ;    Msg(CHECK, "    Case {") ;    Msg(CHECK, "   /* nbr = %d */\n", Nbrc) ;    for (j = 0 ; j < Nbrc ; j++) {      IC = (struct IntegrationCase*)List_Pointer(IM->IntegrationCase, j) ;      Msg(CHECK, "       { Type %s ;",	  Get_StringForDefine(Integration_Type, IC->Type)) ;      switch (IC->Type) {      case GAUSS :	Msg(CHECK, "\n");	Msg(CHECK, "         Case {\n") ;	Nbrq = List_Nbr(IC->Case) ;	for (k = 0 ; k < Nbrq ; k++) {	  Q = (struct Quadrature*)List_Pointer(IC->Case, k) ;	  Msg(CHECK, "            { GeoElement %s ; NumberOfPoints %d ; }\n", 	      Get_StringForDefine(Element_Type, Q->ElementType),	      Q->NumberOfPoints) ;	}	Msg(CHECK, "         }\n"); 	Msg(CHECK, "       }\n") ;  break ;	      default :	Msg(CHECK, " }\n") ;  break ;      }    }    Msg(CHECK, "    }\n");    Msg(CHECK, "  }\n") ;  }  Msg(CHECK, "\n");  Msg(CHECK, "}\n") ;  GetDP_End ;}/* ------------------------------------------------------- *//*  -->  P r i n t _ F u n c t i o n S p a c e             *//* ------------------------------------------------------- */void  Print_FunctionSpace(struct Problem  * Problem) {  struct FunctionSpace *FS ;  struct BasisFunction *BF ;   struct SubSpace *SS ;  struct GlobalQuantity *GQ ;  struct ConstraintInFS *CO ;  List_T *BF_L, *SS_L, *GQ_L, *CO_L ;  int    i0, i, Nbr0, Nbr, j, Nbrj ;  GetDP_Begin("Print_FunctionSpace");  Nbr0 = List_Nbr(Problem->FunctionSpace) ;  Msg(CHECK, "FunctionSpace {  /* nbr = %d */\n", Nbr0) ;  Msg(CHECK, "\n") ;  for (i0=0 ; i0<Nbr0 ; i0++) {    Msg(CHECK, " /* Num : %d */\n", i0) ;      FS = (struct FunctionSpace*)List_Pointer(Problem->FunctionSpace, i0) ;    BF_L = FS->BasisFunction ;  SS_L = FS->SubSpace ;    GQ_L = FS->GlobalQuantity ;  CO_L = FS->Constraint ;    Msg(CHECK, "  { Name %s ; Type %s ;",	FS->Name, Get_StringForDefine(Field_Type, FS->Type)) ;    Msg(CHECK, "\n") ;    Nbr = List_Nbr(BF_L) ;    if (Nbr > 0) {      Msg(CHECK, "    BasisFunction {\n") ;      BF = (struct BasisFunction*)List_Pointer(BF_L, 0) ;      for (i=0 ; i<Nbr ; i++) {	Msg(CHECK, "    /* GlobalNum : %d */\n", BF->Num) ;	Msg(CHECK, "      Name %s ; NameOfCoef %s ; Function %s ;\n",	    BF->Name, BF->NameOfCoef,	    Get_StringFor3Function2Nbr(BF_Function, BF->Function)) ;	if (BF->SubFunction) {	  Msg(CHECK, "      SubFunction {") ;	  Nbrj = List_Nbr(BF->SubFunction) ;	  for (j=0 ; j<Nbrj ; j++)	    Msg(CHECK, " %s",		((struct Expression *)		 List_Pointer(Problem->Expression, 			      *((int *)List_Pointer(BF->SubFunction, j))))->Name) ;	  Msg(CHECK, " } ;\n") ;	}	if (BF->SubdFunction) {	  Msg(CHECK, "      SubdFunction {") ;	  Nbrj = List_Nbr(BF->SubdFunction) ;	  for (j=0 ; j<Nbrj ; j++)	    Msg(CHECK, " %s",		((struct Expression *)		 List_Pointer(Problem->Expression, 			      *((int *)List_Pointer(BF->SubdFunction, j))))->Name) ;	  Msg(CHECK, " } ;\n") ;	}	Msg(CHECK, "      Support %s ;", 	    (BF->SupportIndex >=0)?	    ((struct Group *)List_Pointer(Problem->Group, BF->SupportIndex))	    ->Name : "?") ;	Msg(CHECK, " Entity %s ;\n",	    (BF->EntityIndex >=0)?	    ((struct Group *)List_Pointer(Problem->Group, BF->EntityIndex))	    ->Name : "?") ;		BF += 1 ;      }      Msg(CHECK, "    }\n") ;    }    BF = (Nbr>0)? (struct BasisFunction*)List_Pointer(BF_L, 0) : NULL ;    Nbr = List_Nbr(SS_L) ;    if (Nbr > 0) {      Msg(CHECK, "    SubSpace {\n") ;      SS = (struct SubSpace*)List_Pointer(SS_L, 0) ;      for (i=0 ; i<Nbr ; i++) {	Msg(CHECK, "      Name %s ; NameOfBasisFunction {", SS->Name) ;	Nbrj = List_Nbr(SS->BasisFunction) ;	for (j=0 ; j<Nbrj ; j++)	  Msg(CHECK, " %s /* n%d */",	      ((struct BasisFunction *)	       List_Pointer(BF_L, *((int *)List_Pointer(SS->BasisFunction, j))))	      ->Name, *((int *)List_Pointer(SS->BasisFunction, j))) ;	Msg(CHECK, " } ;\n") ;	SS += 1 ;      }      Msg(CHECK, "    }\n") ;    }    Nbr = List_Nbr(GQ_L) ;    if (Nbr > 0) {      Msg(CHECK, "    GlobalQuantity {\n") ;      GQ = (struct GlobalQuantity*)List_Pointer(GQ_L, 0) ;      for (i=0 ; i<Nbr ; i++) {	Msg(CHECK, "    /* GlobalNum : %d */\n", GQ->Num) ;	Msg(CHECK, "      Name %s ; Type %s ;", 	    GQ->Name,	    Get_StringForDefine(GlobalQuantity_Type, GQ->Type)) ;	Msg(CHECK, " NameOfCoef %s ;\n", ((struct BasisFunction *)					  List_Pointer(BF_L, GQ->ReferenceIndex))->NameOfCoef) ;	GQ += 1 ;      }      Msg(CHECK, "    }\n") ;    }    Nbr = List_Nbr(CO_L) ;    if (Nbr > 0) {      Msg(CHECK, "    Constraint {\n") ;      CO = (struct ConstraintInFS*)List_Pointer(CO_L, 0) ;      for (i=0 ; i<Nbr ; i++) {	Msg(CHECK, "      NameOfCoef ") ;	if (CO->QuantityType == LOCALQUANTITY)	  Msg(CHECK, "%s ;", ((struct BasisFunction *)			      List_Pointer(BF_L, CO->ReferenceIndex))->NameOfCoef) ;	else if (CO->QuantityType == GLOBALQUANTITY)	  Msg(CHECK, "%s ;", ((struct GlobalQuantity *)			      List_Pointer(GQ_L, CO->ReferenceIndex))->Name) ;	else Msg(CHECK, "? ;") ;	Msg(CHECK, " // Entity %s ;\n",	    ((struct Group *)List_Pointer(Problem->Group, CO->EntityIndex))	    ->Name ) ;		switch(CO->ConstraintPerRegion->Type) {	case ASSIGN :	case INIT :	  Msg(CHECK, "      // Value Exp[%s] ;", Get_ExpressionName	      (Problem, CO->ConstraintPerRegion->Case.Fixed.ExpressionIndex)) ;	  break ;	case ASSIGNFROMRESOLUTION :	case INITFROMRESOLUTION :	  Msg(CHECK, "      // Resolution %s ;",	      CO->ConstraintPerRegion->Case.Solve.ResolutionName) ;	  break ;	}	if (CO->ConstraintPerRegion->TimeFunctionIndex >= 0)	  Msg(CHECK, " TimeFunction Exp[%s] ;",	      Get_ExpressionName(Problem,				 CO->ConstraintPerRegion->TimeFunctionIndex)) ;		Msg(CHECK, "\n") ;		CO += 1 ;      }      Msg(CHECK, "    }\n") ;    }    Msg(CHECK, "  }\n") ;  }  Msg(CHECK, "\n");  Msg(CHECK, "}\n") ;  GetDP_End ;}/* ------------------------------------------------------- *//*  -->  P r i n t _ F o r m u l a t i o n                 *//* ------------------------------------------------------- */void  Print_Formulation(struct Problem  * Problem) {  struct Formulation *FO ;  struct DefineQuantity *DQ ;  struct EquationTerm *FE ;  struct GlobalEquationTerm *GET ;  List_T *DQ_L, *FE_L ;  int    i, Nbr, j, Nbrj, k, Nbrk ;  GetDP_Begin("Print_Formulation");  Nbr = List_Nbr(Problem->Formulation) ;  Msg(CHECK, "Formulation {  /* nbr = %d */\n", Nbr) ;  Msg(CHECK, "\n") ;  for (i = 0 ; i < Nbr ; i++) {    Msg(CHECK, " /* Num : %d */\n", i) ;    FO = (struct Formulation*)List_Pointer(Problem->Formulation, i) ;    Msg(CHECK, "  { Name %s ; Type %s ;\n", FO->Name,	Get_StringForDefine(Formulation_Type, FO->Type)) ;    DQ_L = FO->DefineQuantity ;  FE_L = FO->Equation ;    Msg(CHECK, "    Quantity {\n") ;    Nbrj = List_Nbr(DQ_L) ;    for (j=0 ; j<Nbrj ; j++) {      DQ = (struct DefineQuantity*)List_Pointer(DQ_L, j) ;      Msg(CHECK, "      { Name %s ; Type %s ; NameOfSpace %s",	  DQ->Name,	  Get_StringForDefine(DefineQuantity_Type, DQ->Type),	  (DQ->FunctionSpaceIndex < 0) ? "?" :	  ((struct FunctionSpace *)	   List_Pointer(Problem->FunctionSpace, DQ->FunctionSpaceIndex))->Name) ;      if (DQ->IndexInFunctionSpace) {	if (DQ->Type == GLOBALQUANTITY)	  Msg(CHECK, "[%s]",	      ((struct GlobalQuantity *)	       List_Pointer	       (((struct FunctionSpace *)		 List_Pointer(Problem->FunctionSpace, DQ->FunctionSpaceIndex))		->GlobalQuantity,		*((int *)List_Pointer(DQ->IndexInFunctionSpace, 0))))->Name) ;	else if (DQ->Type == LOCALQUANTITY) {	  Msg(CHECK, "[") ;	  Nbrk = List_Nbr(DQ->IndexInFunctionSpace) ;	  for (k=0 ; k<Nbrk ; k++)	    Msg(CHECK, " %d", *((int *)List_Pointer(DQ->IndexInFunctionSpace, k))) ;	  Msg(CHECK, "]") ;	}      }      Msg(CHECK, " ;") ;      if (DQ->Type == INTEGRALQUANTITY) {	Msg(CHECK, "\n");	Msg(CHECK, "        Integration %s ;\n",	    ((struct IntegrationMethod *)	     List_Pointer(Problem->IntegrationMethod, 			  DQ->IntegralQuantity.IntegrationMethodIndex))->Name) ;	Msg(CHECK, "        Jacobian %s ;",	    ((struct JacobianMethod *)	     List_Pointer(Problem->JacobianMethod, 			  DQ->IntegralQuantity.JacobianMethodIndex))->Name) ;      }      Msg(CHECK, " }\n") ;    }    Msg(CHECK, "    }\n") ;    Msg(CHECK, "    Equation {\n") ;    Nbrj = List_Nbr(FE_L) ;    for (j=0 ; j<Nbrj ; j++) {      FE = (struct EquationTerm*)List_Pointer(FE_L, j) ;      if      (FE->Type == GALERKIN || FE->Type == DERHAM) {	if(FE->Type == GALERKIN) Msg(CHECK, "      Galerkin { Density [ ... ] ;\n") ;	if(FE->Type == DERHAM)   Msg(CHECK, "      deRham   { Density [ ... ] ;\n") ;	Msg(CHECK, "                 In %s ;\n",	    ((struct Group *)	     List_Pointer(Problem->Group, FE->Case.LocalTerm.InIndex))->Name ) ;	Msg(CHECK, "                 Jacobian %s ; \n",	    ((struct JacobianMethod *)	     List_Pointer(Problem->JacobianMethod, 			  FE->Case.LocalTerm.JacobianMethodIndex))->Name );	Msg(CHECK, "                 Integration %s ; }\n",	    ((struct IntegrationMethod *)	     List_Pointer(Problem->IntegrationMethod, 			  FE->Case.LocalTerm.IntegrationMethodIndex))->Name ) ;

⌨️ 快捷键说明

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