Geometry class#

struct geo_curve_type#

structure to define 1D closed geometry curve, a assembley of 2D lines.

Note

The order of the line should be anticlockwise, otherwise will generate inverse mesh

Public Functions

geo_curve_type() = default#
void clear()#

Public Members

char tag[MAXARGC] = "\0"#
int n_line = 0#
int *line = nullptr#
struct geo_EmbededlineGroups_type#

structure to define the 1D lines. It contains the information of physcial group, embed type and node list.

Public Functions

geo_EmbededlineGroups_type() = default#
void clear()#

Public Members

char tag[MAXARGC] = "\0"#
int DimTags_n = 0#
int *DimTags = nullptr#
struct geo_group_type#

structure of geometry groups.

Public Functions

geo_group_type() = default#

Public Members

char tag[MAXARGC] = "\0"#
GroupType type = GroupType::RETANGULARIN#
Real range[4]#
Real mesh_size = 0.0#
struct geo_line_type#

structure to define the 1D lines. It contains the information of physcial group, embed type and node list.

Public Functions

geo_line_type() = default#
void clear()#

Public Members

char tag[MAXARGC] = "\0"#
bool iselement = true#
bool tobeReserved = false#
bool isembeded = false#
int DimTags_n = 0#
int *DimTags = nullptr#
int layers = 0#
int DimTags1_n = 0#
int *DimTags1 = nullptr#
int DimTags2_n = 0#
int *DimTags2 = nullptr#
int node_1 = -1#
int node_2 = -1#
int physicalID = -1#
struct geo_node_type#

Public Functions

geo_node_type() = default#

Public Members

Real x = 0.0#
Real y = 0.0#
Real z = 0.0#
struct geo_particles_t#

structure to create particles in gmsh.

Public Functions

geo_particles_t() = default#
void clear()#

Public Members

char tag[MAXARGC] = "\0"#
bool generateParticles = false#
bool rigidParticles = false#
char method[MAXARGC]#
Real xmin = 0.0#
Real xmax = 0.0#
Real ymin = 0.0#
Real ymax = 0.0#
Real prosity = 0.63#
Real rMin = 0.0#
Real rMax = 0.0#
int nparticles = 0#
int nMax = 1e7#
Real *x = nullptr#
Real *y = nullptr#
Real *radius = nullptr#
struct geo_surface_type#

structures to define 2D surfaces, all surfaces should be defined by closed curves.

Public Functions

geo_surface_type() = default#
void clear()#

Public Members

char tag[MAXARGC] = "\0"#
int n_removetool = 0#
int *removetool = nullptr#
int n_fragmenttool = 0#
int *fragmenttool = nullptr#
int n_boollines = 0#
int *boollines = nullptr#
int DimTags_n = 0#
int *DimTags = nullptr#
int recombined = -1#
int n_curve = 0#
int *curve = nullptr#
struct Geometry_structure#

Main structure to control the geometry in gmsh.

Public Functions

void resize(std::string type, Int size, Int initialsize = 0)#
void clear()#

Public Members

Real x0 = 0.0#
Real x1 = 0.0#
Real y0 = 0.0#
Real y1 = 0.0#
int node_num = 0#
int line_num = 0#
int curve_num = 0#
int surface_num = 0#
int group_num = 0#
int linegroups_num = 0#
int order = 1#
int recombined = 0#
double mesh_size = 0.0#
double min_size = 0.0#
geo_node_type *node = nullptr#
geo_line_type *line = nullptr#
geo_curve_type *curve = nullptr#
geo_surface_type *surface = nullptr#
geo_group_type *group = nullptr#
geo_EmbededlineGroups_type *linegroups = nullptr#
geo_particles_t particles#
int wall_num = 0#
char **wallTags#
int LineElement_n = 0#
char **LineElememtTags#
Int LineFlip_n = 0#
char **LineFlipTags#
Real minmuumAngle = 0.0#
Real minmuumSize = 0.0#
Int iteration = 1000#
class GeometryModule : public OpenFdemAbstract, public ns_geometry::GeometryUtils#

Public Functions

inline GeometryModule()#
inline ~GeometryModule()#

Public Static Functions

