OOFEM 3.0
Loading...
Searching...
No Matches
additivemanufacturingproblem.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 AdditiveManufacturingProblem_h2
36#define AdditiveManufacturingProblem_h2
37
38#include "Printer.h"
39
40#include "engngm.h"
41#include "inputrecord.h"
42#include "floatarray.h"
43#include "voxelvoffield.h"
44
46
47#define _IFT_AdditiveManufacturingProblem_Name "AdditiveManufacturingProblem"
48#define _IFT_AdditiveManufacturingProblem_gcode "gcode"
49#define _IFT_AdditiveManufacturingProblem_stepx "stepx"
50#define _IFT_AdditiveManufacturingProblem_stepy "stepy"
51#define _IFT_AdditiveManufacturingProblem_stepz "stepz"
52#define _IFT_AdditiveManufacturingProblem_minvof "minvof"
53#define _IFT_AdditiveManufacturingProblem_skipsm "skipsm"
54
55#define _IFT_AdditiveManufacturingProblem_deltat "deltat"
56#define _IFT_AdditiveManufacturingProblem_dtf "dtf"
57#define _IFT_AdditiveManufacturingProblem_timeDefinedByProb "timedefinedbyprob"
58#define _IFT_AdditiveManufacturingProblem_stepmultiplier "stepmultiplier"
59// #define _IFT_AdditiveManufacturingProblem_timeLag "timelag"
60#define _IFT_AdditiveManufacturingProblem_prescribedtimes "prescribedtimes"
61#define _IFT_AdditiveManufacturingProblem_prob1 "prob1"
62#define _IFT_AdditiveManufacturingProblem_prob2 "prob2"
63#define _IFT_AdditiveManufacturingProblem_prob3 "prob3"
64#define _IFT_AdditiveManufacturingProblem_coupling "coupling"
65#define _IFT_AdditiveManufacturingProblem_adaptiveStepLength "adaptivesteplength"
66#define _IFT_AdditiveManufacturingProblem_minsteplength "minsteplength"
67#define _IFT_AdditiveManufacturingProblem_maxsteplength "maxsteplength"
68#define _IFT_AdditiveManufacturingProblem_reqiterations "reqiterations"
69#define _IFT_AdditiveManufacturingProblem_endoftimeofinterest "endoftimeofinterest"
70#define _IFT_AdditiveManufacturingProblem_adaptivestepsince "adaptivestepsince"
71#define _IFT_AdditiveManufacturingProblem_maxprintercommands "maxcommands"
72
73#define _IFT_AdditiveManufacturingProblem_Printer_layerheight "layerheight"
74#define _IFT_AdditiveManufacturingProblem_Printer_extrusionwidth "extrusionwidth"
75#define _IFT_AdditiveManufacturingProblem_Printer_chambertemperature "chambertemperature"
76#define _IFT_AdditiveManufacturingProblem_Printer_depositiontemperature "depositiontemperature"
77#define _IFT_AdditiveManufacturingProblem_Printer_heatbedtemperature "heatbedtemperature"
78#define _IFT_AdditiveManufacturingProblem_Printer_heattransferfilmcoefficient "heattransferfilmcoefficient"
79#define _IFT_AdditiveManufacturingProblem_Printer_depositedmaterialheatpower "depositedmaterialheatpower"
81
82namespace oofem {
83class Function;
84
110{
111protected:
113 double stepX;
114 double stepY;
115 double stepZ;
116
117 double minVOF;
118
119 bool skipSM = true;
121
123 std ::vector<std ::unique_ptr<EngngModel> > emodelList;
124 double deltaT;
125 std ::vector<std ::string> inputStreamNames;
133
139 // double timeLag;
140
143
146
163
166
167 // G-code filepath
168 std::string gCodeFilePath = "";
169
170 // max number of printer commands to be processed (for debugging purposes)
171 int maxPrinterCommands = -1; // negative value means no limit
172
173 // voxel vof field
174 std :: shared_ptr< VoxelVOFField > voxelVofField;
175
176 public:
180 AdditiveManufacturingProblem( int i, EngngModel *_master = nullptr );
186 void setUDContextOutputMode( int cStep );
188 void setRenumberFlag() override;
189
190 void solveYourself() override;
191 void solveYourselfAt( TimeStep *tStep ) override;
192 int forceEquationNumbering() override;
193 void updateYourself( TimeStep *tStep ) override;
194 void initializeYourself( TimeStep *tStep ) override {}
195 int initializeAdaptive( int tStepNumber ) override { return 0; }
196 void terminate( TimeStep *tStep ) override;
197 void doStepOutput( TimeStep *tStep ) override;
198
199 int instanciateYourself( DataReader &dr, InputRecord &ir, const char *outFileName, const char *desc ) override;
200 void initializeFrom( InputRecord &ir ) override;
201 void updateAttributes( MetaStep *mStep ) override;
202
203 void saveContext( DataStream &stream, ContextMode mode ) override;
204 void restoreContext( DataStream &stream, ContextMode mode ) override;
205 void updateDomainLinks() override;
206
208 void printOutputAt( FILE *file, TimeStep *tStep ) override;
209
210 TimeStep *giveCurrentStep( bool force = false ) override;
211 TimeStep *givePreviousStep( bool force = false ) override;
212 TimeStep *giveSolutionStepWhenIcApply( bool force = false ) override;
214 int giveNumberOfFirstStep( bool force = false ) override;
215
216 TimeStep *giveNextStep() override;
217
218 // identification
219 const char *giveClassName() const override { return "AdditiveManufacturingProblem"; }
220 virtual const char *giveInputRecordName() const { return _IFT_AdditiveManufacturingProblem_Name; }
221 int useNonlocalStiffnessOption() override { return 0; }
222
223 fMode giveFormulation() override { return UNKNOWN; }
229 Function *giveDtFunction();
230
234 double giveDeltaT( int n );
235
239 double giveDiscreteTime( int n );
240
242 void giveCoupledModels( IntArray &answer ) { answer = coupledModels; }
243 FieldPtr giveField (FieldType key, TimeStep *tStep) override {
244 if (key == FieldType::FT_VOF) {
245 return this->voxelVofField;
246 }
247 return FieldPtr();
248 }
249
250
251#ifdef __OOFEG
252 void drawYourself( oofegGraphicContext &gc ) override;
253 void drawElements( oofegGraphicContext &gc ) override;
254 void drawNodes( oofegGraphicContext &gc ) override;
255 void showSparseMtrxStructure( int type, oofegGraphicContext &gc, TimeStep *tStep ) override {}
256#endif
257
258 int checkProblemConsistency() override;
259
260 EngngModel *giveSlaveProblem( int i ) override;
261 int giveNumberOfSlaveProblems() override { return (int)inputStreamNames.size(); }
262 int instanciateDefaultMetaStep( InputRecord &ir ) override;
263
264protected:
265 int instanciateSlaveProblems();
266
267 bool add_node_if_not_exists2( EngngModel *emodel, const VoxelNode &cn );
268 void add_element_if_not_exists2( EngngModel *emodel, Voxel &cn );
269 bool add_sm_node_if_not_exists2( EngngModel *emodel, const VoxelNode &cn );
270 void add_sm_element_if_not_exists2( EngngModel *emodel, Voxel &cn );
271
272
273};
274} // end namespace oofem
275#endif // AdditiveManufacturingProblem_h
#define _IFT_AdditiveManufacturingProblem_Name
The Printer class is used to process G-code commands and manage the printer state.
Definition Printer.h:77
FloatArray discreteTimes
Specified times where the problem is solved.
IntArray coupledModels
List of slave models to which this model is coupled.
double maxStepLength
adaptive time step length - maximum
double reqIterations
adaptive time step length - required (=optimum) number of iterations
AdditiveManufacturingProblem(int i, EngngModel *_master=nullptr)
double adaptiveStepSince
adaptive time step length applies after prescribed time
void setContextOutputMode(ContextOutputMode contextMode)
int giveNumberOfFirstStep(bool force=false) override
AdditiveManufacturingProblem(const AdditiveManufacturingProblem &)=delete
AdditiveManufacturingProblem & operator=(const AdditiveManufacturingProblem &)=delete
void initializeYourself(TimeStep *tStep) override
void setProblemMode(problemMode pmode)
void setRenumberFlag() override
Sets the renumber flag to true.
int useNonlocalStiffnessOption() override
Returns nonzero if nonlocal stiffness option activated.
void printOutputAt(FILE *file, TimeStep *tStep) override
TimeStep * giveCurrentStep(bool force=false) override
TimeStep * giveSolutionStepWhenIcApply(bool force=false) override
std ::vector< std ::unique_ptr< EngngModel > > emodelList
List of engineering models to solve sequentially.
int timeDefinedByProb
Optional parameter which specify problems to define load time functions.
FieldPtr giveField(FieldType key, TimeStep *tStep) override
const char * giveClassName() const override
Returns class name of the receiver.
std ::shared_ptr< VoxelVOFField > voxelVofField
int giveNumberOfSlaveProblems() override
Returns number of slave problems.
TimeStep * givePreviousStep(bool force=false) override
void giveCoupledModels(IntArray &answer)
Returns list of model number that this model is coupled with. Used for staggered approach.
TimeStep * giveNextStep() override
Returns next time step (next to current step) of receiver.
double minStepLength
adaptive time step length - minimum
void showSparseMtrxStructure(int type, oofegGraphicContext &gc, TimeStep *tStep) override
int dtFunction
Associated time function for time step increment.
EngngModel(int i, EngngModel *_master=NULL)
Definition engngm.C:99
long ContextMode
Definition contextmode.h:43
fMode
Definition fmode.h:42
@ UNKNOWN
Unknown.
Definition fmode.h:43
FieldType
Physical type of field.
Definition field.h:64
std::shared_ptr< Field > FieldPtr
Definition field.h:78
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEM_EXPORT
Definition oofemcfg.h:7
A struct to represent a 3D model.
Definition VoxelGrid.h:14
A struct to represent a single voxel.
Definition VoxelGrid.h:23

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