OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::UniformGridField Class Reference

Field defined by values in uniform grid nodes, with linear interpolation for points inside the grid, or interpolation for the closest point within the grid for points outside. More...

#include <uniformgridfield.h>

+ Inheritance diagram for oofem::UniformGridField:
+ Collaboration diagram for oofem::UniformGridField:

Public Member Functions

 UniformGridField ()
 Constructor. More...
 
virtual ~UniformGridField ()
 
void setGeometry (const FloatArray &lo_, const FloatArray &hi_, const IntArray &div_)
 Shorthand for defining geometry, with consistency checks. More...
 
void setValues (const FloatArray &vv)
 Accessor for setting nodal values; checks size of the array for correctness. More...
 
int evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep) override
 Implementation of Field::evaluateAt for coordinates. More...
 
int evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep) override
 Implementaton of Field::evaluateAt for DofManager. More...
 
contextIOResultType saveContext (DataStream &stream, ContextMode mode) override
 Stores receiver state to output stream. More...
 
contextIOResultType restoreContext (DataStream &stream, ContextMode mode) override
 Restores the receiver state previously written in stream. More...
 
const char * giveClassName () const override
 
- Public Member Functions inherited from oofem::Field
 Field (FieldType b)
 Constructor. More...
 
virtual ~Field ()
 
FieldType giveType ()
 Returns the type of receiver. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Member Functions

void xyz2ijk (const FloatArray &xyz, IntArray &ijk, FloatArray &normXyz) const
 
double nodeValue2d (int i, int j)
 
double nodeValue3d (int i, int j, int k)
 

Protected Attributes

FloatArray lo
 
FloatArray hi
 
IntArray div
 
FloatArray values
 
- Protected Attributes inherited from oofem::Field
FieldType type
 

Detailed Description

Field defined by values in uniform grid nodes, with linear interpolation for points inside the grid, or interpolation for the closest point within the grid for points outside.

Definition at line 46 of file uniformgridfield.h.

Constructor & Destructor Documentation

oofem::UniformGridField::UniformGridField ( )
inline

Constructor.

Creates a field, with unspecified field values.

Definition at line 69 of file uniformgridfield.h.

virtual oofem::UniformGridField::~UniformGridField ( )
inlinevirtual

Definition at line 70 of file uniformgridfield.h.

Member Function Documentation

int oofem::UniformGridField::evaluateAt ( FloatArray answer,
const FloatArray coords,
ValueModeType  mode,
TimeStep tStep 
)
overridevirtual
int oofem::UniformGridField::evaluateAt ( FloatArray answer,
DofManager dman,
ValueModeType  mode,
TimeStep tStep 
)
overridevirtual
const char* oofem::UniformGridField::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Implements oofem::Field.

Definition at line 109 of file uniformgridfield.h.

double oofem::UniformGridField::nodeValue2d ( int  i,
int  j 
)
protected

Definition at line 88 of file uniformgridfield.C.

References div, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), and values.

Referenced by evaluateAt().

double oofem::UniformGridField::nodeValue3d ( int  i,
int  j,
int  k 
)
protected

Definition at line 94 of file uniformgridfield.C.

References div, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), and values.

Referenced by evaluateAt().

contextIOResultType oofem::UniformGridField::restoreContext ( DataStream stream,
ContextMode  mode 
)
inlineoverridevirtual

Restores the receiver state previously written in stream.

Reads the FEMComponent class-id in order to allow test consistency.

Parameters
streamInput stream.
modeDetermines amount of info in stream (state, definition,...).
Returns
contextIOResultType.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Implements oofem::Field.

Definition at line 106 of file uniformgridfield.h.

References oofem::CIO_OK.

contextIOResultType oofem::UniformGridField::saveContext ( DataStream stream,
ContextMode  mode 
)
inlineoverridevirtual

Stores receiver state to output stream.

Writes the FEMComponent class-id in order to allow test whether correct data are then restored.

Parameters
streamOutput stream.
modeDetermines amount of info in stream (state, definition,...).
Returns
contextIOResultType.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Implements oofem::Field.

Definition at line 97 of file uniformgridfield.h.

References oofem::CIO_OK.

void oofem::UniformGridField::setGeometry ( const FloatArray lo_,
const FloatArray hi_,
const IntArray div_ 
)

Shorthand for defining geometry, with consistency checks.

Used primarily from python

Definition at line 65 of file uniformgridfield.C.

References div, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), hi, lo, and OOFEM_ERROR.

void oofem::UniformGridField::setValues ( const FloatArray vv)

Accessor for setting nodal values; checks size of the array for correctness.

Definition at line 81 of file uniformgridfield.C.

References div, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), OOFEM_ERROR, and values.

void oofem::UniformGridField::xyz2ijk ( const FloatArray xyz,
IntArray ijk,
FloatArray normXyz 
) const
protected

Member Data Documentation

IntArray oofem::UniformGridField::div
protected

Definition at line 53 of file uniformgridfield.h.

Referenced by nodeValue2d(), nodeValue3d(), setGeometry(), setValues(), and xyz2ijk().

FloatArray oofem::UniformGridField::hi
protected

Definition at line 51 of file uniformgridfield.h.

Referenced by setGeometry(), and xyz2ijk().

FloatArray oofem::UniformGridField::lo
protected

Definition at line 50 of file uniformgridfield.h.

Referenced by setGeometry(), and xyz2ijk().

FloatArray oofem::UniformGridField::values
protected

Definition at line 56 of file uniformgridfield.h.

Referenced by nodeValue2d(), nodeValue3d(), and setValues().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:43 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011