static void push_geometry_square(General general, Geometry geometry, OperationType embed_flag)#
static void push_geometry_polygon(General general, Geometry geometry, OperationType embed_flag)#
static void push_geometry_table(General general, Geometry geometry, OperationType embed_flag)#
static void pushJointFromSRC(General general, Geometry geometry)#
static void pushLineFromTable(General general, Geometry geometry)#
static void push_geometry_circle(General general, Geometry geometry, OperationType embed_flag)#
static void push_geometry_ellipse(General general, Geometry geometry, OperationType embed_flag)#
static void push_geometry_arc(General general, Geometry geometry)#
static bool push_geometry_joint(General general, Geometry geometry)#
static void setGlobalMeshSize(Geometry geometry, int &ierr)#
static void setMeshSizefromGroups(Geometry geometry, int &ierr)#
static void pushGeometryLineGroups(General general, Geometry geometry, const Int groupcount, char **grouptags)#
static void push_geometry_line(General general, Geometry geometry)#
static void push_geometry_jset(General general, Geometry geometry)#
static void push_geometry_DFN(General general, Geometry geometry)#
static void getGeoNodeGroupInBoxRange(Geometry geometry, char *tag, double x_lef, double x_rig, double y_bot, double y_top)#
static void getGeoNodeGroupOnBoxRange(Geometry geometry, char *tag, double x_lef, double x_rig, double y_bot, double y_top)#
static void getGeoNodeGroupOutBoxRange(Geometry geometry, char *tag, double x_lef, double x_rig, double y_bot, double y_top)#
static void getGeoNodeGroupOnPlaneLeft(Geometry geometry, char *tag, double x1, double y1, double x2, double y2)#
static void getGeoNodeGroupOnPlaneRight(Geometry geometry, char *tag, double x1, double y1, double x2, double y2)#
static void getGeoNodeGroupOnPlane(Geometry geometry, char *tag, double x1, double y1, double x2, double y2)#
static void getGeoNodeGroupInCircleRange(Geometry geometry, char *tag, double x0, double y0, double radius)#
static void getGeoNodeGroupOutCircleRange(Geometry geometry, char *tag, double x0, double y0, double radius)#
static void getGeoNodeGroupOnCircle(Geometry geometry, char *tag, double x0, double y0, double radius)#
static void push_mesh_size(Geometry geometry, General general, char *keyword)#
static void push_surface_recombined(Geometry geometry, General general, char *keyword)#
static void gmsh_api(Openfdem openfdem, Geometry geometry, char **argv, char *keyword, int write_flag)#

gmsh interface to call api and do mesh.

Parameters:
  • openfdem

  • geometry

  • argv

  • keyword

  • write_flag

static void geometry_free(Geometry geometry)#

free up all variables in geometry.

Parameters:

geometry

static void createRealisticDFNs(General general, Geometry geometry)#

create realistic DFNs from image.

Parameters:
  • general

  • geometry

static void pushRandomParticles(General general, Geometry geometry, UInt nParameters, char **parameters)#

push the particles from geometry to particle

Parameters:
  • general

  • geometry

  • nParameters

  • parameters

static inline void newParticle(Geometry geometry, Real &Newx, Real &Newy, Real &Newr, gsl_rng *r)#

create a new particle.

Parameters:
  • geometry

  • Newx

  • Newy

  • Newr

  • r

static bool isOverlap(Geometry geometry, Real Newx, Real Newy, Real Newr)#

to check the particle is overlapped.

Parameters:
  • geometry

  • Newx

  • Newy

  • Newr

Returns:

static void randomParticles(Geometry geometry)#

create random particles for particulate DEM.

Parameters:
  • general

  • geometry

  • nParameters

  • parameters

static void importParticles(General general, Geometry geometry, char *keyword)#

import particles from pfc.

Parameters:
  • general

  • geometry

  • keyword

static void addGeometryDFNTags(General general, Geometry geometry, const Int groupcount, char **grouptags)#

add the list of element sets to determine the 2d elements are shells, walls, and not DFNs. DFNs are also 2D elements, and are imported by default. for .inp mesh only

Attention

This function should be called before the mesh is imported.

Parameters:
  • general

  • geometry

  • groupcount

  • grouptags

static void addGeometryFlipTags(General general, Geometry geometry, const Int groupcount, char **grouptags)#

to flip the direction of 2D wall. The wall direction to act with entities or particles should be determined manually. The default is postive to counter clockwise of the plane, the node list will be reversed when this function is called.

