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

Abstract base class representing Level Set representation of material interfaces. More...

#include <levelsetpcs.h>

+ Inheritance diagram for oofem::LevelSetPCS:
+ Collaboration diagram for oofem::LevelSetPCS:

Public Member Functions

 LevelSetPCS (int n, Domain *d)
 Constructor. More...
 
virtual void initialize ()
 Initializes receiver. More...
 
virtual void updatePosition (TimeStep *tStep)
 Updates the position of interface according to state reached in given solution step. More...
 
virtual void updateYourself (TimeStep *tStep)
 Updates element state after equilibrium in time step has been reached. More...
 
virtual double computeCriticalTimeStep (TimeStep *tStep)
 Computes critical time step induced by receiver integration algorithm. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
virtual void giveInputRecord (DynamicInputRecord &input)
 Setups the input record string of receiver. More...
 
virtual void reinitialization (TimeStep *tStep)
 
virtual void giveMaterialMixtureAt (FloatArray &answer, FloatArray &position)
 Returns relative material contents at given point. More...
 
virtual void giveElementMaterialMixture (FloatArray &answer, int ielem)
 Returns volumetric (or other based measure) of relative material contents in given element. More...
 
virtual double giveNodalScalarRepresentation (int i)
 Returns scalar value representation of material Interface at given point. More...
 
double giveLevelSetDofManValue (int i)
 Returns level set value in specific node. More...
 
virtual const char * giveClassName () const
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Stores receiver state to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Restores the receiver state previously written in stream. More...
 
- Public Member Functions inherited from oofem::MaterialInterface
 MaterialInterface (int n, Domain *d)
 Constructor. More...
 
virtual const char * giveInputRecordName () const
 
- Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
 Regular constructor, creates component with given number and belonging to given domain. More...
 
virtual ~FEMComponent ()
 Virtual destructor. More...
 
DomaingiveDomain () const
 
virtual void setDomain (Domain *d)
 Sets associated Domain. More...
 
int giveNumber () const
 
void setNumber (int num)
 Sets number of receiver. More...
 
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
 Local renumbering support. More...
 
virtual int checkConsistency ()
 Allows programmer to test some internal data, before computation begins. More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to stream, for given time step. More...
 
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging. More...
 
virtual InterfacegiveInterface (InterfaceType t)
 Interface requesting service. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Types

enum  PCSEqType { PCS_levelSetUpdate, PCS_levelSetRedistance }
 

Protected Member Functions

void pcs_stage1 (FloatArray &ls, FloatArray &fs, FloatArray &w, TimeStep *tStep, PCSEqType t)
 
double evalElemFContribution (PCSEqType t, int ie, TimeStep *tStep)
 
double evalElemfContribution (PCSEqType t, int ie, TimeStep *tStep)
 
void redistance (TimeStep *tStep)
 Reinitializes the level set representation by solving $ d_{\tau} = S(\phi)(1-|\nabla d|) $ to steady state. More...
 
Fast marching related services
void FMMReinitialization (FloatArray &ls)
 Reinitializes the level set representation using fast marching method. More...
 

Protected Attributes

FloatArray levelSetValues
 Array used to store value of level set function for each node. More...
 
FloatArray previousLevelSetValues
 
Polygon initialRefMatVol
 
bool initialRefMatFlag
 
int ci1
 Indexes of nodal coordinates used to init levelset using initialRefMatVol. More...
 
int ci2
 
int reinit_alg
 Type of reinitialization algorithm to use. More...
 
double reinit_dt
 Time step used in reinitialization of LS (if apply). More...
 
bool reinit_dt_flag
 
double reinit_err
 Reinitialization error limit. More...
 
int nsd
 number of spatial dimensions. More...
 
long int levelSetVersion
 Level set values version. More...
 
std::vector< FloatArrayelemVof
 
long int elemVofLevelSetVersion
 
- Protected Attributes inherited from oofem::FEMComponent
int number
 Component number. More...
 
