DFNgen  2.0
DFN Model Generator
clusterGroups.cpp File Reference
#include <vector>
#include <iostream>
#include "clusterGroups.h"
#include "structures.h"
#include "input.h"
#include "mathFunctions.h"
Include dependency graph for clusterGroups.cpp:

Go to the source code of this file.

Functions

std::vector< unsigned int > getCluster (Stats &pstats)
 
bool facesMatch (bool *facesOption, bool *faces)
 
void assignGroup (Poly &newPoly, Stats &pstats, int newPolyIndex)
 
void updateGroups (Poly &newPoly, std::vector< Poly > &acceptedPoly, std::vector< unsigned int > &encounteredGroups, Stats &pstats, int newPolyIndex)
 

Function Documentation

§ assignGroup()

void assignGroup ( Poly newPoly,
Stats pstats,
int  newPolyIndex 
)

Assigns a new polygon/fracture to a new cluster group number. Assumes 'newPoly' does not intersect with any other fractures. Arg 1: New polygon Arg 2: Program stats structure Arg 3: Index of 'newPoly' in the 'acceptedPoly' array (array of all accepted polys)

Definition at line 137 of file clusterGroups.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ facesMatch()

bool facesMatch ( bool *  facesOption,
bool *  faces 
)

Compares the user's faces option to a fracture cluster Arg 1: Boundary faces user input option array ('boundaryFaces' in input file) Arg 2: Fracture cluter's boundary faces array. Similar to 'boundaryFaces' input option, but denotes which faces the fracture cluster connects to. Return: 0 - If faces meet user's facesOption requirements 1 - If faces do not meet requirements

Definition at line 115 of file clusterGroups.cpp.

Here is the caller graph for this function:

§ getCluster()

std::vector<unsigned int> getCluster ( Stats pstats)

Uses boundaryFaces input option to get the wanted fracture cluster before writing output files.

NOTE: 'boundaryFaces' array is a global variable

Arg 1: Program statistics structure Return: Array (std vsector) of indices to fractures which remained after isolated and non-matching boundary faces fracture removal.

Definition at line 45 of file clusterGroups.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ updateGroups()

void updateGroups ( Poly newPoly,
std::vector< Poly > &  acceptedPoly,
std::vector< unsigned int > &  encounteredGroups,
Stats pstats,
int  newPolyIndex 
)

Updates fracture cluster group data for the addition of 'newPoly'.

If 'newPoly' did not bridge any clusters together, 'newPoly' is added to the cluster of the first polygon it intersected with. The cluster groups boundary connectivity data is updated, clusters fracture count is incremented, and 'newPoly' is added to the list of polygons.

If 'newPoly' bridged two or more clusters, the function also merges the multiple cluster groups into a single group. 'newPoly' is first added to group of the first fracture it intersected with. Then, any remaining cluster groups 'newPoly' intersected with will have their group number changed to match that of 'newPolys' group number (see struct FractureGroups). Inside the GroupData structure, all polygons will have their group number updated to the new group number. Once polygons and struct FractureGroups have been updated, the FractureGroups corresponding GroupData structure will have its valid bit set to false. (This is more efficient than deleting the GroupData element from its array, which causes memory re-allocation and copying).

The GroupData structure contains information about it's corresponding FractureGroups structure (see GroupData). To access the cooresponding GroupData structure from a cluster group number, the index to the GroupData array within the Stats structure (pstats variable) will be the the cluster group number subtracted by 1. e.g. If you need to access the GroupData structure for cluster group 10, it will be the variable: pstats.groupData[10-1] To access the corresponding FractureGroups structure for a cluster group number, you must search the FractureGroups structure array and search for ALL matching group numbers (pstats.fractGroup[i].groupNum).

Arg 1: Reference to new polygon Arg 2: Array of all accepted polygons Arg 3: Array of group numbers for any other bridged fracture cluster groups Arg 4: Program statistics structure (contains fracture cluster data) Arg 5: Index of 'newPoly' once placed into the array of all accepted polygons (arg 2)

Definition at line 192 of file clusterGroups.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: