# PhasicFlow: triSurface Class Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

triSurface Class Reference
Inheritance diagram for triSurface:
[legend]
Collaboration diagram for triSurface:
[legend]

## Public Member Functions

| TypeInfo ("triSurface")
| triSurface (const objectFile &objf, repository *owner, const triSurface &surf)
| triSurface (const realx3x3Field_H &triangles, repository *owner=nullptr)
| ~triSurface () override=default
uint32 | numPoints () const
uint32 | size () const
uint32 | capacity () const
const realx3Field_D & | points () const
realx3Field_D & | points ()
const auto & | area () const
auto & | area ()
const uint32x3Field_D & | vertices () const
uint32x3Field_D & | vertices ()
auto & | normals ()
const auto & | normals () const
void | clear ()
auto | getTriangleAccessor () const
| Obtain an object for accessing triangles. More...
bool | read (iIstream &is, const IOPattern &iop) override
bool | write (iOstream &os, const IOPattern &iop) const override
Public Member Functions inherited from IOobject
virtual word | typeName () const =0
| IOobject (const objectFile &objf, const IOPattern &iop, repository *owner)
| ~IOobject () override
| IOobject (const IOobject &src)=delete
| IOobject (IOobject &&src)=delete
const IOPattern & | ioPattern () const
const repository * | owner () const override
repository * | owner ()
repository * | releaseOwner (bool fromOwner=false)
bool | isIncluded (const word &objName) const override
bool | isExcluded (const word &objName) const override
bool | readObject (bool rdHdr=true)
bool | writeObject () const
bool | readObject (iIstream &is, bool rdHdr=true)
bool | writeObject (iOstream &os) const
Public Member Functions inherited from IOfileHeader
| IOfileHeader (const objectFile &objf)
const word & | objectName () const
const word & | objectType () const
fileSystem | path () const
bool | outFileBinary () const
bool | inFileBinary () const
bool | headerOk (bool silent=false)
bool | implyRead () const
| Imply read. More...
bool | implyWrite () const
| Imply write. More...
bool | fileExist () const
| Check if file exists. More...
bool | readIfPresent () const
| Check read if present. More...
bool | writeHeader () const
| Check if the header should be written to file True: on master + implyWrite + readWriteHeader = true False: otherwise. More...
bool | writeHeader (iOstream &os, const word &typeName, bool forceWrite=false) const
| Write the header to the file , typeName comes from caller. More...
bool | writeHeader (iOstream &os, bool forceWrite=false) const
| Write the header to the file, typeName comes from the one read from file. More...
bool | readHeader () const
| Check if header should be read from file. More...
bool | readHeader (iIstream &is, bool silent=false)
| Read the header in the file. More...
bool | writeBanner (iOstream &os) const
| write the banner More...
bool | writeSeparator (iOstream &os) const
| wirte a separator line More...
Public Member Functions inherited from objectFile
| objectFile (const word &name)
| objectFile (const word &name, const fileSystem &localPath, const readFlag &rf=readFlag::READ_NEVER, const writeFlag &wf=writeFlag::WRITE_NEVER, bool rwHeader=true)
| objectFile (const objectFile &src)=default
| objectFile (objectFile &&src)=default
objectFile & | operator= (const objectFile &rhs)=default
objectFile & | operator= (objectFile &&rhs)=default
virtual | ~objectFile ()=default
virtual const word & | name () const
virtual const fileSystem & | localPath () const
readFlag | rFlag () const
writeFlag | wFlag () const
bool | isReadAlways () const
bool | isReadNever () const
bool | isReadIfPresent () const
bool | isWriteAlways () const
bool | isWriteNever () const
bool | readWriteHeader () const

## Protected Member Functions

bool | calculateNormals ()
bool | calculateArea ()
bool | append (const realx3x3Field_H &triangles)
bool | append (const realx3x3Vector &triangles)
| triSurface (const objectFile &obj, repository *owner)
Protected Member Functions inherited from IOfileHeader
uniquePtr< iFstream > | inStream () const
uniquePtr< oFstream > | outStream () const
uniquePtr< oFstream > | dummyOutStream () const

