ProParser.y (getdp-3.4.0-source.tgz) | : | ProParser.y (getdp-3.5.0-source.tgz) | ||
---|---|---|---|---|
skipping to change at line 317 | skipping to change at line 317 | |||
%token tResolution tHidden | %token tResolution tHidden | |||
%token tDefineSystem | %token tDefineSystem | |||
%token tNameOfFormulation tNameOfMesh tFrequency tSolver | %token tNameOfFormulation tNameOfMesh tFrequency tSolver | |||
%token tOriginSystem tDestinationSystem | %token tOriginSystem tDestinationSystem | |||
%token tOperation tOperationEnd | %token tOperation tOperationEnd | |||
%token tSetTime tSetTimeStep tSetDTime tDTime tSetFrequency | %token tSetTime tSetTimeStep tSetDTime tDTime tSetFrequency | |||
%token tFourierTransform tFourierTransformJ | %token tFourierTransform tFourierTransformJ | |||
%token tCopySolution tCopyRHS tCopyResidual tCopyIncrement tCopyDofs | %token tCopySolution tCopyRHS tCopyResidual tCopyIncrement tCopyDofs | |||
%token tGetNormSolution tGetNormResidual tGetNormRHS tGetNormIncrement | %token tGetNormSolution tGetNormResidual tGetNormRHS tGetNormIncrement | |||
%token tOptimizerInitialize tOptimizerUpdate tOptimizerFinalize | %token tOptimizerInitialize tOptimizerUpdate tOptimizerFinalize | |||
%token tLanczos tEigenSolve tEigenSolveAndExpand tEigenSolveJac tPerturbati on | %token tLanczos tEigenSolve tEigenSolveAndExpand tEigenSolveJac | |||
%token tUpdate tUpdateConstraint tBreak tExit tGetResidual tCreateSolution | %token tUpdate tUpdateConstraint tBreak tExit tGetResidual tCreateSolution | |||
%token tEvaluate tSelectCorrection tAddCorrection tMultiplySolution | %token tEvaluate tSelectCorrection tAddCorrection tMultiplySolution | |||
%token tAddOppositeFullSolution tSolveAgainWithOther tSetGlobalSolverOption s | %token tAddOppositeFullSolution tSolveAgainWithOther tSetGlobalSolverOption s | |||
%token tAddVector | %token tAddVector | |||
%token tTimeLoopTheta tTimeLoopNewmark tTimeLoopRungeKutta tTimeLoopAdaptiv e | %token tTimeLoopTheta tTimeLoopNewmark tTimeLoopRungeKutta tTimeLoopAdaptiv e | |||
%token tTime0 tTimeMax tTheta | %token tTime0 tTimeMax tTheta | |||
%token tBeta tGamma | %token tBeta tGamma | |||
%token tIterativeLoop tIterativeLoopN tIterativeLinearSolver | %token tIterativeLoop tIterativeLoopN tIterativeLinearSolver | |||
%token tNbrMaxIteration tRelaxationFactor | %token tNbrMaxIteration tRelaxationFactor | |||
skipping to change at line 657 | skipping to change at line 657 | |||
| SuppListOfRegion Comma tAlignedWith tSTRING | | SuppListOfRegion Comma tAlignedWith tSTRING | |||
{ | { | |||
// This is a bit of a hack, due to the fact the groups needed for trees | // This is a bit of a hack, due to the fact the groups needed for trees | |||
// with autosimilarity constraints are constructed in the parser when | // with autosimilarity constraints are constructed in the parser when | |||
// analysing the Constraint field. Since we cannot "just create a group", | // analysing the Constraint field. Since we cannot "just create a group", | |||
// we use the SuppList type to encode the AlignedWith parameter. | // we use the SuppList type to encode the AlignedWith parameter. | |||
if (nb_SuppList+1 <= 2) { | if (nb_SuppList+1 <= 2) { | |||
if(!strcmp($4, "Z")) { | if(!strcmp($4, "Z")) { | |||
Type_SuppLists[nb_SuppList] = -3; | Type_SuppLists[nb_SuppList] = -3; | |||
} | } | |||
else if(!strcmp($4, "Rx")) { | ||||
Type_SuppLists[nb_SuppList] = -4; | ||||
} | ||||
else if(!strcmp($4, "Rz")) { | ||||
Type_SuppLists[nb_SuppList] = -6; | ||||
} | ||||
else{ | else{ | |||
vyyerror(0, "Unknown AlignedWith parameter: %s", $4); | vyyerror(0, "Unknown AlignedWith parameter: %s", $4); | |||
Type_SuppLists[nb_SuppList] = SUPPLIST_NONE; | Type_SuppLists[nb_SuppList] = SUPPLIST_NONE; | |||
} | } | |||
ListsOfRegion[nb_SuppList] = NULL; | ListsOfRegion[nb_SuppList] = NULL; | |||
nb_SuppList++; | nb_SuppList++; | |||
} | } | |||
else | else | |||
vyyerror(0, "More than 2 supplementary lists not allowed"); | vyyerror(0, "More than 2 supplementary lists not allowed"); | |||
} | } | |||
skipping to change at line 1655 | skipping to change at line 1661 | |||
} | } | |||
| tTrace | | tTrace | |||
{ Last_DofIndexInWholeQuantity = Current_DofIndexInWholeQuantity; } | { Last_DofIndexInWholeQuantity = Current_DofIndexInWholeQuantity; } | |||
'[' WholeQuantityExpression ',' GroupRHS ']' | '[' WholeQuantityExpression ',' GroupRHS ']' | |||
{ WholeQuantity_S.Type = WQ_TRACE; | { WholeQuantity_S.Type = WQ_TRACE; | |||
WholeQuantity_S.Case.Trace.WholeQuantity = $4; | WholeQuantity_S.Case.Trace.WholeQuantity = $4; | |||
WholeQuantity_S.Case.Trace.InIndex = | WholeQuantity_S.Case.Trace.InIndex = | |||
Num_Group(&Group_S, strSave("WQ_Trace_In"), $6); | Num_Group(&Group_S, strSave("WQ_Trace_In"), $6); | |||
if(Group_S.Type != ELEMENTLIST || Group_S.SuppListType != SUPPLIST_CONNECT | ||||
EDTO) | ||||
vyyerror(0, "Group for Trace should be of Type 'ElementsOf[x, ConnectedTo | ||||
y]'"); | ||||
WholeQuantity_S.Case.Trace.DofIndexInWholeQuantity = -1; | WholeQuantity_S.Case.Trace.DofIndexInWholeQuantity = -1; | |||
if(Current_DofIndexInWholeQuantity != Last_DofIndexInWholeQuantity){ | if(Current_DofIndexInWholeQuantity != Last_DofIndexInWholeQuantity){ | |||
for(int i = 0; i < List_Nbr($4); i++){ | for(int i = 0; i < List_Nbr($4); i++){ | |||
WholeQuantity_P = (struct WholeQuantity*)List_Pointer($4, i); | WholeQuantity_P = (struct WholeQuantity*)List_Pointer($4, i); | |||
if(WholeQuantity_P->Type == WQ_OPERATORANDQUANTITY) | if(WholeQuantity_P->Type == WQ_OPERATORANDQUANTITY) | |||
if(WholeQuantity_P->Case.OperatorAndQuantity.TypeQuantity == QUANTITY _DOF){ | if(WholeQuantity_P->Case.OperatorAndQuantity.TypeQuantity == QUANTITY _DOF){ | |||
WholeQuantity_S.Case.Trace.DofIndexInWholeQuantity = i; | WholeQuantity_S.Case.Trace.DofIndexInWholeQuantity = i; | |||
Current_DofIndexInWholeQuantity = -4; | Current_DofIndexInWholeQuantity = -4; | |||
TypeOperatorDofInTrace = WholeQuantity_P->Case.OperatorAndQuantity. TypeOperator; | TypeOperatorDofInTrace = WholeQuantity_P->Case.OperatorAndQuantity. TypeOperator; | |||
DefineQuantityIndexDofInTrace = WholeQuantity_P->Case.OperatorAndQu antity.Index; | DefineQuantityIndexDofInTrace = WholeQuantity_P->Case.OperatorAndQu antity.Index; | |||
skipping to change at line 2837 | skipping to change at line 2840 | |||
| SubSpace SubSpaceTerm | | SubSpace SubSpaceTerm | |||
; | ; | |||
SubSpaceTerm : | SubSpaceTerm : | |||
Append tEND | Append tEND | |||
{ | { | |||
level_Append_2 = $1; index_Append_2 = -1; | level_Append_2 = $1; index_Append_2 = -1; | |||
} | } | |||
| tName tSTRING tEND | | tName String__Index tEND | |||
{ | { | |||
index_Append_2 = | index_Append_2 = | |||
Check_NameOfStructExist("SubSpace", FunctionSpace_S.SubSpace, | Check_NameOfStructExist("SubSpace", FunctionSpace_S.SubSpace, | |||
$2, fcmp_SubSpace_Name, level_Append_2); | $2, fcmp_SubSpace_Name, level_Append_2); | |||
if (index_Append_2<0) | if (index_Append_2<0) | |||
SubSpace_S.Name = $2; | SubSpace_S.Name = $2; | |||
else{ | else{ | |||
List_Read(FunctionSpace_S.SubSpace, index_Append_2, &SubSpace_S); | List_Read(FunctionSpace_S.SubSpace, index_Append_2, &SubSpace_S); | |||
Free($2); | Free($2); | |||
} | } | |||
skipping to change at line 2859 | skipping to change at line 2862 | |||
| tNameOfBasisFunction ListOfBasisFunction tEND | | tNameOfBasisFunction ListOfBasisFunction tEND | |||
{ SubSpace_S.BasisFunction = $2; } | { SubSpace_S.BasisFunction = $2; } | |||
| tNameOfCoef ListOfBasisFunctionCoef tEND | | tNameOfCoef ListOfBasisFunctionCoef tEND | |||
{ SubSpace_S.BasisFunction = $2; } | { SubSpace_S.BasisFunction = $2; } | |||
; | ; | |||
ListOfBasisFunction : | ListOfBasisFunction : | |||
tSTRING | String__Index | |||
{ | { | |||
$$ = SubSpace_S.BasisFunction? | $$ = SubSpace_S.BasisFunction? | |||
SubSpace_S.BasisFunction : List_Create(1, 5, sizeof(int)); | SubSpace_S.BasisFunction : List_Create(1, 5, sizeof(int)); | |||
int i; | int i; | |||
if((i = List_ISearchSeq(Current_BasisFunction_L, | if((i = List_ISearchSeq(Current_BasisFunction_L, | |||
$1, fcmp_BasisFunction_Name)) < 0) | $1, fcmp_BasisFunction_Name)) < 0) | |||
vyyerror(0, "Unknown BasisFunction: %s", $1); | vyyerror(0, "Unknown BasisFunction: %s", $1); | |||
else { | else { | |||
List_Add($$, &i); | List_Add($$, &i); | |||
int j = i+1; | int j = i+1; | |||
skipping to change at line 2890 | skipping to change at line 2893 | |||
; | ; | |||
RecursiveListOfBasisFunction : | RecursiveListOfBasisFunction : | |||
/* none */ | /* none */ | |||
{ | { | |||
$$ = SubSpace_S.BasisFunction? | $$ = SubSpace_S.BasisFunction? | |||
SubSpace_S.BasisFunction : List_Create(5, 5, sizeof(int)); | SubSpace_S.BasisFunction : List_Create(5, 5, sizeof(int)); | |||
} | } | |||
| RecursiveListOfBasisFunction Comma tSTRING | | RecursiveListOfBasisFunction Comma String__Index | |||
{ | { | |||
int i; | int i; | |||
if((i = List_ISearchSeq(Current_BasisFunction_L, | if((i = List_ISearchSeq(Current_BasisFunction_L, | |||
$3, fcmp_BasisFunction_Name)) < 0) | $3, fcmp_BasisFunction_Name)) < 0) | |||
vyyerror(0, "Unknown BasisFunction: %s", $3); | vyyerror(0, "Unknown BasisFunction: %s", $3); | |||
else { | else { | |||
List_Add($1, &i); | List_Add($1, &i); | |||
int j = i+1; | int j = i+1; | |||
while((i = List_ISearchSeqPartial(Current_BasisFunction_L, | while((i = List_ISearchSeqPartial(Current_BasisFunction_L, | |||
$3, j, fcmp_BasisFunction_Name)) >= 0) { | $3, j, fcmp_BasisFunction_Name)) >= 0) { | |||
List_Add($1, &i); j = i+1; /* for piecewise defined basis functions */ | List_Add($1, &i); j = i+1; /* for piecewise defined basis functions */ | |||
} | } | |||
} | } | |||
$$ = $1; Free($3); | $$ = $1; Free($3); | |||
} | } | |||
; | ; | |||
ListOfBasisFunctionCoef : | ListOfBasisFunctionCoef : | |||
tSTRING | String__Index | |||
{ | { | |||
$$ = SubSpace_S.BasisFunction? | $$ = SubSpace_S.BasisFunction? | |||
SubSpace_S.BasisFunction : List_Create(1, 5, sizeof(int)); | SubSpace_S.BasisFunction : List_Create(1, 5, sizeof(int)); | |||
int i; | int i; | |||
if((i = List_ISearchSeq(Current_BasisFunction_L, | if((i = List_ISearchSeq(Current_BasisFunction_L, | |||
$1, fcmp_BasisFunction_NameOfCoef)) < 0) | $1, fcmp_BasisFunction_NameOfCoef)) < 0) | |||
vyyerror(0, "Unknown BasisFunctionCoef: %s", $1); | vyyerror(0, "Unknown BasisFunctionCoef: %s", $1); | |||
else { | else { | |||
List_Add($$, &i); | List_Add($$, &i); | |||
} | } | |||
skipping to change at line 2936 | skipping to change at line 2939 | |||
; | ; | |||
RecursiveListOfBasisFunctionCoef : | RecursiveListOfBasisFunctionCoef : | |||
/* none */ | /* none */ | |||
{ | { | |||
$$ = SubSpace_S.BasisFunction? | $$ = SubSpace_S.BasisFunction? | |||
SubSpace_S.BasisFunction : List_Create(5, 5, sizeof(int)); | SubSpace_S.BasisFunction : List_Create(5, 5, sizeof(int)); | |||
} | } | |||
| RecursiveListOfBasisFunctionCoef Comma tSTRING | | RecursiveListOfBasisFunctionCoef Comma String__Index | |||
{ | { | |||
int i; | int i; | |||
if((i = List_ISearchSeq(Current_BasisFunction_L, | if((i = List_ISearchSeq(Current_BasisFunction_L, | |||
$3, fcmp_BasisFunction_NameOfCoef)) < 0) | $3, fcmp_BasisFunction_NameOfCoef)) < 0) | |||
vyyerror(0, "Unknown BasisFunctionCoef: %s", $3); | vyyerror(0, "Unknown BasisFunctionCoef: %s", $3); | |||
else { | else { | |||
List_Add($1, &i); | List_Add($1, &i); | |||
} | } | |||
$$ = $1; Free($3); | $$ = $1; Free($3); | |||
} | } | |||
skipping to change at line 5358 | skipping to change at line 5361 | |||
} | } | |||
| tAddVector '[' String__Index ',' Expression ',' CharExprNoVar ',' | | tAddVector '[' String__Index ',' Expression ',' CharExprNoVar ',' | |||
Expression ',' CharExprNoVar ',' CharExprNoVar ']' tEND | Expression ',' CharExprNoVar ',' CharExprNoVar ']' tEND | |||
{ Operation_P = (struct Operation*) | { Operation_P = (struct Operation*) | |||
List_Pointer(Operation_L, List_Nbr(Operation_L)-1); | List_Pointer(Operation_L, List_Nbr(Operation_L)-1); | |||
Operation_P->Type = OPERATION_ADDVECTOR; | Operation_P->Type = OPERATION_ADDVECTOR; | |||
int i; | int i; | |||
if((i = List_ISearchSeq(Resolution_S.DefineSystem, $3, | if((i = List_ISearchSeq(Resolution_S.DefineSystem, $3, | |||
fcmp_DefineSystem_Name)) < 0) | fcmp_DefineSystem_Name)) < 0) | |||
vyyerror(0, "Unknown System: %s", $3); | vyyerror(0, "Unknown System: %s", $3); | |||
Free($3); | Free($3); | |||
Operation_P->DefineSystemIndex = i; | Operation_P->DefineSystemIndex = i; | |||
Operation_P->Case.AddVector.alphaIndex = $5; | Operation_P->Case.AddVector.alphaIndex = $5; | |||
Operation_P->Case.AddVector.betaIndex = $9; | Operation_P->Case.AddVector.betaIndex = $9; | |||
Operation_P->Case.AddVector.v1 = $7; | Operation_P->Case.AddVector.v1 = $7; | |||
Operation_P->Case.AddVector.v2 = $11; | Operation_P->Case.AddVector.v2 = $11; | |||
Operation_P->Case.AddVector.v3 = $13; | Operation_P->Case.AddVector.v3 = $13; | |||
} | } | |||
| tPerturbation '[' String__Index ',' String__Index ',' String__Index ',' | ||||
FExpr ',' ListOfFExpr ',' FExpr ',' FExpr ']' tEND | ||||
{ Operation_P = (struct Operation*) | ||||
List_Pointer(Operation_L, List_Nbr(Operation_L)-1); | ||||
Operation_P->Type = OPERATION_PERTURBATION; | ||||
int i; | ||||
if((i = List_ISearchSeq(Resolution_S.DefineSystem, $3, | ||||
fcmp_DefineSystem_Name)) < 0) | ||||
vyyerror(0, "Unknown System: %s", $3); | ||||
Free($3); | ||||
Operation_P->DefineSystemIndex = i; | ||||
if((i = List_ISearchSeq(Resolution_S.DefineSystem, $5, | ||||
fcmp_DefineSystem_Name)) < 0) | ||||
vyyerror(0, "Unknown System: %s", $5); | ||||
Free($5); | ||||
Operation_P->Case.Perturbation.DefineSystemIndex2 = i; | ||||
if((i = List_ISearchSeq(Resolution_S.DefineSystem, $7, | ||||
fcmp_DefineSystem_Name)) < 0) | ||||
vyyerror(0, "Unknown System: %s", $7); | ||||
Free($7); | ||||
Operation_P->Case.Perturbation.DefineSystemIndex3 = i; | ||||
Operation_P->Case.Perturbation.Size = (int)$9; | ||||
Operation_P->Case.Perturbation.Save = | ||||
List_Create(List_Nbr($11), 1, sizeof(int)); | ||||
for(int l = 0; l < List_Nbr($11); l++) { | ||||
double d; | ||||
List_Read($11, l, &d); | ||||
int j = (int)d; | ||||
List_Add(Operation_P->Case.Perturbation.Save, &j); | ||||
} | ||||
List_Delete($11); | ||||
Operation_P->Case.Perturbation.Shift = $13; | ||||
Operation_P->Case.Perturbation.PertFreq = (int)$15; | ||||
} | ||||
| tTimeLoopTheta '[' FExpr ',' FExpr ',' Expression ',' Expression ']' | | tTimeLoopTheta '[' FExpr ',' FExpr ',' Expression ',' Expression ']' | |||
'{' Operation '}' | '{' Operation '}' | |||
{ List_Pop(Operation_L); | { List_Pop(Operation_L); | |||
Operation_P = (struct Operation*) | Operation_P = (struct Operation*) | |||
List_Pointer(Operation_L, List_Nbr(Operation_L)-1); | List_Pointer(Operation_L, List_Nbr(Operation_L)-1); | |||
Operation_P->Type = OPERATION_TIMELOOPTHETA; | Operation_P->Type = OPERATION_TIMELOOPTHETA; | |||
Operation_P->Case.TimeLoopTheta.Time0 = $3; | Operation_P->Case.TimeLoopTheta.Time0 = $3; | |||
Operation_P->Case.TimeLoopTheta.TimeMax = $5; | Operation_P->Case.TimeLoopTheta.TimeMax = $5; | |||
Operation_P->Case.TimeLoopTheta.DTimeIndex = $7; | Operation_P->Case.TimeLoopTheta.DTimeIndex = $7; | |||
Operation_P->Case.TimeLoopTheta.ThetaIndex = $9; | Operation_P->Case.TimeLoopTheta.ThetaIndex = $9; | |||
skipping to change at line 10582 | skipping to change at line 10550 | |||
Group_P->Name = strSave(tmpstr); | Group_P->Name = strSave(tmpstr); | |||
break; | break; | |||
case 2 : | case 2 : | |||
sprintf(tmpstr, "%s_%d", Name, Num_Index); | sprintf(tmpstr, "%s_%d", Name, Num_Index); | |||
Group_P->Name = strSave(tmpstr); | Group_P->Name = strSave(tmpstr); | |||
break; | break; | |||
default : | default : | |||
Group_P->Name = Name; | Group_P->Name = Name; | |||
} | } | |||
Group_S.ElementRTree = NULL; | ||||
int i; | int i; | |||
if((i = List_ISearchSeq(Problem_S.Group, Group_P->Name, fcmp_Group_Name)) < 0) { | if((i = List_ISearchSeq(Problem_S.Group, Group_P->Name, fcmp_Group_Name)) < 0) { | |||
i = Group_P->Num = List_Nbr(Problem_S.Group); | i = Group_P->Num = List_Nbr(Problem_S.Group); | |||
Group_P->ExtendedList = Group_P->ExtendedSuppList = Group_P->ExtendedSuppLis t2 = NULL; | Group_P->ExtendedList = Group_P->ExtendedSuppList = Group_P->ExtendedSuppLis t2 = NULL; | |||
List_Add(Problem_S.Group, Group_P); | List_Add(Problem_S.Group, Group_P); | |||
} | } | |||
else if(Flag_AddRemove == +1) { | else if(Flag_AddRemove == +1) { | |||
List_T *InitialList = ((struct Group *)List_Pointer(Problem_S.Group, i))->In itialList; | List_T *InitialList = ((struct Group *)List_Pointer(Problem_S.Group, i))->In itialList; | |||
for(int j = 0; j < List_Nbr(Group_P->InitialList); j++) { | for(int j = 0; j < List_Nbr(Group_P->InitialList); j++) { | |||
List_Add(InitialList, (int *)List_Pointer(Group_P->InitialList, j)); | List_Add(InitialList, (int *)List_Pointer(Group_P->InitialList, j)); | |||
End of changes. 11 change blocks. | ||||
47 lines changed or deleted | 15 lines changed or added |