refactor
This commit is contained in:
parent
c9787cd3ba
commit
d45d94c275
@ -92,7 +92,7 @@ void SubPhase::SetParams(double rhoA, double rhoB, double tauA, double tauB, dou
|
|||||||
beta = B;
|
beta = B;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubPhase::BulkAverage(){
|
void SubPhase::Basic(){
|
||||||
int i,j,k,n,imin,jmin,kmin,kmax;
|
int i,j,k,n,imin,jmin,kmin,kmax;
|
||||||
|
|
||||||
// If external boundary conditions are set, do not average over the inlet
|
// If external boundary conditions are set, do not average over the inlet
|
||||||
@ -254,7 +254,7 @@ inline void InterfaceTransportMeasures( double beta, double rA, double rB, doubl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubPhase::FullAnalysis(){
|
void SubPhase::Full(){
|
||||||
int i,j,k,n,imin,jmin,kmin,kmax;
|
int i,j,k,n,imin,jmin,kmin,kmax;
|
||||||
|
|
||||||
// If external boundary conditions are set, do not average over the inlet
|
// If external boundary conditions are set, do not average over the inlet
|
||||||
|
@ -98,8 +98,8 @@ public:
|
|||||||
~SubPhase();
|
~SubPhase();
|
||||||
|
|
||||||
void SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double beta);
|
void SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double beta);
|
||||||
void BulkAverage();
|
void Basic();
|
||||||
void FullAnalysis();
|
void Full();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE *TIMELOG;
|
FILE *TIMELOG;
|
||||||
|
@ -331,12 +331,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SubphaseWorkItem: public ThreadPool::WorkItemRet<void>
|
class BasicWorkItem: public ThreadPool::WorkItemRet<void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SubphaseWorkItem( AnalysisType type_, int timestep_, SubPhase& Averages_ ):
|
BasicWorkItem( AnalysisType type_, int timestep_, SubPhase& Averages_ ):
|
||||||
type(type_), timestep(timestep_), Averages(Averages_){ }
|
type(type_), timestep(timestep_), Averages(Averages_){ }
|
||||||
~SubphaseWorkItem() { }
|
~BasicWorkItem() { }
|
||||||
virtual void run() {
|
virtual void run() {
|
||||||
|
|
||||||
if ( matches(type,AnalysisType::CopyPhaseIndicator) ) {
|
if ( matches(type,AnalysisType::CopyPhaseIndicator) ) {
|
||||||
@ -344,12 +344,12 @@ public:
|
|||||||
}
|
}
|
||||||
if ( matches(type,AnalysisType::ComputeAverages) ) {
|
if ( matches(type,AnalysisType::ComputeAverages) ) {
|
||||||
PROFILE_START("Compute subphase",1);
|
PROFILE_START("Compute subphase",1);
|
||||||
Averages.BulkAverage();
|
Averages.Basic();
|
||||||
PROFILE_STOP("Compute subphase",1);
|
PROFILE_STOP("Compute subphase",1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
SubphaseWorkItem();
|
BasicWorkItem();
|
||||||
AnalysisType type;
|
AnalysisType type;
|
||||||
int timestep;
|
int timestep;
|
||||||
SubPhase& Averages;
|
SubPhase& Averages;
|
||||||
@ -797,7 +797,7 @@ void runAnalysis::run( int timestep, TwoPhase& Averages, const double *Phi,
|
|||||||
/******************************************************************
|
/******************************************************************
|
||||||
* Run the analysis *
|
* Run the analysis *
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
void runAnalysis::subphase( int timestep, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den)
|
void runAnalysis::basic( int timestep, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den)
|
||||||
{
|
{
|
||||||
int N = d_N[0]*d_N[1]*d_N[2];
|
int N = d_N[0]*d_N[1]*d_N[2];
|
||||||
|
|
||||||
@ -845,7 +845,7 @@ void runAnalysis::subphase( int timestep, SubPhase &Averages, const double *Phi,
|
|||||||
//if (timestep%d_restart_interval==0){
|
//if (timestep%d_restart_interval==0){
|
||||||
// if ( matches(type,AnalysisType::ComputeAverages) ) {
|
// if ( matches(type,AnalysisType::ComputeAverages) ) {
|
||||||
if ( timestep%d_analysis_interval == 0 ) {
|
if ( timestep%d_analysis_interval == 0 ) {
|
||||||
auto work = new SubphaseWorkItem(type,timestep,Averages);
|
auto work = new BasicWorkItem(type,timestep,Averages);
|
||||||
work->add_dependency(d_wait_analysis); // Make sure we are done using analysis before modifying
|
work->add_dependency(d_wait_analysis); // Make sure we are done using analysis before modifying
|
||||||
d_wait_analysis = d_tpool.add_work(work);
|
d_wait_analysis = d_tpool.add_work(work);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
void run( int timestep, TwoPhase &Averages, const double *Phi,
|
void run( int timestep, TwoPhase &Averages, const double *Phi,
|
||||||
double *Pressure, double *Velocity, double *fq, double *Den );
|
double *Pressure, double *Velocity, double *fq, double *Den );
|
||||||
|
|
||||||
void subphase( int timestep, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den );
|
void basic( int timestep, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den );
|
||||||
|
|
||||||
//! Finish all active analysis
|
//! Finish all active analysis
|
||||||
void finish();
|
void finish();
|
||||||
|
@ -579,7 +579,8 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
if (fabs((Ca - Ca_previous)/Ca) < tolerance ){
|
if (fabs((Ca - Ca_previous)/Ca) < tolerance ){
|
||||||
MORPH_ADAPT = true;
|
MORPH_ADAPT = true;
|
||||||
CURRENT_MORPH_TIMESTEPS=0;
|
CURRENT_MORPH_TIMESTEPS=0;
|
||||||
delta_volume_target = (volA + volB)*morph_delta; // set target volume chnage
|
delta_volume_target = (volA + volB)*morph_delta; // set target volume change
|
||||||
|
analysis.
|
||||||
if (rank==0){
|
if (rank==0){
|
||||||
printf("** WRITE STEADY POINT *** ");
|
printf("** WRITE STEADY POINT *** ");
|
||||||
printf("Ca = %f, (previous = %f) \n",Ca,Ca_previous);
|
printf("Ca = %f, (previous = %f) \n",Ca,Ca_previous);
|
||||||
|
Loading…
Reference in New Issue
Block a user