## Private Attributes

realx3Field_D | points_ {"points", "points"}
| points of triangles More...
uint32x3Field_D | vertices_ {"vertices", "vertices"}
| vectices indices of triangles More...
realField_D | area_ {"area", "area"}
| area of each triangle More...
realx3Field_D | normals_ {"normals", "normals"}
| normal vector of triangles More...

## Additional Inherited Members

Public Types inherited from objectFile
enum | readFlag { READ_ALWAYS, READ_NEVER, READ_IF_PRESENT }
enum | writeFlag { WRITE_ALWAYS, WRITE_NEVER }
Protected Attributes inherited from IOfileHeader
word | objectName_
word | objectType_
word | fileFormat_ = "ASCII"
| file format read from file More...

## Detailed Description

Definition at line 103 of file triSurface.hpp.

## Constructor & Destructor Documentation

## triSurface() [1/3]

triSurface | ( | const objectFile & | obj,
|  | repository * | owner
| ) |  |

protected

Definition at line 191 of file triSurface.cpp.

## triSurface() [2/3]

triSurface | ( | const objectFile & | objf,
|  | repository * | owner,
|  | const triSurface & | surf
| ) |  |

Definition at line 208 of file triSurface.cpp.

## triSurface() [3/3]

triSurface | ( | const realx3x3Field_H & | triangles,
|  | repository * | owner = `nullptr`
| ) |  |

explicit

Definition at line 233 of file triSurface.cpp.

References fatalExit.

## ~triSurface()

~triSurface | ( |  | ) |

overridedefault

## Member Function Documentation

## calculateNormals()

bool calculateNormals | ( |  | ) |

protected

Definition at line 107 of file triSurface.cpp.

References pFlow::triSurfaceKernels::calculateNormals(), triSurface::normals_, triSurface::points_, and triSurface::vertices_.

Here is the call graph for this function:

## calculateArea()

bool calculateArea | ( |  | ) |

protected

Definition at line 115 of file triSurface.cpp.

References pFlow::triSurfaceKernels::calculateArea().

Here is the call graph for this function:

## append() [1/2]

bool append | ( | const realx3x3Field_H & | triangles | ) |

protected

Definition at line 124 of file triSurface.cpp.

References pFlow::convertToTriSurfaceComponents(), pFlow::endl(), fatalErrorInFunction, VectorSingle< T, MemorySpace >::getSpan(), Field< T, MemorySpace >::name(), and pFlow::triangle::normal().

Here is the call graph for this function:

## append() [2/2]

bool append | ( | const realx3x3Vector & | triangles | ) |

protected

Definition at line 158 of file triSurface.cpp.

References pFlow::convertToTriSurfaceComponents(), pFlow::endl(), fatalErrorInFunction, Vector< T, Allocator >::getSpan(), Vector< T, Allocator >::name(), and pFlow::triangle::normal().

Here is the call graph for this function:

## TypeInfo()

TypeInfo | ( | "triSurface" |  | ) |

## numPoints()

uint32 numPoints | ( |  | ) | const

inline

Definition at line 157 of file triSurface.hpp.

References triSurface::points_, and VectorSingle< T, MemorySpace >::size().

Referenced by ContactSearch< searchMethod >::ContactSearch().

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

## size()

uint32 size | ( |  | ) | const

inline

Definition at line 162 of file triSurface.hpp.

References VectorSingle< T, MemorySpace >::size(), and triSurface::vertices_.

Referenced by triSurfaceField< uint32 >::assign(), ContactSearch< searchMethod >::ContactSearch(), and geometry::createPropertyId().

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

## capacity()

uint32 capacity | ( |  | ) | const

inline

Definition at line 167 of file triSurface.hpp.

References VectorSingle< T, MemorySpace >::capacity(), and triSurface::vertices_.

Referenced by triSurfaceField< uint32 >::assign(), and geometry::createPropertyId().

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

## points() [1/2]

const realx3Field_D& points | ( |  | ) | const

inline

Definition at line 172 of file triSurface.hpp.

References triSurface::points_.

Referenced by ContactSearch< searchMethod >::ContactSearch().

