MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
geometry.cc File Reference

Helpful geometric and mathematical functions. More...

#include "globals.hh"

Go to the source code of this file.

Functions

bool in_domain (double x, double y, double z)
 True if the point is in the domain, False otherwise. More...
 
double * CrossProduct (double a[], double b[])
 Cross product of two points in 3D. More...
 
bool SameSide (double p1[], double p2[], double a[], double b[])
 True if two points are in the same half-plane defined by other two points. More...
 
bool PointInTriangle (double p[], double a[], double b[], double c[])
 True if point lies in the triangle. More...
 
double porosity (int ***amat)
 Calculates porosity. More...
 

Detailed Description

Helpful geometric and mathematical functions.

Author
Pavel Ferkl

Definition in file geometry.cc.

Function Documentation

◆ CrossProduct()

double* CrossProduct ( double  a[],
double  b[] 
)

Cross product of two points in 3D.

Parameters
[in]a1st point
[in]b2nd point

Definition at line 20 of file geometry.cc.

References globals::cp.

Referenced by SameSide().

◆ in_domain()

bool in_domain ( double  x,
double  y,
double  z 
)

True if the point is in the domain, False otherwise.

Parameters
[in]xx position
[in]yx position
[in]zx position

Definition at line 9 of file geometry.cc.

References globals::nz.

Referenced by importFoamSkeleton(), makeEdgeStruts(), makeNodeStruts(), and saveToGnuplot().

◆ PointInTriangle()

bool PointInTriangle ( double  p[],
double  a[],
double  b[],
double  c[] 
)

True if point lies in the triangle.

Parameters
[in]pthe point
[in]a1st point defining triangle
[in]b2nd point defining triangle
[in]c3rd point defining triangle

Definition at line 56 of file geometry.cc.

Referenced by makeEdgeStruts().

◆ porosity()

double porosity ( int ***  amat)

Calculates porosity.

Parameters
[in]amatmatrix

Definition at line 70 of file geometry.cc.

References globals::nx, globals::ny, globals::nz, and constants::por.

Referenced by main(), and phys_prop::porosity().

◆ SameSide()

bool SameSide ( double  p1[],
double  p2[],
double  a[],
double  b[] 
)

True if two points are in the same half-plane defined by other two points.

Parameters
[in]p11st point
[in]p22nd point
[in]a1st point defining half-plane
[in]b2nd point defining half-plane

Definition at line 32 of file geometry.cc.

References CrossProduct().