Select Git revision
filters.cpp
-
Christophe Geuzaine authoredChristophe Geuzaine authored
Cal_Quantity.cpp 43.75 KiB
// GetDP - Copyright (C) 1997-2017 P. Dular and C. Geuzaine, University of Liege
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <getdp@onelab.info>.
#include <string.h>
#include <math.h>
#include <map>
#include "ProData.h"
#include "GeoData.h"
#include "DofData.h"
#include "F.h"
#include "Cal_Quantity.h"
#include "Cal_Value.h"
#include "Get_Geometry.h"
#include "Pos_FemInterpolation.h"
#include "Pos_Search.h"
#include "Get_FunctionValue.h"
#include "MallocUtils.h"
#include "Message.h"
#include "ProParser.h"
#include "Pos_Format.h"
extern struct Problem Problem_S ;
extern struct CurrentData Current ;
extern int TreatmentStatus ;
/* ------------------------------------------------------------------------ */
/* G e t _ V a l u e O f E x p r e s s i o n */
/* ------------------------------------------------------------------------ */
void Get_ValueOfExpression(struct Expression * Expression_P,
struct QuantityStorage * QuantityStorage_P0,
double u, double v, double w,
struct Value * Value,
int NbrArguments,
char *CallingExpressionName)
{
static char *Flag_WarningUndefined = NULL ;
switch (Expression_P->Type) {
case CONSTANT :
if (Current.NbrHar == 1) {
Value->Val[0] = Expression_P->Case.Constant ;
}
else {
for (int k = 0 ; k < Current.NbrHar ; k += 2) {
Value->Val[MAX_DIM* k ] = Expression_P->Case.Constant ;
Value->Val[MAX_DIM*(k+1)] = 0. ;
}
}
Value->Type = SCALAR ;
break ;
case WHOLEQUANTITY :
Cal_WholeQuantity(Current.Element, QuantityStorage_P0,
Expression_P->Case.WholeQuantity,
u,v,w, -1, 0, Value, NbrArguments,
CallingExpressionName ?
CallingExpressionName : Expression_P->Name) ;
break ;
case PIECEWISEFUNCTION :
struct Expression * NextExpression_P;
struct ExpressionPerRegion * ExpressionPerRegion_P ;
if (Current.Region == Expression_P->Case.PieceWiseFunction.NumLastRegion) {
NextExpression_P = Expression_P->Case.PieceWiseFunction.ExpressionForLastRegion;
}