MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / GenerateCode

Method GenerateCode

fem/coefficient_geo.cpp:433–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431 }
432
433 virtual void GenerateCode(Code &code, FlatArray<int> inputs, int index) const override {
434
435 if (consistent)
436 throw Exception("consistent tangent does not support Compile(True) yet");
437
438 string miptype;
439 if(code.is_simd)
440 miptype = "SIMD<DimMappedIntegrationPoint<"+ToLiteral(D)+">>*";
441 else
442 miptype = "DimMappedIntegrationPoint<"+ToLiteral(D)+">*";
443 auto tv_expr = CodeExpr("static_cast<const "+miptype+">(&ip)->GetTV()");
444 auto tv = Var("tmp", index);
445 code.body += tv.Assign(tv_expr);
446
447 code.Declare (index, this->Dimensions(), this->IsComplex());
448 for( int i : Range(D))
449 code.body += Var(index,i).Assign(tv(i), false);
450 }
451
452 using CoefficientFunctionNoDerivative::Evaluate;
453 virtual void Evaluate (const SIMD_BaseMappedIntegrationRule & ir, BareSliceMatrix<SIMD<double>> values) const override

Callers

nothing calls this directly

Calls 8

ToLiteralFunction · 0.85
CodeExprClass · 0.85
VarFunction · 0.85
DeclareMethod · 0.80
DimensionsMethod · 0.80
RangeFunction · 0.50
AssignMethod · 0.45
IsComplexMethod · 0.45

Tested by

no test coverage detected