OOFEM 3.0
Loading...
Searching...
No Matches
levelsetpcs.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef levelsetpcs_h
36#define levelsetpcs_h
37
38#include "materialinterface.h"
39#include "geotoolbox.h"
40#include "interface.h"
41
42#include <vector>
43
45
46#define _IFT_LevelSetPCS_levelSetValues "levelset"
47#define _IFT_LevelSetPCS_refmatpoly_x "refmatpolyx"
48#define _IFT_LevelSetPCS_refmatpoly_y "refmatpolyy"
49#define _IFT_LevelSetPCS_reinit_dt "rdt"
50#define _IFT_LevelSetPCS_reinit_err "rerr"
51#define _IFT_LevelSetPCS_reinit_alg "lsra"
52#define _IFT_LevelSetPCS_nsd "nsd"
53#define _IFT_LevelSetPCS_ci1 "ci1"
54#define _IFT_LevelSetPCS_ci2 "ci2"
56
57
58namespace oofem {
59#define LevelSetPCS_CACHE_ELEMENT_VOF 0
60
61class LevelSetPCS;
62
69{
70public:
72
74
75
81 virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep) = 0;
82
86 virtual void LS_PCS_computedN(FloatMatrix &answer) = 0;
88 virtual double LS_PCS_computeVolume() = 0;
89
96 virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep) = 0;
97
102 virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi) = 0;
104};
105
115{
116protected:
123 int ci1=1, ci2=2;
124
128 double reinit_dt=0.0;
131 double reinit_err=1.e-6;
133 int nsd=2;
136
137#ifdef LevelSetPCS_CACHE_ELEMENT_VOF
138 std :: vector< FloatArray >elemVof;
140#endif
141
142public:
150 initialRefMatFlag = false;
151 reinit_dt_flag = false;
152 levelSetVersion = 0;
153 }
154
155 void initialize() override;
156 void updatePosition(TimeStep *tStep) override;
158 double computeCriticalTimeStep(TimeStep *tStep) override;
159 void initializeFrom(InputRecord &ir) override;
160 void giveInputRecord(DynamicInputRecord &input) override;
161 void reinitialization(TimeStep *tStep);
162
163 void giveMaterialMixtureAt(FloatArray &answer, FloatArray &position) override;
164 void giveElementMaterialMixture(FloatArray &answer, int ielem) override;
165 double giveNodalScalarRepresentation(int i) override { return levelSetValues.at(i); }
166
168 double giveLevelSetDofManValue(int i) { return levelSetValues.at(i); }
169
170 // identification
171 const char *giveClassName() const override { return "LevelSetPCS"; }
172
173 void saveContext(DataStream &stream, ContextMode mode) override;
174 void restoreContext(DataStream &stream, ContextMode mode) override;
175
176protected:
177 void pcs_stage1(FloatArray &ls, FloatArray &fs, FloatArray &w, TimeStep *tStep, PCSEqType t);
178 double evalElemFContribution(PCSEqType t, int ie, TimeStep *tStep);
179 double evalElemfContribution(PCSEqType t, int ie, TimeStep *tStep);
180
185 void redistance(TimeStep *tStep);
186
189
192};
193} // end namespace oofem
194#endif // levelsetpcs_h
Interface()
Constructor.
Definition interface.h:86
virtual void LS_PCS_computedN(FloatMatrix &answer)=0
virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi)=0
virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep)=0
virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep)=0
virtual double LS_PCS_computeVolume()=0
Returns receiver's volume.
void initializeFrom(InputRecord &ir) override
Definition levelsetpcs.C:75
void reinitialization(TimeStep *tStep)
std ::vector< FloatArray > elemVof
void restoreContext(DataStream &stream, ContextMode mode) override
int reinit_alg
Type of reinitialization algorithm to use.
double computeCriticalTimeStep(TimeStep *tStep) override
void updatePosition(TimeStep *tStep) override
int ci1
Indexes of nodal coordinates used to init levelset using initialRefMatVol.
double reinit_err
Reinitialization error limit.
FloatArray previousLevelSetValues
void saveContext(DataStream &stream, ContextMode mode) override
void giveMaterialMixtureAt(FloatArray &answer, FloatArray &position) override
long int elemVofLevelSetVersion
double evalElemFContribution(PCSEqType t, int ie, TimeStep *tStep)
void pcs_stage1(FloatArray &ls, FloatArray &fs, FloatArray &w, TimeStep *tStep, PCSEqType t)
void FMMReinitialization(FloatArray &ls)
double giveNodalScalarRepresentation(int i) override
const char * giveClassName() const override
double evalElemfContribution(PCSEqType t, int ie, TimeStep *tStep)
long int levelSetVersion
Level set values version.
int nsd
number of spatial dimensions.
void giveElementMaterialMixture(FloatArray &answer, int ielem) override
void giveInputRecord(DynamicInputRecord &input) override
FloatArray levelSetValues
Array used to store value of level set function for each node.
void initialize() override
Definition levelsetpcs.C:50
LevelSetPCS(int n, Domain *d)
void redistance(TimeStep *tStep)
double reinit_dt
Time step used in reinitialization of LS (if apply).
double giveLevelSetDofManValue(int i)
Returns level set value in specific node.
void updateYourself(TimeStep *tStep) override
MaterialInterface(int n, Domain *d)
long ContextMode
Definition contextmode.h:43

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