OOFEM 3.0
Loading...
Searching...
No Matches
oofem::UnstructuredGridField Class Reference

#include <unstructuredgridfield.h>

Inheritance diagram for oofem::UnstructuredGridField:
Collaboration diagram for oofem::UnstructuredGridField:

Classes

class  Vertex
class  Cell
class  CellInsertionFunctor
class  CellContainingPointFunctor

Public Member Functions

 UnstructuredGridField (int nvert, int ncells, double octreeOriginShift=0.0)
virtual ~UnstructuredGridField ()
void initialize (int nvert, int ncells, double _octreeOriginShift=0.0)
int giveNumberOfVertices () const
int giveNumberOfCells () const
void setVertexValue (int num, const FloatArray &vv)
void addVertex (int num, FloatArray &coords)
const FloatArraygetVertexCoordinates (int num) const
VertexgetVertex (int num)
void addCell (int num, const Element_Geometry_Type type, IntArray &vertices)
int evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep) override
int evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep) override
void saveContext (DataStream &stream) override
void restoreContext (DataStream &stream) override
const char * giveClassName () const override
Public Member Functions inherited from oofem::Field
 Field (FieldType b=FieldType::FT_Unknown)
virtual ~Field ()
virtual int evaluateAt (FloatArray &answer, Element *elem, ValueModeType mode, TimeStep *tStep)
FieldType giveType ()
 Returns the type of receiver.
void setType (FieldType b)
 Sets the type of receiver.
void setSetsNumbers (const IntArray sets)
 Defines a list of sets used to impose a field on specific elements.
virtual bool hasElementInSets (int nElem, Domain *d)
 Searches if element number exist in IntArray regionSets for given domain.
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).
virtual void initializeFrom (InputRecord &ir)

Protected Member Functions

void initOctree ()

Protected Attributes

std::vector< CellcellList
std::vector< VertexvertexList
std::vector< FloatArrayvalueList
OctreeSpatialLocalizerT< CellspatialLocalizer
long int octreeTimeStamp
 octree build time stamp
long int timeStamp
 receiver timestamp
double octreeOriginShift
 octree origin shift
Protected Attributes inherited from oofem::Field
FieldType type
IntArray regionSets

Detailed Description

Field defined by values defined on unstructured grid. This implementation does not require that underlying grid is oofem mesh (composed of DofMagars and Elements), but rather simple objects (Vertices and Cells) which in turn does not have to provide complex FE services. Typically used to map extermal field to mupif. The performance is robust but quite slow due to excessive searching. For external fields, use rather DofManValueField.

Definition at line 62 of file unstructuredgridfield.h.

Constructor & Destructor Documentation

◆ UnstructuredGridField()

oofem::UnstructuredGridField::UnstructuredGridField ( int nvert,
int ncells,
double octreeOriginShift = 0.0 )
inline

Constructor. Creates a field, with unspecified field values.

Definition at line 308 of file unstructuredgridfield.h.

References oofem::Field::Field(), octreeOriginShift, and spatialLocalizer.

Referenced by oofem::UnstructuredGridField::Cell::Cell().

◆ ~UnstructuredGridField()

virtual oofem::UnstructuredGridField::~UnstructuredGridField ( )
inlinevirtual

Definition at line 316 of file unstructuredgridfield.h.

Member Function Documentation

◆ addCell()

void oofem::UnstructuredGridField::addCell ( int num,
const Element_Geometry_Type type,
IntArray & vertices )
inline

Definition at line 347 of file unstructuredgridfield.h.

References cellList, and oofem::Field::type.

◆ addVertex()

void oofem::UnstructuredGridField::addVertex ( int num,
FloatArray & coords )
inline

Definition at line 333 of file unstructuredgridfield.h.

References vertexList.

◆ evaluateAt() [1/2]

int oofem::UnstructuredGridField::evaluateAt ( FloatArray & answer,
const FloatArray & coords,
ValueModeType mode,
TimeStep * tStep )
inlineoverridevirtual

Evaluates the field at given point.

Parameters
coordsCoordinates of the point of interest
answerField evaluated at coordinate.
tStepTime step to evaluate for.
modeMode of value (total, velocity,...).
Returns
Zero if ok, otherwise nonzero.

Implements oofem::Field.

Definition at line 352 of file unstructuredgridfield.h.

