genecomm_lowlevel.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:tango 作者: LLNL 项目源码 文件源码
def pseudo_call_gene_low_level(simulationTime=None, rho=None, temperatureHat=None, densityHat=None, safetyFactor=None, 
                        ionMass=1, ionCharge=1, Lref=None, Bref=None, rhoStar=None, Tref=None, nref=None, checkpointSuffix=0):
    """Function  to emulate a call to GENE with the same input arguments and return values.

    Used for testing other code when the overhead of an actual startup of GENE is not needed.  Of course, this can only
    be used to test correctness of syntax, not correctness of values.
    """

    # check inputs have been provided
    for var in (simulationTime, rho, temperatureHat, densityHat, safetyFactor, Lref, Bref, rhoStar, Tref, nref):
        if var is None:
            #logging.error("Input variables must be provided in call_gene_low_level.")
            raise ValueError

    MPIrank = 1
    dVdxHat = np.ones_like(rho)
    sqrt_gxx = np.ones_like(rho)
    avgParticleFluxHat = np.ones_like(rho)
    avgHeatFluxHat = np.ones_like(rho)
    temperatureOutput = np.ones_like(rho)
    densityOutput = np.ones_like(rho)
    return (MPIrank, dVdxHat, sqrt_gxx, avgParticleFluxHat, avgHeatFluxHat, temperatureOutput, densityOutput)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号