Here is the caller graph for this function:

## points() [2/2]

realx3Field_D& points | ( |  | ) |

inline

Definition at line 177 of file triSurface.hpp.

References triSurface::points_.

## area() [1/2]

const auto& area | ( |  | ) | const

inline

Definition at line 182 of file triSurface.hpp.

References triSurface::area_.

## area() [2/2]

auto& area | ( |  | ) |

inline

Definition at line 187 of file triSurface.hpp.

References triSurface::area_.

## vertices() [1/2]

const uint32x3Field_D& vertices | ( |  | ) | const

inline

Definition at line 192 of file triSurface.hpp.

References triSurface::vertices_.

Referenced by ContactSearch< searchMethod >::ContactSearch().

Here is the caller graph for this function:

## vertices() [2/2]

uint32x3Field_D& vertices | ( |  | ) |

inline

Definition at line 197 of file triSurface.hpp.

References triSurface::vertices_.

## normals() [1/2]

auto& normals | ( |  | ) |

inline

Definition at line 202 of file triSurface.hpp.

References triSurface::normals_.

Referenced by ContactSearch< searchMethod >::ContactSearch().

Here is the caller graph for this function:

## normals() [2/2]

const auto& normals | ( |  | ) | const

inline

Definition at line 207 of file triSurface.hpp.

References triSurface::normals_.

## clear()

void clear | ( |  | ) |

inline

Definition at line 212 of file triSurface.hpp.

References triSurface::area_, VectorSingle< T, MemorySpace >::clear(), triSurface::normals_, triSurface::points_, and triSurface::vertices_.

Referenced by multiTriSurface::clear().

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

## getTriangleAccessor()

auto getTriangleAccessor | ( |  | ) | const

inline

Obtain an object for accessing triangles.

Definition at line 221 of file triSurface.hpp.

References VectorSingle< T, MemorySpace >::deviceViewAll(), triSurface::points_, VectorSingle< T, MemorySpace >::size(), and triSurface::vertices_.

Here is the call graph for this function:

## read()

bool read | ( | iIstream & | is,
|  | const IOPattern & | iop
| ) |  |

overridevirtual

Implements IOobject.

Definition at line 257 of file triSurface.cpp.

References pFlow::triSurfaceKernels::calculateArea(), pFlow::triSurfaceKernels::calculateNormals(), pFlow::endl(), ioErrorInFile, IOstream::lineNumber(), and IOstream::name().

Referenced by pFlow::operator>>(), and multiTriSurface::read().

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

## write()

bool write | ( | iOstream & | os,
|  | const IOPattern & | iop
| ) |  | const

overridevirtual

Implements IOobject.

Definition at line 282 of file triSurface.cpp.

References pFlow::endl(), ioErrorInFile, IOstream::lineNumber(), and IOstream::name().

Referenced by pFlow::operator<<(), and multiTriSurface::write().

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

## Member Data Documentation

## points_

realx3Field_D points_ {"points", "points"}

private

points of triangles

Definition at line 110 of file triSurface.hpp.

Referenced by triSurface::calculateNormals(), triSurface::clear(), triSurface::getTriangleAccessor(), triSurface::numPoints(), and triSurface::points().

## vertices_

uint32x3Field_D vertices_ {"vertices", "vertices"}

private

vectices indices of triangles

Definition at line 113 of file triSurface.hpp.

Referenced by triSurface::calculateNormals(), triSurface::capacity(), triSurface::clear(), triSurface::getTriangleAccessor(), triSurface::size(), and triSurface::vertices().

## area_

realField_D area_ {"area", "area"}

private

area of each triangle

Definition at line 116 of file triSurface.hpp.

Referenced by triSurface::area(), and triSurface::clear().

## normals_

realx3Field_D normals_ {"normals", "normals"}

private

normal vector of triangles

Definition at line 119 of file triSurface.hpp.

Referenced by triSurface::calculateNormals(), triSurface::clear(), and triSurface::normals().

The documentation for this class was generated from the following files:

- src/phasicFlow/triSurface/triSurface.hpp
- src/phasicFlow/triSurface/triSurface.cpp