References oofem::FloatArray::at(), oofem::UnstructuredGridField::Cell::getVertexNum(), oofem::OctreeSpatialLocalizerT< T >::giveDataOnFilter(), oofem::UnstructuredGridField::Cell::giveNumberOfVertices(), initOctree(), oofem::UnstructuredGridField::Cell::interpolate(), OOFEM_ERROR, and oofem::FloatArray::printYourself().

Referenced by evaluateAt().

◆ evaluateAt() [2/2]

int oofem::UnstructuredGridField::evaluateAt ( FloatArray & answer,
DofManager * dman,
ValueModeType mode,
TimeStep * tStep )
inlineoverridevirtual

Implementaton of Field::evaluateAt for DofManager.

Implements oofem::Field.

Definition at line 405 of file unstructuredgridfield.h.

References evaluateAt(), and oofem::DofManager::giveCoordinates().

◆ getVertex()

Vertex * oofem::UnstructuredGridField::getVertex ( int num)
inline

Definition at line 343 of file unstructuredgridfield.h.

◆ getVertexCoordinates()

const FloatArray & oofem::UnstructuredGridField::getVertexCoordinates ( int num) const
inline

Definition at line 338 of file unstructuredgridfield.h.

◆ giveClassName()

const char * oofem::UnstructuredGridField::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Implements oofem::Field.

Definition at line 415 of file unstructuredgridfield.h.

◆ giveNumberOfCells()

int oofem::UnstructuredGridField::giveNumberOfCells ( ) const
inline

Definition at line 327 of file unstructuredgridfield.h.

References cellList.

◆ giveNumberOfVertices()

int oofem::UnstructuredGridField::giveNumberOfVertices ( ) const
inline

Definition at line 326 of file unstructuredgridfield.h.

References vertexList.

◆ initialize()

void oofem::UnstructuredGridField::initialize ( int nvert,
int ncells,
double _octreeOriginShift = 0.0 )
inline

Definition at line 318 of file unstructuredgridfield.h.

◆ initOctree()

◆ restoreContext()

void oofem::UnstructuredGridField::restoreContext ( DataStream & stream)
inlineoverridevirtual

Restores the receiver state previously written in stream.

Parameters
streamInput stream.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Implements oofem::Field.

Definition at line 412 of file unstructuredgridfield.h.

◆ saveContext()

void oofem::UnstructuredGridField::saveContext ( DataStream & stream)
inlineoverridevirtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Implements oofem::Field.

Definition at line 411 of file unstructuredgridfield.h.

◆ setVertexValue()

void oofem::UnstructuredGridField::setVertexValue ( int num,
const FloatArray & vv )
inline

Definition at line 329 of file unstructuredgridfield.h.

References valueList.

Member Data Documentation

◆ cellList

std::vector< Cell > oofem::UnstructuredGridField::cellList
protected

Definition at line 290 of file unstructuredgridfield.h.

Referenced by addCell(), and giveNumberOfCells().

◆ octreeOriginShift

double oofem::UnstructuredGridField::octreeOriginShift
protected

octree origin shift

Definition at line 303 of file unstructuredgridfield.h.

Referenced by initOctree(), and UnstructuredGridField().

◆ octreeTimeStamp

long int oofem::UnstructuredGridField::octreeTimeStamp
protected

octree build time stamp

Definition at line 299 of file unstructuredgridfield.h.

◆ spatialLocalizer

OctreeSpatialLocalizerT< Cell > oofem::UnstructuredGridField::spatialLocalizer
protected

Spatial Localizer. It is build upon request. Provides the spatial localization services.

Definition at line 297 of file unstructuredgridfield.h.

Referenced by UnstructuredGridField().

◆ timeStamp

long int oofem::UnstructuredGridField::timeStamp
protected

receiver timestamp

Definition at line 301 of file unstructuredgridfield.h.

◆ valueList

std::vector< FloatArray > oofem::UnstructuredGridField::valueList
protected

Definition at line 292 of file unstructuredgridfield.h.

Referenced by setVertexValue().

◆ vertexList

std::vector< Vertex > oofem::UnstructuredGridField::vertexList
protected

Definition at line 291 of file unstructuredgridfield.h.

Referenced by addVertex(), giveNumberOfVertices(), and initOctree().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011