-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://scm.projects.hlrs.de/authscm/sprinz/svn/ls1/MarDyn/trunk@6472 a63bd714-7e14-4b5e-94e7-302c8c8ff188
- Loading branch information
Showing
9 changed files
with
196 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// | ||
// Created by Kruegener on 8/19/2018. | ||
// Ported from Domain.cpp by Mheier. | ||
// | ||
|
||
#include "DensityProfile.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// Created by Kruegener on 8/29/2018. | ||
// | ||
|
||
#include "VelocityAbsProfile.h" | ||
|
||
void VelocityAbsProfile::output(string prefix) { | ||
global_log->info() << "[VelocityAbsProfile] output" << std::endl; | ||
_profilePrefix = prefix; | ||
_profilePrefix += "_kartesian.VAbspr"; | ||
|
||
// Need to get DensityProfile to calculate average velocities per bin independent of number density. | ||
std::map<unsigned, long double> dens = _kartProf->_densProfile->getProfile(); | ||
|
||
ofstream outfile(_profilePrefix.c_str()); | ||
outfile.precision(6); | ||
|
||
outfile << "//Segment volume: " << _kartProf->segmentVolume << "\n//Accumulated data sets: " << _kartProf->accumulatedDatasets << "\n//Local profile of magnitude of velocity. Output file generated by the \"VelocityAbsProfile\" method, plugins/profiles. \n"; | ||
outfile << "//local velocity magnitude profile: Y - Z || X-projection\n"; | ||
// TODO: more info | ||
outfile << "// \t dX \t dY \t dZ \n"; | ||
outfile << "\t" << 1/_kartProf->universalInvProfileUnit[0] << "\t" << 1/_kartProf->universalInvProfileUnit[1] << "\t" << 1/_kartProf->universalInvProfileUnit[2]<< "\n"; | ||
outfile << "0 \t"; | ||
|
||
for(unsigned z = 0; z < _kartProf->universalProfileUnit[2]; z++){ | ||
outfile << (z+0.5) / _kartProf->universalInvProfileUnit[2] <<" \t\t\t"; // Eintragen der z Koordinaten in Header | ||
} | ||
outfile << "\n"; | ||
long double vd; | ||
// Y - axis label | ||
for(unsigned y = 0; y < _kartProf->universalProfileUnit[1]; y++){ | ||
double hval = (y + 0.5) / _kartProf->universalInvProfileUnit[1]; | ||
outfile << hval << "\t"; | ||
// number density values | ||
for(unsigned z = 0; z < _kartProf->universalProfileUnit[2]; z++){ | ||
for(unsigned x = 0; x < _kartProf->universalProfileUnit[0]; x++){ | ||
long unID = (long) (x * _kartProf->universalProfileUnit[0] * _kartProf->universalProfileUnit[2] + y * _kartProf->universalProfileUnit[1] + z); | ||
// Abs output | ||
// Check for division by 0 | ||
if(dens[unID] != 0){ | ||
vd = _globalProfile[unID] / dens[unID]; | ||
} | ||
else{ | ||
vd = 0; | ||
} | ||
outfile << vd << "\t"; | ||
} | ||
} | ||
outfile << "\n"; | ||
} | ||
outfile.close(); | ||
} |
Oops, something went wrong.