Changeset 1907a7 for src/config.cpp


Ignore:
Timestamp:
Apr 2, 2009, 4:12:54 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
ca3ccc
Parents:
d8b94a
Message:

Basic implementation of Multiple molecules.

builder.cpp:

molecules.hpp:

moleculelist.cpp:

  • replaced listofmolecules array by STL list everywhere (only smaller changes necessary)
  • new merging function: SimpleMerge, SimpleAdd, SimpleMultiMerge, SimpleMultiAdd, (EmbedMerge, ScatterMerge ... both not finished). Add does not while merge does delete the src molecules.
  • new function: Enumerate(). Output of all molecules with number of atoms and chemical formula
  • new function: NumberOfActiveMolecules(). Counts the number of molecules in the list with ActiveFlag set.
  • new function: insert(). Inserts a molecule into the list with a unique index

molecules.cpp:

  • new function: SetNameFromFilename. Takes basename of a filename and sets name accordingly.
  • new function: UnlinkAtom. Only removes atom from list, does not delete it from memory.

atom.cpp:

  • Output() also accepts specific comment instead of "# molecule nr ..."
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    rd8b94a r1907a7  
    11/** \file config.cpp
    2  * 
     2 *
    33 * Function implementations for the class config.
    4  * 
     4 *
    55 */
    66
     
    2424        configname[0]='\0';
    2525        basis = "3-21G";
    26        
     26
    2727        FastParsing = false;
    2828        ProcPEGamma=8;
     
    4242        UseAddGramSch=1;
    4343        Seed=1;
    44        
     44
    4545        MaxOuterStep=0;
    4646        Deltat=1;
     
    5151        MaxPsiStep=0;
    5252        EpsWannier=1e-7;
    53        
     53
    5454        MaxMinStep=100;
    5555        RelEpsTotalEnergy=1e-7;
     
    6262        InitMaxMinStopStep=1;
    6363        InitMaxMinGapStopStep=0;
    64        
     64
    6565        //BoxLength[NDIM*NDIM];
    66        
     66
    6767        ECut=128.;
    6868        MaxLevel=5;
     
    7777        PsiMaxNoDown=0;
    7878        AddPsis=0;
    79        
     79
    8080        RCut=20.;
    8181        StructOpt=0;
     
    101101 * for each entry of the config file structure.
    102102 */
    103 void config::Edit(molecule *mol)
     103void config::Edit()
    104104{
    105105        char choice;
    106        
     106
    107107        do {
    108108                cout << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;
     
    137137                cout << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;
    138138                cout << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;
    139                 cout << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
     139//              cout << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
    140140                cout << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;
    141141                cout << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;
     
    157157                cout << Verbose(0) << "INPUT: ";
    158158                cin >> choice;
    159                
     159
    160160                switch (choice) {
    161161                                case 'A': // mainname
     
    282282                                        cin >> config::InitMaxMinStopStep;
    283283                                        break;
    284                                
    285                                 case 'j': // BoxLength
    286                                         cout << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
    287                                         for (int i=0;i<6;i++) {
    288                                                 cout << Verbose(0) << "Cell size" << i << ": ";
    289                                                 cin >> mol->cell_size[i];
    290                                         }
    291                                         break;
    292                                
     284
     285//                              case 'j': // BoxLength
     286//                                      cout << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
     287//                                      for (int i=0;i<6;i++) {
     288//                                              cout << Verbose(0) << "Cell size" << i << ": ";
     289//                                              cin >> mol->cell_size[i];
     290//                                      }
     291//                                      break;
     292
    293293                                case 'k': // ECut
    294294                                        cout << Verbose(0) << "Old: " << config::ECut << "\t new: ";
     
    364364 * \param *periode pointer to a periodentafel class with all elements
    365365 * \param *mol pointer to molecule containing all atoms of the molecule
    366  * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax 
     366 * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax
    367367 */
    368368int config::TestSyntax(char *filename, periodentafel *periode, molecule *mol)
     
    370370        int test;
    371371        ifstream file(filename);
    372        
     372
    373373        // search file for keyword: ProcPEGamma (new syntax)
    374374        if (ParseForParameter(1,&file,"ProcPEGamma", 0, 1, 1, int_type, &test, 1, optional)) {
     
    441441 * \param *file input file stream being the opened config file
    442442 * \param *periode pointer to a periodentafel class with all elements
    443  * \param *mol pointer to molecule containing all atoms of the molecule 
     443 * \param *mol pointer to molecule containing all atoms of the molecule
    444444 */
    445445void config::Load(char *filename, periodentafel *periode, molecule *mol)
     
    452452        RetrieveConfigPathAndName(filename);
    453453        // ParseParameters
    454        
     454
    455455        /* Oeffne Hauptparameterdatei */
    456456        int di;
     
    464464        int verbose = 0;
    465465        double value[3];
    466        
     466
    467467        /* Namen einlesen */
    468468
     
    495495                config::DoOutCurrent = 0;
    496496        if (config::DoOutCurrent < 0) config::DoOutCurrent = 0;
    497         if (config::DoOutCurrent > 1) config::DoOutCurrent = 1; 
     497        if (config::DoOutCurrent > 1) config::DoOutCurrent = 1;
    498498        ParseForParameter(verbose,file,"AddGramSch", 0, 1, 1, int_type, &(config::UseAddGramSch), 1, critical);
    499499        if (config::UseAddGramSch < 0) config::UseAddGramSch = 0;
     
    517517                if (config::SawtoothStart > 1.) config::SawtoothStart = 1.;
    518518        }
    519        
     519
    520520        ParseForParameter(verbose,file,"MaxOuterStep", 0, 1, 1, int_type, &(config::MaxOuterStep), 1, critical);
    521521        if (!ParseForParameter(verbose,file,"Deltat", 0, 1, 1, double_type, &(config::Deltat), 1, optional))
     
    527527        if (!ParseForParameter(verbose,file,"EpsWannier", 0, 1, 1, double_type, &(config::EpsWannier), 1, optional))
    528528                config::EpsWannier = 1e-8;
    529        
     529
    530530        // stop conditions
    531531        //if (config::MaxOuterStep <= 0) config::MaxOuterStep = 1;
    532532        ParseForParameter(verbose,file,"MaxPsiStep", 0, 1, 1, int_type, &(config::MaxPsiStep), 1, critical);
    533533        if (config::MaxPsiStep <= 0) config::MaxPsiStep = 3;
    534        
     534
    535535        ParseForParameter(verbose,file,"MaxMinStep", 0, 1, 1, int_type, &(config::MaxMinStep), 1, critical);
    536536        ParseForParameter(verbose,file,"RelEpsTotalE", 0, 1, 1, double_type, &(config::RelEpsTotalEnergy), 1, critical);
     
    541541        if (config::MaxMinStopStep < 1) config::MaxMinStopStep = 1;
    542542        if (config::MaxMinGapStopStep < 1) config::MaxMinGapStopStep = 1;
    543        
     543
    544544        ParseForParameter(verbose,file,"MaxInitMinStep", 0, 1, 1, int_type, &(config::MaxInitMinStep), 1, critical);
    545545        ParseForParameter(verbose,file,"InitRelEpsTotalE", 0, 1, 1, double_type, &(config::InitRelEpsTotalEnergy), 1, critical);
     
    550550        if (config::InitMaxMinStopStep < 1) config::InitMaxMinStopStep = 1;
    551551        if (config::InitMaxMinGapStopStep < 1) config::InitMaxMinGapStopStep = 1;
    552        
     552
    553553        // Unit cell and magnetic field
    554554        ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
     
    566566                config::DoFullCurrent = 0;
    567567        if (config::DoFullCurrent < 0) config::DoFullCurrent = 0;
    568         if (config::DoFullCurrent > 2) config::DoFullCurrent = 2; 
     568        if (config::DoFullCurrent > 2) config::DoFullCurrent = 2;
    569569        if (config::DoOutNICS < 0) config::DoOutNICS = 0;
    570         if (config::DoOutNICS > 2) config::DoOutNICS = 2; 
     570        if (config::DoOutNICS > 2) config::DoOutNICS = 2;
    571571        if (config::DoPerturbation == 0) {
    572572                config::DoFullCurrent = 0;
     
    585585        } else {
    586586                fprintf(stderr, "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT");
    587                 exit(1); 
     587                exit(1);
    588588        }
    589589        switch (config::RiemannTensor) {
     
    602602                        if (config::RiemannLevel < 2) {
    603603                                config::RiemannLevel = 2;
    604                         } 
     604                        }
    605605                        if (config::RiemannLevel > config::MaxLevel-1) {
    606606                                config::RiemannLevel = config::MaxLevel-1;
     
    609609                        if (config::LevRFactor < 2) {
    610610                                config::LevRFactor = 2;
    611                         } 
     611                        }
    612612                        config::Lev0Factor = 2;
    613613                        config::RTActualUse = 2;
     
    619619        } else {
    620620                fprintf(stderr, "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown");
    621                 exit(1); 
     621                exit(1);
    622622        }
    623623        switch (config::PsiType) {
     
    633633                break;
    634634        }
    635        
     635
    636636        // IonsInitRead
    637        
     637
    638638        ParseForParameter(verbose,file,"RCut", 0, 1, 1, double_type, &(config::RCut), 1, critical);
    639639        ParseForParameter(verbose,file,"IsAngstroem", 0, 1, 1, int_type, &(config::IsAngstroem), 1, critical);
     
    653653                        ParseForParameter(verbose,file, name, 0, 2, 1, int_type, &Z, 1, critical);
    654654                        elementhash[i] = periode->FindElement(Z);
    655                         cout << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl; 
     655                        cout << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;
    656656                }
    657657                int repetition = 0; // which repeated keyword shall be read
    658        
     658
    659659                map<int, atom *> AtomList[config::MaxTypes];
    660660                if (!FastParsing) {
     
    675675                                                } else
    676676                                                        neues = AtomList[i][j];
    677                                                 status = (status && 
     677                                                status = (status &&
    678678                                                                                ParseForParameter(verbose,file, keyword, 0, 1, 1, double_type, &neues->x.x[0], 1, (repetition == 0) ? critical : optional) &&
    679679                                                                                ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], 1, (repetition == 0) ? critical : optional) &&
     
    681681                                                                                ParseForParameter(verbose,file, keyword, 0, 4, 1, int_type, &neues->FixedIon, 1, (repetition == 0) ? critical : optional));
    682682                                                if (!status) break;
    683                
     683
    684684                                                // check size of vectors
    685685                                                if (mol->Trajectories[neues].R.size() <= (unsigned int)(repetition)) {
     
    689689                                                        mol->Trajectories[neues].F.resize(repetition+10);
    690690                                                }
    691                                        
     691
    692692                                                // put into trajectories list
    693693                                                for (int d=0;d<NDIM;d++)
    694694                                                        mol->Trajectories[neues].R.at(repetition).x[d] = neues->x.x[d];
    695                                                
     695
    696696                                                // parse velocities if present
    697697                                                if(!ParseForParameter(verbose,file, keyword, 0, 5, 1, double_type, &neues->v.x[0], 1,optional))
     
    703703                                                for (int d=0;d<NDIM;d++)
    704704                                                        mol->Trajectories[neues].U.at(repetition).x[d] = neues->v.x[d];
    705                        
     705
    706706                                                // parse forces if present
    707707                                                if(!ParseForParameter(verbose,file, keyword, 0, 8, 1, double_type, &value[0], 1,optional))
     
    713713                                                for (int d=0;d<NDIM;d++)
    714714                                                        mol->Trajectories[neues].F.at(repetition).x[d] = value[d];
    715        
    716         //                                              cout << "Parsed position of step " << (repetition) << ": ("; 
     715
     716        //                                              cout << "Parsed position of step " << (repetition) << ": (";
    717717        //                                              for (int d=0;d<NDIM;d++)
    718718        //                                                      cout << mol->Trajectories[neues].R.at(repetition).x[d] << " ";                                  // next step
     
    770770 * \param *file input file stream being the opened config file with old pcp syntax
    771771 * \param *periode pointer to a periodentafel class with all elements
    772  * \param *mol pointer to molecule containing all atoms of the molecule 
     772 * \param *mol pointer to molecule containing all atoms of the molecule
    773773 */
    774774void config::LoadOld(char *filename, periodentafel *periode, molecule *mol)
     
    781781        RetrieveConfigPathAndName(filename);
    782782        // ParseParameters
    783        
     783
    784784        /* Oeffne Hauptparameterdatei */
    785785        int l, i, di;
     
    791791        int Z, No, AtomNo, found;
    792792        int verbose = 0;
    793        
     793
    794794        /* Namen einlesen */
    795795
     
    823823        ParseForParameter(verbose,file,"ScaleTempStep", 0, 1, 1, int_type, &(config::ScaleTempStep), 1, optional);
    824824        config::EpsWannier = 1e-8;
    825        
     825
    826826        // stop conditions
    827827        //if (config::MaxOuterStep <= 0) config::MaxOuterStep = 1;
    828828        ParseForParameter(verbose,file,"MaxPsiStep", 0, 1, 1, int_type, &(config::MaxPsiStep), 1, critical);
    829829        if (config::MaxPsiStep <= 0) config::MaxPsiStep = 3;
    830        
     830
    831831        ParseForParameter(verbose,file,"MaxMinStep", 0, 1, 1, int_type, &(config::MaxMinStep), 1, critical);
    832832        ParseForParameter(verbose,file,"MaxMinStep", 0, 2, 1, double_type, &(config::RelEpsTotalEnergy), 1, critical);
     
    836836        if (config::MaxMinStopStep < 1) config::MaxMinStopStep = 1;
    837837        config::MaxMinGapStopStep = 1;
    838        
     838
    839839        ParseForParameter(verbose,file,"MaxInitMinStep", 0, 1, 1, int_type, &(config::MaxInitMinStep), 1, critical);
    840840        ParseForParameter(verbose,file,"MaxInitMinStep", 0, 2, 1, double_type, &(config::InitRelEpsTotalEnergy), 1, critical);
     
    867867        } else {
    868868                fprintf(stderr, "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT");
    869                 exit(1); 
     869                exit(1);
    870870        }
    871871        switch (config::RiemannTensor) {
     
    884884                        if (config::RiemannLevel < 2) {
    885885                                config::RiemannLevel = 2;
    886                         } 
     886                        }
    887887                        if (config::RiemannLevel > config::MaxLevel-1) {
    888888                                config::RiemannLevel = config::MaxLevel-1;
     
    891891                        if (config::LevRFactor < 2) {
    892892                                config::LevRFactor = 2;
    893                         } 
     893                        }
    894894                        config::Lev0Factor = 2;
    895895                        config::RTActualUse = 2;
     
    901901        } else {
    902902                fprintf(stderr, "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown");
    903                 exit(1); 
     903                exit(1);
    904904        }
    905905        switch (config::PsiType) {
     
    915915                break;
    916916        }
    917        
     917
    918918        // IonsInitRead
    919        
     919
    920920        ParseForParameter(verbose,file,"RCut", 0, 1, 1, double_type, &(config::RCut), 1, critical);
    921921        ParseForParameter(verbose,file,"IsAngstroem", 0, 1, 1, int_type, &(config::IsAngstroem), 1, critical);
     
    924924
    925925        // Routine from builder.cpp
    926        
    927        
    928         for (i=MAX_ELEMENTS;i--;) 
     926
     927
     928        for (i=MAX_ELEMENTS;i--;)
    929929                elementhash[i] = NULL;
    930930        cout << Verbose(0) << "Parsing Ions ..." << endl;
     
    937937                }
    938938                if (found > 0) {
    939                         if (zeile.find("Ions_Data") == 0) 
     939                        if (zeile.find("Ions_Data") == 0)
    940940                                getline(*file,zeile,'\n'); // read next line and parse this one
    941941                        istringstream input(zeile);
     
    966966                        No++;
    967967                }
    968         }       
     968        }
    969969        file->close();
    970970        delete(file);
     
    974974 * \param *filename name of file
    975975 * \param *periode pointer to a periodentafel class with all elements
    976  * \param *mol pointer to molecule containing all atoms of the molecule 
     976 * \param *mol pointer to molecule containing all atoms of the molecule
    977977 */
    978978bool config::Save(const char *filename, periodentafel *periode, molecule *mol) const
     
    10811081 * Note that this format cannot be parsed again.
    10821082 * \param *filename name of file (without ".in" suffix!)
    1083  * \param *mol pointer to molecule containing all atoms of the molecule 
     1083 * \param *mol pointer to molecule containing all atoms of the molecule
    10841084 */
    10851085bool config::SaveMPQC(const char *filename, molecule *mol) const
     
    10921092        ofstream *output = NULL;
    10931093        stringstream *fname = NULL;
    1094        
     1094
    10951095        // first without hessian
    10961096        fname = new stringstream;
     
    11911191        delete(output);
    11921192        delete(fname);
    1193        
     1193
    11941194        return true;
    11951195};
     
    12031203 * \param file file to be parsed
    12041204 * \param name Name of value in file (at least 3 chars!)
    1205  * \param sequential 1 - do not reset file pointer to begin of file, 0 - set to beginning 
     1205 * \param sequential 1 - do not reset file pointer to begin of file, 0 - set to beginning
    12061206 *                              (if file is sequentially parsed this can be way faster! However, beware of multiple values per line, as whole line is read -
    12071207 *                               best approach: 0 0 0 1 (not resetted only on last value of line) - and of yth, which is now
     
    12231223        dummy1 = free_dummy = (char *) Malloc(256 * sizeof(char), "config::ParseForParameter: *free_dummy");
    12241224
    1225         //fprintf(stderr,"Parsing for %s\n",name);     
     1225        //fprintf(stderr,"Parsing for %s\n",name);
    12261226        if (repetition == 0)
    12271227                //Error(SomeError, "ParseForParameter(): argument repetition must not be 0!");
     
    12441244                                        file->clear();
    12451245                                        file->seekg(file_position, ios::beg);   // rewind to start position
    1246                                         Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");                                   
     1246                                        Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");
    12471247                                        return 0;
    12481248                                }
     
    12501250                        line++;
    12511251                } while (dummy != NULL && dummy1 != NULL && ((dummy1[0] == '#') || (dummy1[0] == '\0'))); // skip commentary and empty lines
    1252                
     1252
    12531253                // C++ getline removes newline at end, thus re-add
    12541254                if ((dummy1 != NULL) && (strchr(dummy1,'\n') == NULL)) {
     
    12761276                                //fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name);
    12771277                                //Free((void **)&free_dummy);
    1278                                 //Error(FileOpenParams, NULL);                 
     1278                                //Error(FileOpenParams, NULL);
    12791279                        } else {
    12801280                                //fprintf(stderr,"found tab at %i\n",(char *)dummy-(char *)dummy1);
     
    12851285                if ((name == NULL) || (((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0)) && ((unsigned int)(dummy-dummy1) == strlen(name)))) {
    12861286                        found++; // found the parameter!
    1287                         //fprintf(stderr,"found %s at line %i between %i and %i\n", name, line, dummy1, dummy);         
    1288                        
     1287                        //fprintf(stderr,"found %s at line %i between %i and %i\n", name, line, dummy1, dummy);
     1288
    12891289                        if (found == repetition) {
    12901290                                for (i=0;i<xth;i++) { // i = rows
     
    13251325                                                dummy1[j+1] = '\0';
    13261326                                        }
    1327        
     1327
    13281328                                        int start = (type >= grid) ? 0 : yth-1 ;
    13291329                                        for (j=start;j<yth;j++) { // j = columns
     
    13481348                                                                                //return 0;
    13491349                                                                                exit(255);
    1350                                                                                 //Error(FileOpenParams, NULL);                 
     1350                                                                                //Error(FileOpenParams, NULL);
    13511351                                                                        } else {
    13521352                                                                                //if (!sequential)
     
    13631363                                                                // found comment, skipping rest of line
    13641364                                                                //if (verbose) fprintf(stderr,"Error: '#' at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
    1365                                                                 if (!sequential) { // here we need it! 
     1365                                                                if (!sequential) { // here we need it!
    13661366                                                                        file->seekg(file_position, ios::beg);   // rewind to start position
    13671367                                                                }
     
    13781378                                                                                //value += sizeof(int);
    13791379                                                                        break;
    1380                                                                 case(row_double): 
     1380                                                                case(row_double):
    13811381                                                                case(grid):
    13821382                                                                case(lower_trigrid):
     
    14191419                        }
    14201420                }
    1421         } 
     1421        }
    14221422        if ((type >= row_int) && (verbose)) fprintf(stderr,"\n");
    14231423        Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");
     
    14271427        }
    14281428        //fprintf(stderr, "End of Parsing\n\n");
    1429        
     1429
    14301430        return (found); // true if found, false if not
    14311431}
Note: See TracChangeset for help on using the changeset viewer.