Domaindomain
 Link to domain object, useful for communicating with other FEM components. More...
 

Detailed Description

Abstract base class representing Level Set representation of material interfaces.

The solution algorithm is based on positive coefficient scheme. This algorithm is limited to d-dimensional simplexes with linear approximation. Its typical use to model moving interface (such as free surface) in a fixed-grid methods (as typically used in CFD). The basic tasks are representation of interface and its updating.

Definition at line 114 of file levelsetpcs.h.

Member Enumeration Documentation

Enumerator
PCS_levelSetUpdate 
PCS_levelSetRedistance 

Definition at line 119 of file levelsetpcs.h.

Constructor & Destructor Documentation

oofem::LevelSetPCS::LevelSetPCS ( int  n,
Domain d 
)
inline

Constructor.

Takes two two arguments. Creates a MaterialInterface instance with given number and belonging to given domain.

Parameters
nComponent number in particular domain. For instance, can represent node number in particular domain.
dDomain to which component belongs to.

Definition at line 149 of file levelsetpcs.h.

Member Function Documentation

double oofem::LevelSetPCS::computeCriticalTimeStep ( TimeStep tStep)
virtual

Computes critical time step induced by receiver integration algorithm.

Implements oofem::MaterialInterface.

Definition at line 249 of file levelsetpcs.C.

virtual const char* oofem::LevelSetPCS::giveClassName ( ) const
inlinevirtual
Returns
Class name of the receiver.

Implements oofem::FEMComponent.

Definition at line 171 of file levelsetpcs.h.

void oofem::LevelSetPCS::giveInputRecord ( DynamicInputRecord input)
virtual

Setups the input record string of receiver.

Parameters
inputDynamic input record to be filled by receiver.

Reimplemented from oofem::FEMComponent.

Definition at line 125 of file levelsetpcs.C.

References OOFEM_ERROR.

void oofem::LevelSetPCS::giveMaterialMixtureAt ( FloatArray answer,
FloatArray position 
)
virtual
virtual double oofem::LevelSetPCS::giveNodalScalarRepresentation ( int  )
inlinevirtual

Returns scalar value representation of material Interface at given point.

For visualization

Implements oofem::MaterialInterface.

Definition at line 165 of file levelsetpcs.h.

References oofem::FloatArray::at().

IRResultType oofem::LevelSetPCS::initializeFrom ( InputRecord ir)
virtual

Initializes receiver according to object description stored in input record.

This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType

Reimplemented from oofem::FEMComponent.

Definition at line 75 of file levelsetpcs.C.

References _IFT_LevelSetPCS_ci1, _IFT_LevelSetPCS_ci2, _IFT_LevelSetPCS_levelSetValues, _IFT_LevelSetPCS_nsd, _IFT_LevelSetPCS_refmatpoly_x, _IFT_LevelSetPCS_refmatpoly_y, _IFT_LevelSetPCS_reinit_alg, _IFT_LevelSetPCS_reinit_dt, _IFT_LevelSetPCS_reinit_err, oofem::Polygon::addVertex(), oofem::FloatArray::at(), ci1, ci2, oofem::FloatArray::giveSize(), initialRefMatFlag, initialRefMatVol, IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_OK, nsd, previousLevelSetValues, reinit_alg, reinit_dt, reinit_dt_flag, reinit_err, and oofem::Vertex::setCoords().

void oofem::LevelSetPCS::reinitialization ( TimeStep tStep)
virtual

Definition at line 333 of file levelsetpcs.C.

References FMMReinitialization(), levelSetValues, OOFEM_ERROR, redistance(), and reinit_alg.

Referenced by updatePosition().

contextIOResultType oofem::LevelSetPCS::restoreContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
objSpecial parameter for sending extra information.
Returns
contextIOResultType.
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Definition at line 641 of file levelsetpcs.C.

