变量未初始化问题
-
在lagrangian/intermediate/submodels/Kinematic/ParticleForces路径下添加了一个电场力模型,编译通过,case计算时报错,似乎跟q和E变量未初始化有关,代码小白,求指点。
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class CloudType> Foam::ElectricfieldForce<CloudType>::ElectricfieldForce ( CloudType& owner, const fvMesh& mesh, const dictionary& dict, const word& forceType, const volScalarField& qField ) : ParticleForce<CloudType>(owner, mesh, dict, forceType, true), EName_(this->coeffs().template lookupOrDefault<word>("E", "E")), EInterpPtr_(NULL), qField_(qField) { Info<< "-----p in ELe\n" << endl; qInterpPtr_.reset ( interpolation<scalar>::New ( owner.solution().interpolationSchemes(), qField ).ptr() ); Info<< "-----p2 in ELe\n" << endl; } template<class CloudType> Foam::ElectricfieldForce<CloudType>::ElectricfieldForce ( const ElectricfieldForce& etf ) : ParticleForce<CloudType>(etf), EName_(etf.EName_), EInterpPtr_(NULL), qField_(etf.qField_) {}