Updating lbpm_dfh_simulator
This commit is contained in:
@@ -745,12 +745,20 @@ inline Point VertexInterp(const Point &p1, const Point &p2, double valp1, double
|
||||
inline void SolidMarchingCubes(DoubleArray &A, const double &v, DoubleArray &B, const double &isovalue,
|
||||
int i,int j,int k, int m, int n, int o, DTMutableList<Point>
|
||||
&cellvertices, int &lengthvertices, IntArray &Triangles, int &nTris,
|
||||
DoubleArray &values){
|
||||
DoubleArray &values)
|
||||
{
|
||||
|
||||
NULL_USE( isovalue );
|
||||
NULL_USE( m );
|
||||
NULL_USE( n );
|
||||
NULL_USE( o );
|
||||
|
||||
// THIS SUBROUTINE COMPUTES THE VERTICES FOR THE SOLID PHASE IN
|
||||
// A PARTICULAR GRID CELL, THEN ARRANGES THEM INTO TRIANGLES
|
||||
// ALSO ORGANIZES THE LIST OF VALUES TO CORRESPOND WITH VERTEX LIST
|
||||
|
||||
NULL_USE( v );
|
||||
|
||||
//int N = 0;
|
||||
Point P,Q;
|
||||
Point PlaceHolder;
|
||||
@@ -1079,7 +1087,12 @@ inline void SolidMarchingCubes(DoubleArray &A, const double &v, DoubleArray &B,
|
||||
inline void SOL_SURF(DoubleArray &A, const double &v, DoubleArray &B, const double &isovalue,
|
||||
int i,int j,int k, int m, int n, int o, DTMutableList<Point>
|
||||
&cellvertices, int &lengthvertices, IntArray &Tlist, int &nTris,
|
||||
DoubleArray &values){
|
||||
DoubleArray &values)
|
||||
{
|
||||
NULL_USE( isovalue );
|
||||
NULL_USE( m );
|
||||
NULL_USE( n );
|
||||
NULL_USE( o );
|
||||
|
||||
// THIS SUBROUTINE COMPUTES THE VERTICES FOR THE SOLID PHASE IN
|
||||
// A PARTICULAR GRID CELL, THEN ARRANGES THEM INTO TRIANGLES
|
||||
@@ -2540,6 +2553,11 @@ inline void EDGE(DoubleArray &A, double &v, DoubleArray &solid, int &i, int &j,
|
||||
DTMutableList<Point> &nw_pts, int &n_nw_pts, IntArray &nw_tris, int &n_nw_tris,
|
||||
DTMutableList<Point> &local_nws_pts, int &n_local_nws_pts)
|
||||
{
|
||||
|
||||
NULL_USE( m );
|
||||
NULL_USE( n );
|
||||
NULL_USE( o );
|
||||
|
||||
// FIND THE POINTS ON THE nw SURFACE THAT ARE ON THE EDGE (COMMON LINE WITH SOLID PHASE)
|
||||
// function A is the fluid data padded (so that it has values inside the solid phase)
|
||||
|
||||
@@ -3319,6 +3337,8 @@ inline void pmmc_MeshCurvature(DoubleArray &f, DoubleArray &MeanCurvature, Doubl
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
inline int pmmc_CubeListFromMesh(IntArray &cubeList, int ncubes, int Nx, int Ny, int Nz)
|
||||
{
|
||||
NULL_USE( ncubes );
|
||||
|
||||
int i,j,k,nc;
|
||||
nc=0;
|
||||
//...........................................................................
|
||||
@@ -3974,6 +3994,8 @@ inline double pmmc_CommonCurveSpeed(DoubleArray &CubeValues, DoubleArray &dPdt,
|
||||
DoubleArray &Sx, DoubleArray &Sy, DoubleArray &Sz,
|
||||
DTMutableList<Point> &Points, int i, int j, int k, int npts)
|
||||
{
|
||||
NULL_USE( CubeValues );
|
||||
|
||||
int p;
|
||||
double s,lwns,norm;
|
||||
double zeta;
|
||||
@@ -4125,7 +4147,12 @@ inline void pmmc_CurveCurvature(DoubleArray &f, DoubleArray &s,
|
||||
DoubleArray &f_x, DoubleArray &f_y, DoubleArray &f_z,
|
||||
DoubleArray &s_x, DoubleArray &s_y, DoubleArray &s_z,
|
||||
DoubleArray &KN, DoubleArray &KG,
|
||||
double &KNavg, double &KGavg, DTMutableList<Point> &Points, int npts, int ic, int jc, int kc){
|
||||
double &KNavg, double &KGavg, DTMutableList<Point> &Points, int npts, int ic, int jc, int kc)
|
||||
{
|
||||
NULL_USE( f );
|
||||
NULL_USE( s );
|
||||
NULL_USE( KN );
|
||||
NULL_USE( KG );
|
||||
|
||||
int p,i,j,k;
|
||||
double length;
|
||||
@@ -4324,6 +4351,10 @@ inline double pmmc_InterfaceSpeed(DoubleArray &dPdt, DoubleArray &P_x, DoubleArr
|
||||
DoubleArray &SurfaceVector, DoubleArray &AvgSpeed, DoubleArray &AvgVel,
|
||||
int i, int j, int k, int npts, int ntris)
|
||||
{
|
||||
NULL_USE( CubeValues );
|
||||
NULL_USE( SurfaceVector );
|
||||
NULL_USE( npts );
|
||||
|
||||
Point A,B,C,P;
|
||||
double x,y,z;
|
||||
double s,s1,s2,s3,area;
|
||||
@@ -4378,7 +4409,15 @@ inline double pmmc_InterfaceSpeed(DoubleArray &dPdt, DoubleArray &P_x, DoubleArr
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
inline double geomavg_EulerCharacteristic(DTMutableList<Point> &Points, IntArray &Triangles,
|
||||
int &npts, int &ntris, int &i, int &j, int &k){
|
||||
int &npts, int &ntris, int &i, int &j, int &k)
|
||||
{
|
||||
NULL_USE( Points );
|
||||
NULL_USE( Triangles );
|
||||
NULL_USE( npts );
|
||||
NULL_USE( ntris );
|
||||
NULL_USE( i );
|
||||
NULL_USE( j );
|
||||
NULL_USE( k );
|
||||
|
||||
/* REFERENCE
|
||||
* Huang, Liu, Lee, Yang, Tsang
|
||||
@@ -4506,7 +4545,10 @@ inline double mink_phase_epc6(IntArray &PhaseID, DoubleArray &CubeValues, int Ph
|
||||
}
|
||||
|
||||
inline double mink_EulerCharacteristic(DTMutableList<Point> &Points, IntArray &Triangles,
|
||||
DoubleArray &CubeValues, int &npts, int &ntris, int &i, int &j, int &k){
|
||||
DoubleArray &CubeValues, int &npts, int &ntris, int &i, int &j, int &k)
|
||||
{
|
||||
|
||||
NULL_USE( CubeValues );
|
||||
|
||||
// Compute the Euler characteristic for triangles in a cube
|
||||
// Exclude edges and vertices shared with between multiple cubes
|
||||
|
||||
@@ -237,14 +237,14 @@ private:
|
||||
* MPI comm wrapper for use with analysis *
|
||||
******************************************************************/
|
||||
runAnalysis::commWrapper::commWrapper( int tag_, MPI_Comm comm_, runAnalysis* analysis_ ):
|
||||
tag(tag_),
|
||||
comm(comm_),
|
||||
tag(tag_),
|
||||
analysis(analysis_)
|
||||
{
|
||||
}
|
||||
runAnalysis::commWrapper::commWrapper( commWrapper &&rhs ):
|
||||
tag(rhs.tag),
|
||||
comm(rhs.comm),
|
||||
tag(rhs.tag),
|
||||
analysis(rhs.analysis)
|
||||
{
|
||||
rhs.tag = -1;
|
||||
@@ -283,8 +283,7 @@ runAnalysis::commWrapper runAnalysis::getComm( )
|
||||
******************************************************************/
|
||||
runAnalysis::runAnalysis( std::shared_ptr<Database> db,
|
||||
const RankInfoStruct& rank_info, const ScaLBL_Communicator &ScaLBL_Comm, const Domain& Dm,
|
||||
int Np, bool pBC, double beta, double err,
|
||||
IntArray Map ):
|
||||
int Np, bool pBC, double beta, IntArray Map ):
|
||||
d_Np( Np ),
|
||||
d_beta( beta ),
|
||||
d_ScaLBL_Comm( ScaLBL_Comm ),
|
||||
@@ -292,6 +291,7 @@ runAnalysis::runAnalysis( std::shared_ptr<Database> db,
|
||||
d_Map( Map ),
|
||||
d_fillData(Dm.Comm,Dm.rank_info,Dm.Nx-2,Dm.Ny-2,Dm.Nz-2,1,1,1,0,1)
|
||||
{
|
||||
NULL_USE( pBC );
|
||||
INSIST( db, "Input database is empty" );
|
||||
char rankString[20];
|
||||
sprintf(rankString,"%05d",Dm.rank);
|
||||
|
||||
@@ -23,10 +23,8 @@ class runAnalysis
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
runAnalysis( std::shared_ptr<Database> db,
|
||||
const RankInfoStruct& rank_info, const ScaLBL_Communicator &ScaLBL_Comm, const Domain& dm,
|
||||
int Np, bool pBC, double beta, double err,
|
||||
IntArray Map );
|
||||
runAnalysis( std::shared_ptr<Database> db, const RankInfoStruct& rank_info,
|
||||
const ScaLBL_Communicator &ScaLBL_Comm, const Domain& dm, int Np, bool pBC, double beta, IntArray Map );
|
||||
|
||||
//! Destructor
|
||||
~runAnalysis();
|
||||
|
||||
@@ -21,6 +21,7 @@ Domain {
|
||||
n = 80, 80, 80 // Size of local domain (Nx,Ny,Nz)
|
||||
n_spheres = 1 // Number of spheres
|
||||
L = 1, 1, 1 // Length of domain (x,y,z)
|
||||
BC = 0 // Boundary condition
|
||||
}
|
||||
|
||||
Analysis {
|
||||
|
||||
@@ -504,7 +504,7 @@ int main(int argc, char **argv)
|
||||
//************ MAIN ITERATION LOOP ***************************************/
|
||||
PROFILE_START("Loop");
|
||||
std::shared_ptr<Database> analysis_db;
|
||||
runAnalysis analysis( analysis_db, rank_info, ScaLBL_Comm, Dm, Np, pBC, beta, err, Map );
|
||||
runAnalysis analysis( analysis_db, rank_info, ScaLBL_Comm, Dm, Np, pBC, beta, Map );
|
||||
analysis.createThreads( analysis_method, 4 );
|
||||
while (timestep < timestepMax && err > tol ) {
|
||||
//if ( rank==0 ) { printf("Running timestep %i (%i MB)\n",timestep+1,(int)(Utilities::getMemoryUsage()/1048576)); }
|
||||
|
||||
@@ -551,7 +551,7 @@ int main(int argc, char **argv)
|
||||
//************ MAIN ITERATION LOOP ***************************************/
|
||||
PROFILE_START("Loop");
|
||||
std::shared_ptr<Database> analysis_db;
|
||||
runAnalysis analysis( analysis_db, rank_info, ScaLBL_Comm, Dm, Np, pBC, beta, err, Map );
|
||||
runAnalysis analysis( analysis_db, rank_info, ScaLBL_Comm, Dm, Np, pBC, beta, Map );
|
||||
analysis.createThreads( analysis_method, 4 );
|
||||
while (timestep < timestepMax && err > tol ) {
|
||||
//if ( rank==0 ) { printf("Running timestep %i (%i MB)\n",timestep+1,(int)(Utilities::getMemoryUsage()/1048576)); }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user