References oofem::CIO_IOERR, oofem::CIO_OK, elemVofLevelSetVersion, levelSetValues, levelSetVersion, previousLevelSetValues, oofem::DataStream::read(), oofem::FloatArray::restoreYourself(), and THROW_CIOERR.

contextIOResultType oofem::LevelSetPCS::saveContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
objSpecial parameter, used only to send particular integration point to material class version of this method.
Returns
contextIOResultType.
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Definition at line 624 of file levelsetpcs.C.

References oofem::CIO_IOERR, oofem::CIO_OK, levelSetValues, levelSetVersion, oofem::FloatArray::storeYourself(), THROW_CIOERR, and oofem::DataStream::write().

virtual void oofem::LevelSetPCS::updateYourself ( TimeStep tStep)
inlinevirtual

Updates element state after equilibrium in time step has been reached.

All temporary history variables, which now describe equilibrium state should be copied into equilibrium ones. The existing internal state is used for update.

Implements oofem::MaterialInterface.

Definition at line 157 of file levelsetpcs.h.

Member Data Documentation

int oofem::LevelSetPCS::ci1
protected

Indexes of nodal coordinates used to init levelset using initialRefMatVol.

Definition at line 123 of file levelsetpcs.h.

Referenced by initialize(), and initializeFrom().

int oofem::LevelSetPCS::ci2
protected

Definition at line 123 of file levelsetpcs.h.

Referenced by initialize(), and initializeFrom().

std :: vector< FloatArray > oofem::LevelSetPCS::elemVof
protected

Definition at line 138 of file levelsetpcs.h.

Referenced by giveElementMaterialMixture().

long int oofem::LevelSetPCS::elemVofLevelSetVersion
protected

Definition at line 139 of file levelsetpcs.h.

Referenced by giveElementMaterialMixture(), and restoreContext().

bool oofem::LevelSetPCS::initialRefMatFlag
protected

Definition at line 121 of file levelsetpcs.h.

Referenced by initialize(), and initializeFrom().

Polygon oofem::LevelSetPCS::initialRefMatVol
protected

Definition at line 120 of file levelsetpcs.h.

Referenced by initialize(), and initializeFrom().

FloatArray oofem::LevelSetPCS::levelSetValues
protected

Array used to store value of level set function for each node.

Definition at line 118 of file levelsetpcs.h.

Referenced by giveElementMaterialMixture(), giveMaterialMixtureAt(), initialize(), redistance(), reinitialization(), restoreContext(), saveContext(), and updatePosition().

long int oofem::LevelSetPCS::levelSetVersion
protected

Level set values version.

Definition at line 135 of file levelsetpcs.h.

Referenced by giveElementMaterialMixture(), initialize(), restoreContext(), saveContext(), and updatePosition().

int oofem::LevelSetPCS::nsd
protected

number of spatial dimensions.

Definition at line 133 of file levelsetpcs.h.

Referenced by initializeFrom(), pcs_stage1(), and updatePosition().

FloatArray oofem::LevelSetPCS::previousLevelSetValues
protected

Definition at line 118 of file levelsetpcs.h.

Referenced by initialize(), initializeFrom(), restoreContext(), and updatePosition().

int oofem::LevelSetPCS::reinit_alg
protected

Type of reinitialization algorithm to use.

Definition at line 126 of file levelsetpcs.h.

Referenced by initializeFrom(), and reinitialization().

double oofem::LevelSetPCS::reinit_dt
protected

Time step used in reinitialization of LS (if apply).

Definition at line 128 of file levelsetpcs.h.

Referenced by initializeFrom(), and redistance().

bool oofem::LevelSetPCS::reinit_dt_flag
protected

Definition at line 129 of file levelsetpcs.h.

Referenced by initializeFrom(), and redistance().

double oofem::LevelSetPCS::reinit_err
protected

Reinitialization error limit.

Definition at line 131 of file levelsetpcs.h.

Referenced by initializeFrom(), and redistance().


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:37 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011