aslFDStefanMaxwell.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ASLFDSTEFANMAXWELL_H
#define ASLFDSTEFANMAXWELL_H
#include "aslSingleKernelNM.h"
namespace acl
{
class VectorOfElementsData;
class VectorOfElements;
}
namespace asl
{
class VectorTemplate;
template <typename V> class DataWithGhostNodes;
typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
class AbstractDataWithGhostNodes;
typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
class FDStefanMaxwell: public SingleKernelNM
{
public:
typedef SPDataWithGhostNodesACLData Data;
typedef SPAbstractDataWithGhostNodes Field;
typedef acl::VectorOfElements Param;
private:
std::vector<Data> cData;
std::vector<Data> cInternalData;
Field efPhi;
std::vector<Param> efCharge;
Field velocity;
const VectorTemplate* vectorTemplate;
std::vector<std::vector<Param>> diffusionCoefficients;
std::vector<Param> dustDiffusionCoefficients;
virtual void init0();
virtual void postProcessing();
public:
FDStefanMaxwell();
FDStefanMaxwell(Data c1,
Data c2,
const acl::VectorOfElements & dC,
const VectorTemplate* vT);
void setDiffusionCoefficient(acl::VectorOfElements d,
unsigned int i = 0,unsigned int j = 1);
inline const Param & getDiffusionCoefficient(unsigned int i=0, unsigned int j=1) const;
inline const Param & getDustDiffusionCoefficient(unsigned int i=0) const;
void setDustDiffusionCoefficient(unsigned int i, const Param & dd);
void setVectorTemplate(VectorTemplate* vT);
inline const VectorTemplate* getVectorTemplate() const;
void setElectricField(Field phi);
Field getElectricField() const;
inline const Param & getCharge(unsigned int i) const;
void setCharge(unsigned int i, const Param & q);
void setVelocity(Field v);
inline Field getVelocity();
inline std::vector<Data> & getData();
void addComponent(Data c, const Param & dC);
void addComponent(Data c, const Param & dC, const Param & q);
};
typedef std::shared_ptr<FDStefanMaxwell> SPFDStefanMaxwell;
SPFDStefanMaxwell generateFDStefanMaxwell(SPDataWithGhostNodesACLData c1,
SPDataWithGhostNodesACLData c2,
double diffustionCoeff,
SPAbstractDataWithGhostNodes v,
const VectorTemplate* vt);
SPFDStefanMaxwell generateFDStefanMaxwell(SPDataWithGhostNodesACLData c1,
SPDataWithGhostNodesACLData c2,
double diffustionCoeff,
const VectorTemplate* vt);
class FDStefanMaxwellElectricField: public SingleKernelNM
{
public:
typedef SPDataWithGhostNodesACLData Data;
typedef SPAbstractDataWithGhostNodes Field;
private:
SPFDStefanMaxwell smSolver;
Data phi;
Data phiInternalData;
Field phiS;
const double stepFactor=1e-3;
virtual void init0();
virtual void postProcessing();
public:
FDStefanMaxwellElectricField(SPFDStefanMaxwell sm, Data phi);
void setPhiS(Field pS);
};
typedef std::shared_ptr<FDStefanMaxwellElectricField> SPFDStefanMaxwellElectricField;
// ------------------------- Implementation ------------------------
inline FDStefanMaxwell::Field FDStefanMaxwell::getVelocity()
{
return velocity;
}
inline std::vector<FDStefanMaxwell::Data> & FDStefanMaxwell::getData()
{
return cData;
}
inline const VectorTemplate* FDStefanMaxwell::getVectorTemplate() const
{
return vectorTemplate;
}
inline const acl::VectorOfElements &
FDStefanMaxwell::getDiffusionCoefficient(unsigned int i, unsigned int j) const
{
return diffusionCoefficients[i][j];
}
inline const acl::VectorOfElements &
FDStefanMaxwell::getDustDiffusionCoefficient(unsigned int i) const
{
return dustDiffusionCoefficients[i];
}
inline const acl::VectorOfElements &
FDStefanMaxwell::getCharge(unsigned int i) const
{
return efCharge[i];
}
} // asl
#endif // ASLFDADVECTIONDIFFUSION_H
acl::VectorOfElements
The class represents several Element.
Definition: aclVectorOfElementsDef.h:92
asl::FDStefanMaxwellElectricField
Definition: aslFDStefanMaxwell.h:162
asl::FDStefanMaxwellElectricField::Field
SPAbstractDataWithGhostNodes Field
Definition: aslFDStefanMaxwell.h:165
asl::FDStefanMaxwellElectricField::Data
SPDataWithGhostNodesACLData Data
Definition: aslFDStefanMaxwell.h:164
asl::FDStefanMaxwellElectricField::setPhiS
void setPhiS(Field pS)
asl::FDStefanMaxwellElectricField::FDStefanMaxwellElectricField
FDStefanMaxwellElectricField(SPFDStefanMaxwell sm, Data phi)
asl::FDStefanMaxwell
Numerical method which computes multicomponent transport processes.
Definition: aslFDStefanMaxwell.h:69
asl::FDStefanMaxwell::Field
SPAbstractDataWithGhostNodes Field
Definition: aslFDStefanMaxwell.h:72
asl::FDStefanMaxwell::getDustDiffusionCoefficient
const Param & getDustDiffusionCoefficient(unsigned int i=0) const
Definition: aslFDStefanMaxwell.h:207
asl::FDStefanMaxwell::Param
acl::VectorOfElements Param
Definition: aslFDStefanMaxwell.h:73
asl::FDStefanMaxwell::addComponent
void addComponent(Data c, const Param &dC)
asl::FDStefanMaxwell::setCharge
void setCharge(unsigned int i, const Param &q)
asl::FDStefanMaxwell::setDiffusionCoefficient
void setDiffusionCoefficient(acl::VectorOfElements d, unsigned int i=0, unsigned int j=1)
asl::FDStefanMaxwell::getCharge
const Param & getCharge(unsigned int i) const
Definition: aslFDStefanMaxwell.h:213
asl::FDStefanMaxwell::FDStefanMaxwell
FDStefanMaxwell()
asl::FDStefanMaxwell::addComponent
void addComponent(Data c, const Param &dC, const Param &q)
asl::FDStefanMaxwell::getDiffusionCoefficient
const Param & getDiffusionCoefficient(unsigned int i=0, unsigned int j=1) const
Definition: aslFDStefanMaxwell.h:201
asl::FDStefanMaxwell::setElectricField
void setElectricField(Field phi)
asl::FDStefanMaxwell::getData
std::vector< Data > & getData()
Definition: aslFDStefanMaxwell.h:190
asl::FDStefanMaxwell::FDStefanMaxwell
FDStefanMaxwell(Data c1, Data c2, const acl::VectorOfElements &dC, const VectorTemplate *vT)
asl::FDStefanMaxwell::getVelocity
Field getVelocity()
Definition: aslFDStefanMaxwell.h:185
asl::FDStefanMaxwell::Data
SPDataWithGhostNodesACLData Data
Definition: aslFDStefanMaxwell.h:71
asl::FDStefanMaxwell::getVectorTemplate
const VectorTemplate * getVectorTemplate() const
Definition: aslFDStefanMaxwell.h:195
asl::FDStefanMaxwell::setDustDiffusionCoefficient
void setDustDiffusionCoefficient(unsigned int i, const Param &dd)
asl::FDStefanMaxwell::setVectorTemplate
void setVectorTemplate(VectorTemplate *vT)
asl::FDStefanMaxwell::getElectricField
Field getElectricField() const
asl::FDStefanMaxwell::setVelocity
void setVelocity(Field v)
asl::SingleKernelNM
Definition: aslSingleKernelNM.h:47
asl::VectorTemplate
Defines set of vectros with several properties.
Definition: aslTemplates.h:88
asl::generateFDStefanMaxwell
SPFDStefanMaxwell generateFDStefanMaxwell(SPDataWithGhostNodesACLData c1, SPDataWithGhostNodesACLData c2, double diffustionCoeff, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt)
acl
Advanced Computational Language.
Definition: acl.h:41
asl
Advanced Simulation Library.
Definition: aslDataInc.h:31
asl::DataWithGhostNodesACLData
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
asl::SPAbstractDataWithGhostNodes
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition: aslGenerators.h:50
asl::SPFDStefanMaxwellElectricField
std::shared_ptr< FDStefanMaxwellElectricField > SPFDStefanMaxwellElectricField
Definition: aslFDStefanMaxwell.h:181
asl::SPDataWithGhostNodesACLData
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
asl::SPFDStefanMaxwell
std::shared_ptr< FDStefanMaxwell > SPFDStefanMaxwell
Definition: aslFDStefanMaxwell.h:115
aslSingleKernelNM.h