\attenion This function should be called before the mesh info is imported.

Parameters:
  • general

  • geometry

  • groupcount

  • grouptags

class GeometryUtils : public OpenFdemAbstract, public MeshUtils#
#include <geometry_utils.h>

Subclassed by ns_geometry::GeometryModule

Public Functions

inline GeometryUtils()#
inline ~GeometryUtils()#

Public Static Functions

static bool isLinesWellIntersection(Geometry geometry, Real container[], bool isforJsets)#

do dfn quality check for jset, joint, DFN and rDFN tools.

Parameters:
  • geometry

  • container

Returns:

static void parseJsets(General general, Jset_data &Jsetdata)#
static void parseDFNs(General general, Real dip[], Real length[], Int &count, Int &method, Real &p21, Real &p10, random_method &dip_method, random_method &length_method)#
static void chechGeomtryGroups(Geometry geometry, char *tag)#
static void addtoLineGroups(Geometry geometry, char *newToolTag)#
static void addtoLinetoNodeGroups(Geometry geometry, char *newToolTag)#
static void addLinetoSufaceBoolGroups(Geometry geometry, char *ObjectTag, Int n_line)#
static void addLinetoSufaceRemoveGroups(Geometry geometry, char *ObjectTag, Int n_surface)#
static bool isPointOnLineSegment(const Vector2 &point, const Vector2 &start, const Vector2 &end)#
static bool findIntersectionPoints(const Vector2 &startPoint, Real angle, const Vector2 &A, const Vector2 &B, const Vector2 &C, const Vector2 &D, Real Intersection[])#
static inline void getRandomDipAngle(Jset_data &Jsetdata, gsl_rng *r, Real &dipAngle)#
static inline void getRandomSpace(Jset_data &Jsetdata, gsl_rng *r, Real &spaceDistance)#
static inline void getRandomTrace(Jset_data &Jsetdata, gsl_rng *r, Real &traceLength)#
static inline void getRandomGap(Jset_data &Jsetdata, gsl_rng *r, Real &gapDistance)#
struct Jset_data#
#include <geometry_utils.h>

Public Functions

inline Jset_data()#

Public Members

Real dip[2]#
random_method dip_method = random_method::RANDOM_NULL#
Real space[2]#
random_method space_method = random_method::RANDOM_NULL#
Real trace[2]#
random_method trace_method = random_method::RANDOM_NULL#
Real gap[2]#
random_method gap_method = random_method::RANDOM_NULL#
bool isNonpersistent = false#
bool useUserdefinedStartPoint = false#
Vector2 startPoint#
namespace ns_common
namespace ns_geometry#
namespace ns_mesh#
file geometry_utils.h
#include <algorithm>
#include <external/gsl/gsl_randist.h>
#include <external/gsl/gsl_rng.h>
#include <mesh/mesh_utils.h>
#include “common/openfdem_abstract.h”
#include “solver/openfdem.h”
file openfdem_geometry.h
#include “common/openfdem_common.h”

Typedefs

typedef struct Geometry_structure *Geometry#

Enums

enum class GroupType#

Values:

enumerator NOT#
enumerator CIRCLEON#
enumerator CIRCLEIN#
enumerator CIRCLEOUT#
enumerator PLANEON#
enumerator PLANELEFT#
enumerator PLANERIGHT#
enumerator RETANGULARON#
enumerator RETANGULARIN#
enumerator RETANGULAROUT#
enumerator FROMLINETAGS#
enumerator FROMSURFACETAGS#
enum class OperationType#

Values:

enumerator ENTIRE#
enumerator REMOVE#
enumerator CUT#
enum class geoSolidType#

Values:

enumerator RETANGLE#
enumerator DISK#
enumerator CIRCLE#
enumerator ELLIPSE#
enumerator CIRCLEARC#
enumerator ELLIPSEARC#
enumerator LINE#
file openfdem_geometry_module.h
#include <common/openfdem_macros.h>
#include <geometry_utils.h>
#include “common/memory_manager.h”
#include “common/openfdem_abstract.h”
#include “common/openfdem_message.h”
#include “external/gsl/gsl_randist.h”
#include “external/gsl/gsl_rng.h”
#include “mesh/mesh_utils.h”
#include “solver/openfdem.h”
dir geometry
dir src