OOFEM 3.0
Loading...
Searching...
No Matches
oofem::Field Class Referenceabstract

#include <field.h>

Inheritance diagram for oofem::Field:
Collaboration diagram for oofem::Field:

Public Member Functions

 Field (FieldType b=FieldType::FT_Unknown)
virtual ~Field ()
virtual int evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep)=0
virtual int evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep)=0
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.
virtual void saveContext (DataStream &stream)=0
virtual void restoreContext (DataStream &stream)=0
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).
virtual const char * giveClassName () const =0
virtual void initializeFrom (InputRecord &ir)

Protected Attributes

FieldType type
IntArray regionSets

Detailed Description

Abstract class representing field. Field represent the spatial distribution of certain variable. Field is able to evaluate its value at any point of interest. The field is usually associated to specific domain.

Definition at line 85 of file field.h.

Constructor & Destructor Documentation

◆ Field()

◆ ~Field()

virtual oofem::Field::~Field ( )
inlinevirtual

Definition at line 96 of file field.h.

Member Function Documentation

◆ errorInfo()

std::string oofem::Field::errorInfo ( const char * func) const

Returns string for prepending output (used by error reporting macros).

Definition at line 66 of file field.C.

References giveClassName().

Referenced by restoreContext().

◆ evaluateAt() [1/3]

virtual int oofem::Field::evaluateAt ( FloatArray & answer,
const FloatArray & coords,
ValueModeType mode,
TimeStep * tStep )
pure virtual

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.

Implemented in oofem::DofManValueField, oofem::ExpressionField, oofem::InternalVariableField, oofem::MaskedPrimaryField, oofem::PrimaryField, oofem::PythonField, oofem::SmoothedNodalInternalVariableField, oofem::UniformGridField, oofem::UnstructuredGridField, and oofem::VoxelVOFField.

◆ evaluateAt() [2/3]

virtual int oofem::Field::evaluateAt ( FloatArray & answer,
DofManager * dman,
ValueModeType mode,
TimeStep * tStep )
pure virtual

Evaluates the field at given DofManager. This potentially can be resolved quickly, as receiver data may be described using values at dofManagers. Here an additional issue exists: one needs to make sure, that passed dman is from the same domain, so that its number can be used to perform suggested quick evaluation.

If this is not the case (the field is described differently), the response can be evaluated using dofman coordinates in a standard way.

Parameters
[out]answerEvaluated field for dman.
dmanReference to dofManager.
modeMode of value (total, velocity,...).
tStepTime step to evaluate for.
Returns
Zero if ok, nonzero Error code (0-ok, 1-failed)

Implemented in oofem::DofManValueField, oofem::ExpressionField, oofem::InternalVariableField, oofem::MaskedPrimaryField, oofem::PrimaryField, oofem::PythonField, oofem::SmoothedNodalInternalVariableField, oofem::UniformGridField, oofem::UnstructuredGridField, and oofem::VoxelVOFField.

◆ evaluateAt() [3/3]

virtual int oofem::Field::evaluateAt ( FloatArray & answer,
Element * elem,
ValueModeType mode,
TimeStep * tStep )
inlinevirtual

Reimplemented in oofem::VoxelVOFField.

Definition at line 124 of file field.h.

◆ giveClassName()

◆ giveType()

FieldType oofem::Field::giveType ( )
inline

Returns the type of receiver.

Definition at line 128 of file field.h.

References type.

◆ hasElementInSets()

bool oofem::Field::hasElementInSets ( int nElem,
Domain * d )
virtual

Searches if element number exist in IntArray regionSets for given domain.

Definition at line 49 of file field.C.

References oofem::Domain::giveSet(), oofem::Set::hasElement(), and regionSets.

◆ initializeFrom()

virtual void oofem::Field::initializeFrom ( InputRecord & ir)
inlinevirtual

Reimplemented in oofem::ExpressionField, and oofem::VoxelVOFField.

Definition at line 159 of file field.h.

◆ restoreContext()

virtual void oofem::Field::restoreContext ( DataStream & stream)
pure virtual

Restores the receiver state previously written in stream.

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

Implemented in oofem::DofManValueField, oofem::ExpressionField, oofem::InternalVariableField, oofem::MaskedPrimaryField, oofem::PrimaryField, oofem::PythonField, oofem::SmoothedNodalInternalVariableField, oofem::UniformGridField, oofem::UnstructuredGridField, and oofem::VoxelVOFField.

References errorInfo().

◆ saveContext()

virtual void oofem::Field::saveContext ( DataStream & stream)
pure virtual

◆ setSetsNumbers()

void oofem::Field::setSetsNumbers ( const IntArray sets)

Defines a list of sets used to impose a field on specific elements.

Definition at line 42 of file field.C.

References regionSets.

◆ setType()

void oofem::Field::setType ( FieldType b)
inline

Sets the type of receiver.

Definition at line 131 of file field.h.

References type.

Member Data Documentation

◆ regionSets

IntArray oofem::Field::regionSets
protected

Definition at line 89 of file field.h.

Referenced by Field(), hasElementInSets(), and setSetsNumbers().

◆ type

FieldType oofem::Field::type
protected

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

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