Ignore:
Timestamp:
Aug 7, 2009, 9:13:21 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
ef5521
Parents:
8f9a8e
Message:

Test case of filling a simulation domain with water included.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    r8f9a8e r0fc0b5  
    863863
    864864            // insert into Filling
     865
     866            // FIXME: gives completely different results if CopyAtoms[..] used instead of Walker, why???
    865867            *out << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;
    866868            Filling->AddAtom(CopyAtoms[Walker->nr]);
     
    930932      if (!failflag)
    931933        cerr << "WARNING: Find_next_suitable_triangle failed." << endl;
     934      // write temporary envelope
     935      if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % SingleStepWidth == 0))) { // if we have a new triangle and want to output each new triangle configuration
     936        TriangleMap::iterator runner = mol->TesselStruct->TrianglesOnBoundary.end();
     937        runner--;
     938        class BoundaryTriangleSet *triangle = runner->second;
     939        if (triangle != NULL) {
     940          sprintf(NumberName, "-%04d-%s_%s_%s", TriangleFilesWritten, triangle->endpoints[0]->node->Name, triangle->endpoints[1]->node->Name, triangle->endpoints[2]->node->Name);
     941          if (DoTecplotOutput) {
     942            string NameofTempFile(filename);
     943            NameofTempFile.append(NumberName);
     944            for(size_t npos = NameofTempFile.find_first_of(' '); npos != string::npos; npos = NameofTempFile.find(' ', npos))
     945            NameofTempFile.erase(npos, 1);
     946            NameofTempFile.append(TecplotSuffix);
     947            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     948            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
     949            write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
     950            tempstream->close();
     951            tempstream->flush();
     952            delete(tempstream);
     953          }
     954
     955          if (DoRaster3DOutput) {
     956            string NameofTempFile(filename);
     957            NameofTempFile.append(NumberName);
     958            for(size_t npos = NameofTempFile.find_first_of(' '); npos != string::npos; npos = NameofTempFile.find(' ', npos))
     959            NameofTempFile.erase(npos, 1);
     960            NameofTempFile.append(Raster3DSuffix);
     961            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     962            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
     963            write_raster3d_file(out, tempstream, mol->TesselStruct, mol);
     964    //        // include the current position of the virtual sphere in the temporary raster3d file
     965    //        // make the circumsphere's center absolute again
     966    //        helper.CopyVector(BaseRay->endpoints[0]->node->node);
     967    //        helper.AddVector(BaseRay->endpoints[1]->node->node);
     968    //        helper.Scale(0.5);
     969    //        (*it)->OptCenter.AddVector(&helper);
     970    //        Vector *center = mol->DetermineCenterOfAll(out);
     971    //        (*it)->OptCenter.SubtractVector(center);
     972    //        delete(center);
     973    //        // and add to file plus translucency object
     974    //        *tempstream << "# current virtual sphere\n";
     975    //        *tempstream << "8\n  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0\n";
     976    //        *tempstream << "2\n  " << (*it)->OptCenter.x[0] << " "
     977    //          << (*it)->OptCenter.x[1] << " " << (*it)->OptCenter.x[2]
     978    //          << "\t" << RADIUS << "\t1 0 0\n";
     979    //        *tempstream << "9\n  terminating special property\n";
     980            tempstream->close();
     981            tempstream->flush();
     982            delete(tempstream);
     983          }
     984        }
     985        if (DoTecplotOutput || DoRaster3DOutput)
     986          TriangleFilesWritten++;
     987      }
    932988    } else {
    933989      //cout << Verbose(1) << "Line " << *baseline->second << " has " << baseline->second->TrianglesCount << " triangles adjacent" << endl;
     
    941997      baseline = mol->TesselStruct->LinesOnBoundary.begin();   // restart if we reach end due to newly inserted lines
    942998      flag = false;
    943     }
    944 
    945     // write temporary envelope
    946     if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % 1 == 0))) { // if we have a new triangle and want to output each new triangle configuration
    947       class BoundaryTriangleSet *triangle = (mol->TesselStruct->TrianglesOnBoundary.end()--)->second;
    948       sprintf(NumberName, "-%04d-%s_%s_%s", TriangleFilesWritten, triangle->endpoints[0]->node->Name, triangle->endpoints[1]->node->Name, triangle->endpoints[2]->node->Name);
    949       if (DoTecplotOutput) {
    950         string NameofTempFile(filename);
    951         NameofTempFile.append(NumberName);
    952         for(size_t npos = NameofTempFile.find_first_of(' '); npos != string::npos; npos = NameofTempFile.find(' ', npos))
    953         NameofTempFile.erase(npos, 1);
    954         NameofTempFile.append(TecplotSuffix);
    955         *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    956         tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    957         write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
    958         tempstream->close();
    959         tempstream->flush();
    960         delete(tempstream);
    961       }
    962 
    963       if (DoRaster3DOutput) {
    964         string NameofTempFile(filename);
    965         NameofTempFile.append(NumberName);
    966         for(size_t npos = NameofTempFile.find_first_of(' '); npos != string::npos; npos = NameofTempFile.find(' ', npos))
    967         NameofTempFile.erase(npos, 1);
    968         NameofTempFile.append(Raster3DSuffix);
    969         *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    970         tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    971         write_raster3d_file(out, tempstream, mol->TesselStruct, mol);
    972 //        // include the current position of the virtual sphere in the temporary raster3d file
    973 //        // make the circumsphere's center absolute again
    974 //        helper.CopyVector(BaseRay->endpoints[0]->node->node);
    975 //        helper.AddVector(BaseRay->endpoints[1]->node->node);
    976 //        helper.Scale(0.5);
    977 //        (*it)->OptCenter.AddVector(&helper);
    978 //        Vector *center = mol->DetermineCenterOfAll(out);
    979 //        (*it)->OptCenter.SubtractVector(center);
    980 //        delete(center);
    981 //        // and add to file plus translucency object
    982 //        *tempstream << "# current virtual sphere\n";
    983 //        *tempstream << "8\n  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0\n";
    984 //        *tempstream << "2\n  " << (*it)->OptCenter.x[0] << " "
    985 //          << (*it)->OptCenter.x[1] << " " << (*it)->OptCenter.x[2]
    986 //          << "\t" << RADIUS << "\t1 0 0\n";
    987 //        *tempstream << "9\n  terminating special property\n";
    988         tempstream->close();
    989         tempstream->flush();
    990         delete(tempstream);
    991       }
    992       if (DoTecplotOutput || DoRaster3DOutput)
    993         TriangleFilesWritten++;
    994999    }
    9951000  }
Note: See TracChangeset for help on using the changeset viewer.