Esempio n. 1
0
Analysis::Analysis(Parallel *_parallel, Vlasov *_vlasov, Fields *_fields, Grid *_grid, Setup *_setup, FFTSolver *_fft, FileIO *fileIO, Geometry<HELIOS_GEOMETRY> *_geo) : 
  parallel(_parallel),setup(_setup), vlasov(_vlasov), grid(_grid), fields(_fields), geo(_geo),  fft(_fft),
     A4(FortranArray<4>()), A4_z(FortranArray<4>())

  {
       scaleXYZ  = dx * dy * dz;
       scaleXYZV = dx * dy * dz * dv * dm;

       // set initial energy
       initialEkin.resize(Range(TOTAL, NsGuD)); initialEkin = 0.e0;
       for(int s=NsLlD; s<= NsLuD; s++)  initialEkin(s) = getKineticEnergy(s);
       initialEkin(TOTAL) = sum(initialEkin(RsLD));
       
       // Spectrum
//       if(setup->dirSpectrumAvrg & SPEC_XZ)  spectrumXZ.resize(fft->RkxL, fft->RkzL); spectrumXZ = 0.0;
//       if(setup->dirSpectrumAvrg & SPEC_YZ)  spectrumYZ.resize(fft->RkyL, fft->RkzL); spectrumYZ = 0.0;
//       if(setup->dirSpectrumAvrg & SPEC_XY)  spectrumXY.resize(fft->RkxL, fft->RkyL); spectrumXY = 0.0;

     pSpec.resize(Range((int) DIR_X, (int) DIR_Y), RFields, Range(0, max(Nky,Nx)));
     pPhase.resize(Range((int) DIR_X, (int) DIR_Y), RFields, Range(0, max(Nky,Nx)));
     pFreq.resize(Range((int) DIR_X, (int) DIR_Y), RFields, Range(0, max(Nky,Nx)));
    
     A_xyz.resize(RxLD, RkyLD, RzLD); A_xyz = 0.;

     A4.resize(RxLD, RkyLD, RzLD, RsLD);
     A4_z.resize(RxLD, RkyLD, RzLD, RsLD);

       
     initDataOutput(setup, fileIO);
  }
Esempio n. 2
0
/*
 * print out a data block
 */
void
PrintDataBlock(FILE *f, ParserState *P, int isBinary)
{
    AST *ast;

    initDataOutput(isBinary);
    if (gl_errors != 0)
        return;
    for (ast = P->datblock; ast; ast = ast->right) {
        switch (ast->kind) {
        case AST_BYTELIST:
            outputAlignedDataList(f, 1, ast->left);
            break;
        case AST_WORDLIST:
            outputAlignedDataList(f, 2, ast->left);
            break;
        case AST_LONGLIST:
            outputAlignedDataList(f, 4, ast->left);
            break;
        case AST_INSTRHOLDER:
            assembleInstruction(f, ast->left);
            break;
        case AST_IDENTIFIER:
            /* just skip labels */
            break;
        case AST_FILE:
            assembleFile(f, ast->left);
            break;
        case AST_ORG:
        case AST_RES:
        case AST_FIT:
            break;
        default:
            ERROR(ast, "unknown element in data block");
            break;
        }
    }

    if (datacount != 0 && !isBinary) {
        fprintf(f, "\n");
    }
}