document dcel class
This commit is contained in:
parent
393fdaf546
commit
6eb19ad764
@ -47,16 +47,39 @@ public:
|
|||||||
double MoveInterface(ScaLBL_ColorModel &M);
|
double MoveInterface(ScaLBL_ColorModel &M);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief image re-initialization
|
* \brief Image re-initialization
|
||||||
* \details Re-initialize LB simulation from image data
|
* \details Re-initialize LB simulation from image data
|
||||||
* @param M ScaLBL_ColorModel
|
* @param M ScaLBL_ColorModel
|
||||||
* @param Filename name of input file to be used to read image
|
* @param Filename name of input file to be used to read image
|
||||||
*/
|
*/
|
||||||
double ImageInit(ScaLBL_ColorModel &M, std::string Filename);
|
double ImageInit(ScaLBL_ColorModel &M, std::string Filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \details Update volume fraction based on morphological algorithm. Dilation / erosion algorithm will be applied to
|
||||||
|
* grow / shrink the phase regions
|
||||||
|
* @param M ScaLBL_ColorModel
|
||||||
|
* @param delta_volume target change in volume fraction
|
||||||
|
*/
|
||||||
double ShellAggregation(ScaLBL_ColorModel &M, const double delta_volume);
|
double ShellAggregation(ScaLBL_ColorModel &M, const double delta_volume);
|
||||||
double UpdateFractionalFlow(ScaLBL_ColorModel &M);
|
|
||||||
|
/**
|
||||||
|
* \details Update fractional flow condition. Mass will be preferentially added or removed from
|
||||||
|
* phase regions based on where flow is occurring
|
||||||
|
* @param M ScaLBL_ColorModel
|
||||||
|
*/ double UpdateFractionalFlow(ScaLBL_ColorModel &M);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief image re-initialization
|
||||||
|
* \details Re-initialize LB simulation from image data
|
||||||
|
* @param M ScaLBL_ColorModel
|
||||||
|
* @param seed_water_in_oil controls amount of mass to randomly seed into fluids
|
||||||
|
*/
|
||||||
double SeedPhaseField(ScaLBL_ColorModel &M, const double seed_water_in_oil);
|
double SeedPhaseField(ScaLBL_ColorModel &M, const double seed_water_in_oil);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Re-initialize LB simulation
|
||||||
|
* @param M ScaLBL_ColorModel
|
||||||
|
*/
|
||||||
void Flatten(ScaLBL_ColorModel &M);
|
void Flatten(ScaLBL_ColorModel &M);
|
||||||
DoubleArray phi;
|
DoubleArray phi;
|
||||||
DoubleArray phi_t;
|
DoubleArray phi_t;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
#include "analysis/dcel.h"
|
#include "analysis/dcel.h"
|
||||||
|
|
||||||
DECL::DECL(){
|
DCEL::DCEL(){
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL::~DECL(){
|
DCEL::~DCEL(){
|
||||||
TriangleCount=0;
|
TriangleCount=0;
|
||||||
VertexCount=0;
|
VertexCount=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DECL::Face(int index){
|
int DCEL::Face(int index){
|
||||||
return FaceData[index];
|
return FaceData[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void DECL::Write(){
|
void DCEL::Write(){
|
||||||
int e1,e2,e3;
|
int e1,e2,e3;
|
||||||
FILE *TRIANGLES;
|
FILE *TRIANGLES;
|
||||||
TRIANGLES = fopen("triangles.stl","w");
|
TRIANGLES = fopen("triangles.stl","w");
|
||||||
@ -32,7 +32,7 @@ void DECL::Write(){
|
|||||||
fclose(TRIANGLES);
|
fclose(TRIANGLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DECL::LocalIsosurface(const DoubleArray& A, double value, const int i, const int j, const int k){
|
void DCEL::LocalIsosurface(const DoubleArray& A, double value, const int i, const int j, const int k){
|
||||||
Point P,Q;
|
Point P,Q;
|
||||||
Point PlaceHolder;
|
Point PlaceHolder;
|
||||||
Point C0,C1,C2,C3,C4,C5,C6,C7;
|
Point C0,C1,C2,C3,C4,C5,C6,C7;
|
||||||
@ -174,7 +174,7 @@ void DECL::LocalIsosurface(const DoubleArray& A, double value, const int i, cons
|
|||||||
}
|
}
|
||||||
int nTris = TriangleCount;
|
int nTris = TriangleCount;
|
||||||
|
|
||||||
// Now add the local values to the DECL data structure
|
// Now add the local values to the DCEL data structure
|
||||||
if (nTris>0){
|
if (nTris>0){
|
||||||
FaceData.resize(TriangleCount);
|
FaceData.resize(TriangleCount);
|
||||||
//printf("Construct halfedge structure... \n");
|
//printf("Construct halfedge structure... \n");
|
||||||
@ -250,7 +250,7 @@ void DECL::LocalIsosurface(const DoubleArray& A, double value, const int i, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Point DECL::TriNormal(int edge)
|
Point DCEL::TriNormal(int edge)
|
||||||
{
|
{
|
||||||
Point P,Q,R;
|
Point P,Q,R;
|
||||||
Point U,V,W;
|
Point U,V,W;
|
||||||
@ -294,7 +294,7 @@ Point DECL::TriNormal(int edge)
|
|||||||
return W;
|
return W;
|
||||||
}
|
}
|
||||||
|
|
||||||
double DECL::EdgeAngle(int edge)
|
double DCEL::EdgeAngle(int edge)
|
||||||
{
|
{
|
||||||
double angle;
|
double angle;
|
||||||
double dotprod;
|
double dotprod;
|
||||||
@ -369,7 +369,7 @@ double DECL::EdgeAngle(int edge)
|
|||||||
|
|
||||||
void iso_surface(const Array<double>&Field, const double isovalue)
|
void iso_surface(const Array<double>&Field, const double isovalue)
|
||||||
{
|
{
|
||||||
DECL object;
|
DCEL object;
|
||||||
int e1,e2,e3;
|
int e1,e2,e3;
|
||||||
FILE *TRIANGLES;
|
FILE *TRIANGLES;
|
||||||
TRIANGLES = fopen("isosurface.stl","w");
|
TRIANGLES = fopen("isosurface.stl","w");
|
||||||
|
@ -5,7 +5,11 @@
|
|||||||
#include "analysis/pmmc.h"
|
#include "analysis/pmmc.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Doubly-connected edge list (DECL)
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \class Vertex
|
||||||
|
* @brief store vertex for DCEL data structure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Vertex structure
|
// Vertex structure
|
||||||
@ -34,8 +38,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Halfedge structure
|
/**
|
||||||
// Face
|
* \class Halfedge
|
||||||
|
* @brief store half edge for DCEL data structure
|
||||||
|
*/
|
||||||
class Halfedge{
|
class Halfedge{
|
||||||
public:
|
public:
|
||||||
Halfedge() = default;
|
Halfedge() = default;
|
||||||
@ -60,11 +66,14 @@ private:
|
|||||||
std::vector<std::array<int,6>> d_data;
|
std::vector<std::array<int,6>> d_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
// DECL
|
/**
|
||||||
class DECL{
|
* \class DCEL
|
||||||
|
* @details doubly connected edge list data structure
|
||||||
|
*/
|
||||||
|
class DCEL{
|
||||||
public:
|
public:
|
||||||
DECL();
|
DCEL();
|
||||||
~DECL();
|
~DCEL();
|
||||||
|
|
||||||
int face();
|
int face();
|
||||||
Vertex vertex;
|
Vertex vertex;
|
||||||
|
Loading…
Reference in New Issue
Block a user