OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Abstract base class representing Level Set representation of material interfaces. More...
#include <levelsetpcs.h>
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... | |
Domain * | giveDomain () 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 Interface * | giveInterface (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 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< FloatArray > | elemVof |
long int | elemVofLevelSetVersion |
Protected Attributes inherited from oofem::FEMComponent | |
int | number |
Component number. More... | |
Domain * | domain |
Link to domain object, useful for communicating with other FEM components. More... | |
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.
|
protected |
Enumerator | |
---|---|
PCS_levelSetUpdate | |
PCS_levelSetRedistance |
Definition at line 119 of file levelsetpcs.h.
|
inline |
Constructor.
Takes two two arguments. Creates a MaterialInterface instance with given number and belonging to given domain.
n | Component number in particular domain. For instance, can represent node number in particular domain. |
d | Domain to which component belongs to. |
Definition at line 149 of file levelsetpcs.h.
|
virtual |
Computes critical time step induced by receiver integration algorithm.
Implements oofem::MaterialInterface.
Definition at line 249 of file levelsetpcs.C.
|
protected |
Definition at line 537 of file levelsetpcs.C.
References oofem::FEMComponent::domain, oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::LevelSetPCSElementInterfaceType, oofem::LevelSetPCSElementInterface::LS_PCS_computeF(), PCS_levelSetRedistance, and PCS_levelSetUpdate.
Referenced by pcs_stage1().
|
protected |
Definition at line 552 of file levelsetpcs.C.
References oofem::FEMComponent::domain, oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::LevelSetPCSElementInterfaceType, oofem::LevelSetPCSElementInterface::LS_PCS_computeS(), PCS_levelSetRedistance, and PCS_levelSetUpdate.
Referenced by pcs_stage1().
|
protected |
Reinitializes the level set representation using fast marching method.
Definition at line 567 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), oofem::Domain::giveElement(), giveLevelSetDofManValue(), oofem::Domain::giveNumberOfDofManagers(), oofem::Element::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::FloatArray::resize(), and oofem::FastMarchingMethod::solve().
Referenced by reinitialization().
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 171 of file levelsetpcs.h.
|
virtual |
Returns volumetric (or other based measure) of relative material contents in given element.
Implements oofem::MaterialInterface.
Definition at line 289 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FEMComponent::domain, elemVof, elemVofLevelSetVersion, oofem::Element::giveDofManagerNumber(), oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveNumberOfNodes(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, levelSetVersion, oofem::LevelSetPCSElementInterface::LS_PCS_computeVOFFractions(), and oofem::FloatArray::resize().
|
virtual |
Setups the input record string of receiver.
input | Dynamic input record to be filled by receiver. |
Reimplemented from oofem::FEMComponent.
Definition at line 125 of file levelsetpcs.C.
References OOFEM_ERROR.
|
inline |
Returns level set value in specific node.
Definition at line 168 of file levelsetpcs.h.
References oofem::FloatArray::at().
Referenced by FMMReinitialization(), oofem::Tet1_3D_SUPG::LS_PCS_computeF(), oofem::TR21_2D_SUPG::LS_PCS_computeF(), oofem::Quad10_2D_SUPG::LS_PCS_computeF(), oofem::TR1_2D_SUPG::LS_PCS_computeF(), oofem::Tet1_3D_SUPG::LS_PCS_computeS(), oofem::TR21_2D_SUPG::LS_PCS_computeS(), and oofem::TR1_2D_SUPG::LS_PCS_computeS().
|
virtual |
Returns relative material contents at given point.
Usually only one material is presented in given point, but some smoothing may be applied close to material interface to make transition smooth
Implements oofem::MaterialInterface.
Definition at line 256 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::Element::computeLocalCoordinates(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), oofem::SpatialLocalizer::giveElementContainingPoint(), oofem::FEMComponent::giveInterface(), oofem::Element::giveNumberOfNodes(), oofem::Domain::giveSpatialLocalizer(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, N, OOFEM_ERROR, and oofem::FloatArray::resize().
|
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().
|
virtual |
Initializes receiver.
Reimplemented from oofem::MaterialInterface.
Definition at line 50 of file levelsetpcs.C.
References oofem::FloatArray::at(), ci1, ci2, oofem::FEMComponent::domain, oofem::Node::giveCoordinate(), oofem::Domain::giveNode(), oofem::Domain::giveNumberOfDofManagers(), oofem::FloatArray::giveSize(), initialRefMatFlag, initialRefMatVol, levelSetValues, levelSetVersion, OOFEM_ERROR, oofem::Polygon::pointDistance(), previousLevelSetValues, and oofem::FloatArray::resize().
|
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.
ir | Input record to initialize from. |
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().
|
protected |
Definition at line 446 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::FloatArray::beTProductOf(), oofem::FloatArray::computeNorm(), oofem::FEMComponent::domain, oofem::FloatArray::dotProduct(), evalElemFContribution(), evalElemfContribution(), oofem::Element::giveDofManagerNumber(), oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::Domain::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveNumberOfNodes(), oofem::LevelSetPCSElementInterfaceType, oofem::LevelSetPCSElementInterface::LS_PCS_computedN(), oofem::LevelSetPCSElementInterface::LS_PCS_computeVolume(), oofem::macbra(), oofem::max(), oofem::negbra(), nsd, OOFEM_ERROR, OOFEM_LOG_INFO, oofem::FloatArray::resize(), and oofem::FloatArray::zero().
Referenced by redistance(), and updatePosition().
|
protected |
Reinitializes the level set representation by solving to steady state.
Definition at line 350 of file levelsetpcs.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), oofem::Domain::giveElement(), oofem::Domain::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveNumberOfNodes(), oofem::TimeStep::giveTimeIncrement(), levelSetValues, oofem::max(), OOFEM_LOG_INFO, PCS_levelSetRedistance, pcs_stage1(), reinit_dt, reinit_dt_flag, and reinit_err.
Referenced by reinitialization().
|
virtual |
Definition at line 333 of file levelsetpcs.C.
References FMMReinitialization(), levelSetValues, OOFEM_ERROR, redistance(), and reinit_alg.
Referenced by updatePosition().
|
virtual |
Restores the receiver state previously written in stream.
stream | Input stream. |
mode | Determines amount of info available in stream (state, definition, ...). |
obj | Special parameter for sending extra information. |
throws | an 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.
|
virtual |
Stores receiver state to output stream.
stream | Output stream. |
mode | Determines amount of info required in stream (state, definition, ...). |
obj | Special parameter, used only to send particular integration point to material class version of this method. |
throws | an 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 |
Updates the position of interface according to state reached in given solution step.
Implements oofem::MaterialInterface.
Definition at line 133 of file levelsetpcs.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::FEMComponent::domain, oofem::FloatArray::dotProduct(), oofem::Domain::giveConnectivityTable(), oofem::Domain::giveDofManager(), oofem::Element::giveDofManagerNumber(), oofem::ConnectivityTable::giveDofManConnectivityArray(), oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::Domain::giveNumberOfDofManagers(), oofem::Element::giveNumberOfNodes(), oofem::TimeStep::givePreviousStep(), oofem::IntArray::giveSize(), oofem::TimeStep::giveTimeIncrement(), oofem::DofManager::giveUnknownVector(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, levelSetVersion, oofem::LevelSetPCSElementInterface::LS_PCS_computedN(), oofem::LevelSetPCSElementInterface::LS_PCS_computeVolume(), nsd, PCS_levelSetUpdate, pcs_stage1(), previousLevelSetValues, and reinitialization().
|
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.
|
protected |
Indexes of nodal coordinates used to init levelset using initialRefMatVol.
Definition at line 123 of file levelsetpcs.h.
Referenced by initialize(), and initializeFrom().
|
protected |
Definition at line 123 of file levelsetpcs.h.
Referenced by initialize(), and initializeFrom().
|
protected |
Definition at line 138 of file levelsetpcs.h.
Referenced by giveElementMaterialMixture().
|
protected |
Definition at line 139 of file levelsetpcs.h.
Referenced by giveElementMaterialMixture(), and restoreContext().
|
protected |
Definition at line 121 of file levelsetpcs.h.
Referenced by initialize(), and initializeFrom().
|
protected |
Definition at line 120 of file levelsetpcs.h.
Referenced by initialize(), and initializeFrom().
|
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().
|
protected |
Level set values version.
Definition at line 135 of file levelsetpcs.h.
Referenced by giveElementMaterialMixture(), initialize(), restoreContext(), saveContext(), and updatePosition().
|
protected |
number of spatial dimensions.
Definition at line 133 of file levelsetpcs.h.
Referenced by initializeFrom(), pcs_stage1(), and updatePosition().
|
protected |
Definition at line 118 of file levelsetpcs.h.
Referenced by initialize(), initializeFrom(), restoreContext(), and updatePosition().
|
protected |
Type of reinitialization algorithm to use.
Definition at line 126 of file levelsetpcs.h.
Referenced by initializeFrom(), and reinitialization().
|
protected |
Time step used in reinitialization of LS (if apply).
Definition at line 128 of file levelsetpcs.h.
Referenced by initializeFrom(), and redistance().
|
protected |
Definition at line 129 of file levelsetpcs.h.
Referenced by initializeFrom(), and redistance().
|
protected |
Reinitialization error limit.
Definition at line 131 of file levelsetpcs.h.
Referenced by initializeFrom(), and redistance().