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

#include <dofmanvalfield.h>

Inheritance diagram for oofem::DofManValueField:
Collaboration diagram for oofem::DofManValueField:

Public Member Functions

 DofManValueField (FieldType ft, Domain *d)
 DofManValueField (FieldType ft, int nNodes, int nElements, const std::string engngModel, const std::string domainDofsDefaults)
virtual ~DofManValueField ()
void addNode (int i, const FloatArray &coords)
void addElement (int i, const char *name, const IntArray &nodes)
int evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep) override
int evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep) override
void setDofManValue (int dofMan, FloatArray value)
const FloatArraygetNodeCoordinates (int i)
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 Attributes

Domaindomain
 Associated domain (need its elements to interpolate).
std::vector< FloatArraydmanvallist
 Array of dofman values.
std::unique_ptr< EngngModeleModel
 Pointer to engineering model.
std::unique_ptr< CrossSectioncrossSect
 Pointer to single cross-section;.
Protected Attributes inherited from oofem::Field
FieldType type
IntArray regionSets

Detailed Description

Class representing field defined by nodal values associated to given domain. Field represent the spatial distribution of certain variable. The implementation allows to set individual dofMan values; However, in the current implementation does not allow to specify values for different time steps. It is also possible to create a separate, virtual domain by adding particular nodes and elements with nodal values.

Definition at line 63 of file dofmanvalfield.h.

Constructor & Destructor Documentation

◆ DofManValueField() [1/2]

oofem::DofManValueField::DofManValueField ( FieldType ft,
Domain * d )

Constructor. Creates an empty field of given type associated to given domain.

Definition at line 52 of file dofmanvalfield.C.

References dmanvallist, domain, oofem::Field::Field(), and oofem::Domain::giveNumberOfDofManagers().

◆ DofManValueField() [2/2]

oofem::DofManValueField::DofManValueField ( FieldType ft,
int nNodes,
int nElements,
const std::string engngModel = "transienttransport",
const std::string domainDofsDefaults = "heattransfer" )

Constructor. Creates a virtual empty domain which needs to be populated by nodes, elements and nodal values.

Definition at line 59 of file dofmanvalfield.C.

References oofem::classFactory, dmanvallist, domain, eModel, oofem::Field::Field(), and OOFEM_ERROR.

◆ ~DofManValueField()

virtual oofem::DofManValueField::~DofManValueField ( )
inlinevirtual

Definition at line 88 of file dofmanvalfield.h.

Member Function Documentation

◆ addElement()

void oofem::DofManValueField::addElement ( int i,
const char * name,
const IntArray & nodes )

Add element to the domain

Definition at line 97 of file dofmanvalfield.C.

References oofem::classFactory, domain, and OOFEM_ERROR.

◆ addNode()

void oofem::DofManValueField::addNode ( int i,
const FloatArray & coords )

Add node to the domain

Definition at line 85 of file dofmanvalfield.C.

References oofem::classFactory, domain, eModel, and OOFEM_ERROR.

◆ evaluateAt() [1/2]

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

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 111 of file dofmanvalfield.C.

References oofem::FloatArray::add(), oofem::FloatArray::at(), domain, oofem::FEInterpolation::evalN(), oofem::Element::giveDofManagerNumber(), oofem::Element::giveInterpolation(), oofem::FloatArray::giveSize(), oofem::FEInterpolation::global2local(), OOFEM_ERROR, and oofem::FloatArray::resize().

◆ evaluateAt() [2/2]

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

Evaluates the field at given DofManager. This potentially can be resolved quickly, as receiver data may be described using values at dof managers. 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 dof manager.
modeMode of value (total, velocity,...).
tStepTimInternalStateType valID, IntArray regions, TimeStep *tStepe step to evaluate for.
Returns
Zero if ok, nonzero Error code (0-ok, 1-failed)

Implements oofem::Field.

Definition at line 145 of file dofmanvalfield.C.

References dmanvallist, and oofem::FEMComponent::giveNumber().

◆ getNodeCoordinates()

const FloatArray & oofem::DofManValueField::getNodeCoordinates ( int i)

Obtain coordinates of a node

Definition at line 157 of file dofmanvalfield.C.

References domain.

◆ giveClassName()

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

Implements oofem::Field.

Definition at line 131 of file dofmanvalfield.h.

◆ restoreContext()

void oofem::DofManValueField::restoreContext ( DataStream & stream)
overridevirtual

Restores the receiver state previously written in stream.

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

Implements oofem::Field.

Definition at line 168 of file dofmanvalfield.C.

◆ saveContext()

void oofem::DofManValueField::saveContext ( DataStream & stream)
overridevirtual

Stores receiver state to output stream.

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

Implements oofem::Field.

Definition at line 164 of file dofmanvalfield.C.

◆ setDofManValue()

void oofem::DofManValueField::setDofManValue ( int dofMan,
FloatArray value )

Sets the value associated to given dofManager

Definition at line 152 of file dofmanvalfield.C.

References dmanvallist.

Member Data Documentation

◆ crossSect

std::unique_ptr< CrossSection > oofem::DofManValueField::crossSect
protected

Pointer to single cross-section;.

Definition at line 73 of file dofmanvalfield.h.

◆ dmanvallist

std::vector< FloatArray > oofem::DofManValueField::dmanvallist
protected

Array of dofman values.

Definition at line 69 of file dofmanvalfield.h.

Referenced by DofManValueField(), DofManValueField(), evaluateAt(), and setDofManValue().

◆ domain

Domain* oofem::DofManValueField::domain
protected

Associated domain (need its elements to interpolate).

Definition at line 67 of file dofmanvalfield.h.

Referenced by addElement(), addNode(), DofManValueField(), DofManValueField(), evaluateAt(), and getNodeCoordinates().

◆ eModel

std::unique_ptr< EngngModel > oofem::DofManValueField::eModel
protected

Pointer to engineering model.

Definition at line 71 of file dofmanvalfield.h.

Referenced by addNode(), and DofManValueField().


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