Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge branch 'real_and_imag_no_deriv' into 'master'
derive real and imag cf from CoefficientFunctionNoDerivative
See merge request jschoeberl/ngsolve!303
- Loading branch information
Showing
with
13 additions
and
4 deletions.
-
+13
−4
fem/coefficient.cpp
|
@@ -6046,13 +6046,18 @@ shared_ptr<CoefficientFunction> MakeCoordinateCoefficientFunction (int comp) |
|
|
} |
|
|
}; |
|
|
|
|
|
class RealCF : public CoefficientFunction |
|
|
class RealCF : public CoefficientFunctionNoDerivative |
|
|
{ |
|
|
shared_ptr<CoefficientFunction> cf; |
|
|
public: |
|
|
RealCF(shared_ptr<CoefficientFunction> _cf) : cf(_cf), CoefficientFunction(1,false) |
|
|
RealCF(shared_ptr<CoefficientFunction> _cf) : cf(_cf), CoefficientFunctionNoDerivative(1,false) |
|
|
{ ; } |
|
|
|
|
|
virtual string GetDescription() const override |
|
|
{ |
|
|
return "RealCF"; |
|
|
} |
|
|
|
|
|
virtual double Evaluate(const BaseMappedIntegrationPoint& ip) const override |
|
|
{ |
|
|
if(cf->IsComplex()) |
|
@@ -6065,12 +6070,16 @@ shared_ptr<CoefficientFunction> MakeCoordinateCoefficientFunction (int comp) |
|
|
} |
|
|
}; |
|
|
|
|
|
class ImagCF : public CoefficientFunction |
|
|
class ImagCF : public CoefficientFunctionNoDerivative |
|
|
{ |
|
|
shared_ptr<CoefficientFunction> cf; |
|
|
public: |
|
|
ImagCF(shared_ptr<CoefficientFunction> _cf) : cf(_cf), CoefficientFunction(1,false) |
|
|
ImagCF(shared_ptr<CoefficientFunction> _cf) : cf(_cf), CoefficientFunctionNoDerivative(1,false) |
|
|
{ ; } |
|
|
virtual string GetDescription() const override |
|
|
{ |
|
|
return "ImagCF"; |
|
|
} |
|
|
|
|
|
virtual double Evaluate(const BaseMappedIntegrationPoint& ip) const override |
|
|
{ |
|
|