Commit fd907ab5 by Christophe Geuzaine

Merge branch 'topopt' into 'master'

Topopt

See merge request !32
parents 98a51346 9f75c392
Pipeline #1168 passed with stage
in 46 seconds
......@@ -1156,12 +1156,12 @@ struct Operation {
} Copy;
struct {
char *algorithm;
List_T *currentPointLowerBounds, *currentPointUpperBounds;
} OptimizerInitialize;
struct {
char *currentPoint; // input and ouput
List_T *currentPointLowerBounds, *currentPointUpperBounds;
char *objective, *objectiveSensitivity; // input
List_T *constraints, *constraintsSensitivity; // input
} OptimizerInitialize;
struct {
char *residual;
} OptimizerUpdate;
} Case;
......@@ -1316,6 +1316,7 @@ struct IterativeLoopSystem {
#define OPERATION_DEBUG 106
#define OPERATION_OPTIMIZER_INITIALIZE 107
#define OPERATION_OPTIMIZER_UPDATE 108
#define OPERATION_OPTIMIZER_FINALIZE 109
/* ChangeOfState.Type */
#define CHANGEOFSTATE_NOCHANGE 0
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -308,7 +308,7 @@ struct doubleXstring{
%token tFourierTransform tFourierTransformJ
%token tCopySolution tCopyRHS tCopyResidual tCopyIncrement tCopyDofs
%token tGetNormSolution tGetNormResidual tGetNormRHS tGetNormIncrement
%token tOptimizerInitialize tOptimizerUpdate
%token tOptimizerInitialize tOptimizerUpdate tOptimizerFinalize
%token tLanczos tEigenSolve tEigenSolveJac tPerturbation
%token tUpdate tUpdateConstraint tBreak tGetResidual tCreateSolution
%token tEvaluate tSelectCorrection tAddCorrection tMultiplySolution
......@@ -5833,32 +5833,39 @@ OperationTerm :
Operation_P->Case.Copy.from = $3 ;
}
| tOptimizerInitialize '[' CharExpr ',' ListOfFExpr ',' ListOfFExpr ']' tEND
| tOptimizerInitialize '[' CharExpr ',' CharExpr ','
ListOfFExpr ',' ListOfFExpr ','
CharExpr ',' BracedRecursiveListOfCharExpr ','
CharExpr ',' BracedRecursiveListOfCharExpr ']' tEND
{
Operation_P = (struct Operation*)
List_Pointer(Operation_L, List_Nbr(Operation_L)-1) ;
Operation_P->Type = OPERATION_OPTIMIZER_INITIALIZE;
Operation_P->Case.OptimizerInitialize.algorithm = $3;
Operation_P->Case.OptimizerInitialize.currentPointLowerBounds = $5;
Operation_P->Case.OptimizerInitialize.currentPointUpperBounds = $7;
Operation_P->Case.OptimizerInitialize.currentPoint = $5;
Operation_P->Case.OptimizerInitialize.currentPointLowerBounds = $7;
Operation_P->Case.OptimizerInitialize.currentPointUpperBounds = $9;
Operation_P->Case.OptimizerInitialize.objective = $11;
Operation_P->Case.OptimizerInitialize.constraints = $13;
Operation_P->Case.OptimizerInitialize.objectiveSensitivity = $15;
Operation_P->Case.OptimizerInitialize.constraintsSensitivity = $17;
}
| tOptimizerUpdate '[' CharExpr ','
CharExpr ',' BracedRecursiveListOfCharExpr ','
CharExpr ',' BracedRecursiveListOfCharExpr ','
'$' String__Index ']' tEND
| tOptimizerUpdate '[' '$' String__Index ']' tEND
{
Operation_P = (struct Operation*)
List_Pointer(Operation_L, List_Nbr(Operation_L)-1) ;
Operation_P->Type = OPERATION_OPTIMIZER_UPDATE;
Operation_P->Case.OptimizerUpdate.currentPoint = $3;
Operation_P->Case.OptimizerUpdate.objective = $5;
Operation_P->Case.OptimizerUpdate.constraints = $7;
Operation_P->Case.OptimizerUpdate.objectiveSensitivity = $9;
Operation_P->Case.OptimizerUpdate.constraintsSensitivity = $11;
Operation_P->Case.OptimizerUpdate.residual = $14;
Operation_P->Case.OptimizerUpdate.residual = $4;
}
| tOptimizerFinalize '[' ']' tEND
{
Operation_P = (struct Operation*)
List_Pointer(Operation_L, List_Nbr(Operation_L)-1) ;
Operation_P->Type = OPERATION_OPTIMIZER_FINALIZE;
}
| Loop
{
Operation_P = (struct Operation*)
......
......@@ -225,8 +225,11 @@ void F_ValueFromTable (F_ARG)
return;
}
Message::Debug("Unknown entity index %d in ValueFromTable",
Current.NumEntity);
//if(GetDPNumbersMap.size()){
// Message::Warning("No element or node table found with name %s, or "
// "no entity index %d in the table", Fct->String,
// Current.NumEntity);
//}
for(int i = 0; i < Fct->NbrArguments; i++){
if(i != 0){
......@@ -244,6 +247,7 @@ void F_ValueFromTable (F_ARG)
Message::Warning("Missing table data or default value in ValueFromTable");
V->Val[0] = 0. ;
V->Type = SCALAR ;
}
void F_VirtualWork (F_ARG)
......
......@@ -3298,6 +3298,10 @@ void Treatment_Operation(struct Resolution * Resolution_P,
Operation_OptimizerUpdate(Operation_P);
break ;
case OPERATION_OPTIMIZER_FINALIZE :
Operation_OptimizerFinalize(Operation_P);
break ;
/* --> O t h e r */
/* ------------------------------------------ */
......
......@@ -105,6 +105,8 @@ void Operation_OptimizerInitialize(struct Operation *Operation_P);
void Operation_OptimizerUpdate(struct Operation *Operation_P);
void Operation_OptimizerFinalize(struct Operation *Operation_P);
void Cal_SolutionError(gVector *dx, gVector *x, int diff, double *MeanError);
void Free_UnusedSolutions(struct DofData * DofData_P);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment