-
Notifications
You must be signed in to change notification settings - Fork 14
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/svn/ls1/MarDyn/trunk@6469 a63bd714-7e14-4b5e-94e7-302c8c8ff188
- Loading branch information
Showing
7 changed files
with
119 additions
and
13 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
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,53 @@ | ||
// | ||
// Created by Kruegener on 8/27/2018. | ||
// | ||
|
||
#include "Velocity3dProfile.h" | ||
|
||
void Velocity3dProfile::output(string prefix) { | ||
global_log->info() << "[Velocity3dProfile] output" << std::endl; | ||
_profilePrefix = prefix; | ||
_profilePrefix += "_kartesian.V3Dpr"; | ||
|
||
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 X-Y-Z components of velocity. Output file generated by the \"Velocity3dProfile\" method, plugins/profiles. \n"; | ||
outfile << "//local velocity 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); | ||
// X - Y - Z output | ||
for(unsigned d = 0; d < 3; d++){ | ||
if(dens[unID] != 0){ | ||
vd = _global3dProfile[d][unID] / dens[unID]; | ||
} | ||
else{ | ||
vd = 0; | ||
} | ||
outfile << vd << "\t"; | ||
} | ||
} | ||
} | ||
outfile << "\n"; | ||
} | ||
outfile.close(); | ||
|
||
} |
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,42 @@ | ||
// | ||
// Created by Kruegener on 8/27/2018. | ||
// | ||
|
||
#ifndef MARDYN_TRUNK_VELOCITYPROFILE_H | ||
#define MARDYN_TRUNK_VELOCITYPROFILE_H | ||
|
||
#include "ProfileBase.h" | ||
#include "../KartesianProfile.h" | ||
|
||
|
||
class Velocity3dProfile : public ProfileBase { | ||
public: | ||
~Velocity3dProfile() final = default; | ||
void record(ParticleIterator *mol, unsigned long uID) final { | ||
for(unsigned short d = 0; d < 3; d++){ | ||
_local3dProfile[d][uID] += (*mol)->v(d); | ||
} | ||
} | ||
void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID) final { | ||
for(unsigned short d = 0; d < 3; d++){ | ||
domainDecomp->collCommAppendLongDouble(_local3dProfile[d][uID]); | ||
} | ||
} | ||
void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID) final { | ||
for(unsigned short d = 0; d < 3; d++){ | ||
_global3dProfile[d][uID] = domainDecomp->collCommGetLongDouble(); | ||
} | ||
} | ||
void output(string prefix) final; | ||
void reset(unsigned long uID) final { | ||
for(unsigned d = 0; d < 3; d++){ | ||
_local3dProfile[d][uID] = 0.0; | ||
_global3dProfile[d][uID] = 0.0; | ||
} | ||
} | ||
// set correct number of communications needed for this profile | ||
int comms() final {return 3;} | ||
}; | ||
|
||
|
||
#endif //MARDYN_TRUNK_VELOCITYPROFILE_H |