|
OOFEM 3.0
|
#include <levelsetpcs.h>
Public Member Functions | |
| LevelSetPCS (int n, Domain *d) | |
| void | initialize () override |
| void | updatePosition (TimeStep *tStep) override |
| void | updateYourself (TimeStep *tStep) override |
| double | computeCriticalTimeStep (TimeStep *tStep) override |
| void | initializeFrom (InputRecord &ir) override |
| void | giveInputRecord (DynamicInputRecord &input) override |
| void | reinitialization (TimeStep *tStep) |
| void | giveMaterialMixtureAt (FloatArray &answer, FloatArray &position) override |
| void | giveElementMaterialMixture (FloatArray &answer, int ielem) override |
| double | giveNodalScalarRepresentation (int i) override |
| double | giveLevelSetDofManValue (int i) |
| Returns level set value in specific node. | |
| const char * | giveClassName () const override |
| void | saveContext (DataStream &stream, ContextMode mode) override |
| void | restoreContext (DataStream &stream, ContextMode mode) override |
| Public Member Functions inherited from oofem::MaterialInterface | |
| MaterialInterface (int n, Domain *d) | |
| const char * | giveInputRecordName () const override |
| Public Member Functions inherited from oofem::FEMComponent | |
| FEMComponent (int n, Domain *d) | |
| virtual | ~FEMComponent ()=default |
| Virtual destructor. | |
| Domain * | giveDomain () const |
| virtual void | setDomain (Domain *d) |
| int | giveNumber () const |
| void | setNumber (int num) |
| virtual void | updateLocalNumbering (EntityRenumberingFunctor &f) |
| virtual void | initializeFrom (InputRecord &ir, int priority) |
| virtual void | initializeFinish () |
| virtual void | postInitialize () |
| Performs post initialization steps. Called after all components are created and initialized. | |
| virtual int | checkConsistency () |
| virtual void | printOutputAt (FILE *file, TimeStep *tStep) |
| virtual void | printYourself () |
| Prints receiver state on stdout. Useful for debugging. | |
| virtual Interface * | giveInterface (InterfaceType t) |
| std::string | errorInfo (const char *func) const |
| Returns string for prepending output (used by error reporting macros). | |
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) |
Fast marching related services | |
| void | FMMReinitialization (FloatArray &ls) |
Protected Attributes | |
| FloatArray | levelSetValues |
| Array used to store value of level set function for each node. | |
| FloatArray | previousLevelSetValues |
| Polygon | initialRefMatVol |
| bool | initialRefMatFlag |
| int | ci1 =1 |
| Indexes of nodal coordinates used to init levelset using initialRefMatVol. | |
| int | ci2 =2 |
| int | reinit_alg =1 |
| Type of reinitialization algorithm to use. | |
| double | reinit_dt =0.0 |
| Time step used in reinitialization of LS (if apply). | |
| bool | reinit_dt_flag |
| double | reinit_err =1.e-6 |
| Reinitialization error limit. | |
| int | nsd =2 |
| number of spatial dimensions. | |
| long int | levelSetVersion |
| Level set values version. | |
| std ::vector< FloatArray > | elemVof |
| long int | elemVofLevelSetVersion =0 |
| Protected Attributes inherited from oofem::FEMComponent | |
| int | number |
| Component number. | |
| Domain * | domain |
| Link to domain object, useful for communicating with other FEM components. | |
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.
References initialRefMatFlag, levelSetVersion, oofem::MaterialInterface::MaterialInterface(), and reinit_dt_flag.
|
overridevirtual |
Computes critical time step induced by receiver integration algorithm
Implements oofem::MaterialInterface.
Definition at line 245 of file levelsetpcs.C.
|
protected |
Definition at line 533 of file levelsetpcs.C.
References oofem::FEMComponent::domain, oofem::FEMComponent::giveInterface(), oofem::LevelSetPCSElementInterfaceType, PCS_levelSetRedistance, and PCS_levelSetUpdate.
Referenced by pcs_stage1().
|
protected |
Definition at line 548 of file levelsetpcs.C.
References oofem::FEMComponent::domain, oofem::FEMComponent::giveInterface(), oofem::LevelSetPCSElementInterfaceType, PCS_levelSetRedistance, and PCS_levelSetUpdate.
Referenced by pcs_stage1().
|
protected |
Reinitializes the level set representation using fast marching method.
Definition at line 563 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), giveLevelSetDofManValue(), oofem::Element::giveNumberOfDofManagers(), oofem::FloatArray::resize(), and oofem::FastMarchingMethod::solve().
Referenced by reinitialization().
|
inlineoverridevirtual |
Implements oofem::FEMComponent.
Definition at line 171 of file levelsetpcs.h.
|
overridevirtual |
Returns volumetric (or other based measure) of relative material contents in given element.
Implements oofem::MaterialInterface.
Definition at line 285 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FEMComponent::domain, elemVof, elemVofLevelSetVersion, oofem::Element::giveDofManagerNumber(), oofem::FEMComponent::giveInterface(), oofem::Element::giveNumberOfNodes(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, levelSetVersion, oofem::LevelSetPCSElementInterface::LS_PCS_computeVOFFractions(), and oofem::FloatArray::resize().
|
overridevirtual |
Setups the input record string of receiver.
| input | Dynamic input record to be filled by receiver. |
Reimplemented from oofem::FEMComponent.
Definition at line 121 of file levelsetpcs.C.
References OOFEM_ERROR.
|
inline |
Returns level set value in specific node.
Definition at line 168 of file levelsetpcs.h.
References levelSetValues.
Referenced by FMMReinitialization(), oofem::Quad10_2D_SUPG::LS_PCS_computeF(), oofem::Tet1_3D_SUPG::LS_PCS_computeF(), oofem::TR1_2D_SUPG::LS_PCS_computeF(), oofem::TR21_2D_SUPG::LS_PCS_computeF(), oofem::Tet1_3D_SUPG::LS_PCS_computeS(), oofem::TR1_2D_SUPG::LS_PCS_computeS(), and oofem::TR21_2D_SUPG::LS_PCS_computeS().
|
overridevirtual |
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 252 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::Element::computeLocalCoordinates(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), oofem::FEMComponent::giveInterface(), oofem::Element::giveNumberOfNodes(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, N, OOFEM_ERROR, and oofem::FloatArray::resize().
|
inlineoverridevirtual |
Returns scalar value representation of material Interface at given point. For visualization
Implements oofem::MaterialInterface.
Definition at line 165 of file levelsetpcs.h.
References levelSetValues.
|
overridevirtual |
Initializes receiver
Reimplemented from oofem::MaterialInterface.
Definition at line 50 of file levelsetpcs.C.
References ci1, ci2, oofem::FEMComponent::domain, initialRefMatFlag, initialRefMatVol, levelSetValues, levelSetVersion, OOFEM_ERROR, and previousLevelSetValues.
|
overridevirtual |
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. Note that initializeFrom may be called mutiple times.
| ir | Input record to initialize from. |
| priority | Priority of the input record. This is used to determine the order of initialization |
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::FloatArray::at(), ci1, ci2, oofem::FloatArray::giveSize(), initialRefMatFlag, initialRefMatVol, IR_GIVE_OPTIONAL_FIELD, nsd, previousLevelSetValues, reinit_alg, reinit_dt, reinit_dt_flag, reinit_err, and oofem::Vertex::setCoords().
|
protected |
Definition at line 442 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::FEMComponent::giveInterface(), 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 \( d_{\tau} = S(\phi)(1-|\nabla d|) \) to steady state.
Definition at line 346 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::IntArray::at(), oofem::FEMComponent::domain, oofem::Element::giveDofManagerNumber(), 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().
| void oofem::LevelSetPCS::reinitialization | ( | TimeStep * | tStep | ) |
Definition at line 329 of file levelsetpcs.C.
References FMMReinitialization(), levelSetValues, OOFEM_ERROR, redistance(), and reinit_alg.
Referenced by updatePosition().
|
overridevirtual |
Restores the receiver state previously written in stream.
| stream | Input stream. |
| mode | Determines amount of info available in stream (state, definition, ...). |
| throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::FEMComponent.
Definition at line 635 of file levelsetpcs.C.
References oofem::CIO_IOERR, oofem::CIO_OK, elemVofLevelSetVersion, levelSetValues, levelSetVersion, previousLevelSetValues, oofem::DataStream::read(), and THROW_CIOERR.
|
overridevirtual |
Stores receiver state to output stream.
| stream | Output stream. |
| mode | Determines amount of info required in stream (state, definition, ...). |
| throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::FEMComponent.
Definition at line 620 of file levelsetpcs.C.
References oofem::CIO_IOERR, oofem::CIO_OK, levelSetValues, levelSetVersion, THROW_CIOERR, and oofem::DataStream::write().
|
overridevirtual |
Updates the position of interface according to state reached in given solution step.
Implements oofem::MaterialInterface.
Definition at line 129 of file levelsetpcs.C.
References oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FEMComponent::domain, oofem::FloatArray::dotProduct(), oofem::Element::giveDofManagerNumber(), oofem::ConnectivityTable::giveDofManConnectivityArray(), oofem::FEMComponent::giveInterface(), oofem::Element::giveNumberOfNodes(), oofem::TimeStep::givePreviousStep(), oofem::IntArray::giveSize(), oofem::TimeStep::giveTimeIncrement(), oofem::LevelSetPCSElementInterfaceType, levelSetValues, levelSetVersion, oofem::LevelSetPCSElementInterface::LS_PCS_computedN(), oofem::LevelSetPCSElementInterface::LS_PCS_computeVolume(), nsd, PCS_levelSetUpdate, pcs_stage1(), previousLevelSetValues, and reinitialization().
|
inlineoverridevirtual |
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.
References levelSetValues, and previousLevelSetValues.
|
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(), initializeFrom(), and LevelSetPCS().
|
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(), giveLevelSetDofManValue(), giveMaterialMixtureAt(), giveNodalScalarRepresentation(), initialize(), redistance(), reinitialization(), restoreContext(), saveContext(), updatePosition(), and updateYourself().
|
protected |
Level set values version.
Definition at line 135 of file levelsetpcs.h.
Referenced by giveElementMaterialMixture(), initialize(), LevelSetPCS(), 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(), updatePosition(), and updateYourself().
|
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(), LevelSetPCS(), and redistance().
|
protected |
Reinitialization error limit.
Definition at line 131 of file levelsetpcs.h.
Referenced by initializeFrom(), and redistance().