TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
ProblemTrio.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15#include <ProblemTrio.h>
16#include <Probleme_U.h>
17#include <Probleme_base.h>
18#include <ICoCoExceptions.h>
19#include <Noms.h>
20#include <Comm_Group_MPI.h>
21#include <MAIN.h>
22#include <mon_main.h>
23#include <ICoCoTrioField.h>
24#include <Schema_Temps_base.h>
25#include <Catch_SIGINIT.h>
26#include <Init_Params.h>
27#include <signal.h>
28#include <Motcle.h>
29//#include <ICoCoTrioField.h>
30#include <medcoupling++.h>
31#ifndef NO_MEDFIELD
32#include <ICoCoMEDDoubleField.h>
33#include <MEDCouplingFieldDouble.hxx>
34#include <MEDCoupling_version.h>
35#endif
36#include <Convert_ICoCoTrioField.h>
37#include <Perf_counters.h>
38#include <Field_base.h>
39
40#include <Equation_base.h>
41#include <cstdlib>
42
43using ICoCo::Problem;
45using ICoCo::TrioField;
46using std::string;
47using std::vector;
48
49extern void TRUST_global_finalize();
50
51namespace
52{
53#ifdef MPI_
54bool TRUST_MPI_COMM_SET = false;
55#endif
56}
57
59{
60 if(p) delete p;
61 p=0;
62 delete (my_params);
63
65 TRUST_global_finalize();
66}
67
68////////////////////////////
69// //
70// interface ProblemTrio //
71// //
72////////////////////////////
73
74// When the dynamic library is loaded via dlopen(), getting a handle
75// on this function is the only way to create a Problem object.
76
77extern "C" Problem* getProblem()
78{
79 //Cerr<<"coucou getProblem"<<finl;
80 Problem* T=new ProblemTrio;
81 return T;
82}
83
84/*! @brief As initialize doesn't have any arguments, they can be passed to the Problem at the time of instantiation.
85 *
86 * They can include data file name, MPI communicator,..
87 * In this implementation (for use outside TRUST), only the name of an
88 * underlying Probleme_U needs to be provided.
89 *
90 * @throws WrongContext
91 */
92
93extern void TRUST_set_library_mode(bool);
94
96{
98 TRUST_set_library_mode(false);
99}
100
102 pb(nullptr), p(nullptr)
103{
105 (*my_params).problem_name="default_vvvvv";
106 (*my_params).problem_name="pb";
107 //my_params.comm=MPI_COMM_WORLD;
108 (*my_params).is_mpi=0;
109 TRUST_set_library_mode(true);
110}
111
112
113void ProblemTrio::setDataFile(const string& file)
114{
115 (*my_params).data_file=file;
116}
117void ProblemTrio::setMPIComm(void* mpicomm)
118{
119#ifdef MPI_
120 if (mpicomm)
121 {
122 (*my_params).is_mpi=1;
123 (*my_params).comm=*((MPI_Comm*)(mpicomm));
124 }
125#endif
126}
127/*! @brief This method is called once at the beginning, before any other one of the interface Problem.
128 *
129 * @throws WrongContext
130 */
131
132
134{
136 if (((*my_params).problem_name=="default_vvvvv") || ((*my_params).data_file=="default_vvvvv"))
137 throw WrongArgument("??","Constructor","data","data shoud point to the name of a Probleme_U");
138
139#ifdef MPI_
140 // exception if I don't belong to comm !
141 int rank_in_comm=0;
142 if ((*my_params).is_mpi!=0 && !TRUST_MPI_COMM_SET)
143 {
144 if (MPI_Comm_rank((*my_params).comm,&rank_in_comm)!=MPI_SUCCESS)
145 throw WrongArgument((*my_params).problem_name,"initialize","comm","This process should belong to comm");
146 if (rank_in_comm==MPI_UNDEFINED)
147 throw WrongArgument((*my_params).problem_name,"initialize","comm","This process should belong to comm");
148
149 Comm_Group_MPI::set_trio_u_world((*my_params).comm);
150
152 TRUST_MPI_COMM_SET = true;
153
154 Comm_Group_MPI::set_must_mpi_initialize(false); // ???
155 }
156
157#endif
158 int argc=2;
159 char** argv=new char*[argc];
160 string code="TRUST wrapper";
161 // Les copies sont necessaires pour se debarrasser des const...
162 argv[0]=new char[code.length()+1];
163 strcpy(argv[0],code.c_str());
164 argv[1]=new char[(*my_params).data_file.length()+1];
165 strcpy(argv[1],(*my_params).data_file.c_str());
166 // pour salome
167 if (p) delete p;
168 p=nullptr;
169 int res;
170 // on lance avec ou sans mpi
171 res=main_TRUST(argc,argv,p,(*my_params).is_mpi);
172
173 // Re-open top level counter (it was closed at the end of main_TRUST
174 statistics().begin_count(STD_COUNTERS::total_execution_time);
175
176 delete [] argv[0];
177 delete [] argv[1];
178 delete [] argv;
179
180 Nom nom("ICoCoProblemName"),nom_pb;
181 if (nom.interprete().objet_existant(nom))
182 {
183 nom_pb=ref_cast(Nom,get_obj(nom));
184 Cout<<finl<<" ICoCoProblemName from data file "<<nom_pb<< finl;
185 }
186 else
187 {
188 nom_pb="pb";
189 Cout<<finl<<" ICoCoProblemName not found in data file, we try "<<nom_pb<< finl;
190 }
191
192 (*my_params).problem_name=nom_pb;
193 pb=&ref_cast(Probleme_U,get_obj(nom_pb));
194 if (res || !pb)
195 throw WrongArgument((*my_params).problem_name,"initialize","problem_name","No problem of that name found in data file");
197
198 // Register signal and signal handler (SIGINT) if user presses ctrl-c during exec
200 {
201 Catch_SIGINIT sig;
202 sig.set_nom_cas_pour_signal(pb->nom_du_cas());
204 }
205
206 // Print the initialization CPU statistics
207 statistics().print_TU_files("Computation start-up statistics");
208 return true;
209}
210
212{
213 if (pb==nullptr)
214 pb=&pb_to_solve;
215 pb_to_solve.initialize();
216 pb_to_solve.postraiter(1);
217 return true;
218}
219
220/*! @brief This method is called once at the end, after any other one.
221 *
222 * It frees the memory and saves anything that needs to be saved.
223 *
224 * @throws WrongContext
225 */
227{
228 if (pb)
229 {
230 pb->postraiter(1);
231 pb->terminate();
232 statistics().end_count(STD_COUNTERS::total_execution_time);
233 }
234
236 {
237 delete p;
238 p = 0;
239 }
240}
241
242
243///////////////////////////////////
244// //
245// interface UnsteadyProblem //
246// //
247///////////////////////////////////
248
249
250/*! @brief Returns the present time.
251 *
252 * This value may change only at the call of validateTimeStep.
253 * A surcharger
254 *
255 * @return (double) present time
256 * @throws WrongContext
257 */
259{
260 return pb->presentTime();
261}
262
263/*! @brief Compute the value the Problem would like for the next time step.
264 *
265 * This value will not necessarily be used at the call of initTimeStep,
266 * but it is a hint.
267 * This method may use all the internal state of the Problem.
268 *
269 * @param (stop) Does the Problem want to stop ?
270 * @return (double) The desired time step
271 * @throws WrongContext
272 */
273double ProblemTrio::computeTimeStep(bool& stop) const
274{
275 return pb->computeTimeStep(stop);
276}
277
278
279/*! @brief This method allocates and initializes the unknown and given fields for the future time step.
280 *
281 * The value of the interval is imposed through the parameter dt.
282 * In case of error, returns false.
283 *
284 * @param (double dt) the time interval to allocate
285 * @return (bool) true=OK, false=error, not able to tackle this dt
286 * @throws WrongContext, WrongArgument
287 */
289{
290 return pb->initTimeStep(dt);
291}
292
293
294/*! @brief Calculates the unknown fields for the next time step.
295 *
296 * The default implementation uses iterations.
297 *
298 * @return (bool) true=OK, false=unable to find the solution.
299 * @throws WrongContext
300 */
302{
303 if (pb->lsauv())
304 pb->sauver();
305 bool res=pb->solveTimeStep();
306
307 return res;
308}
309
310
311/*! @brief Validates the calculated unknown by moving the present time at the end of the time step.
312 *
313 * This method is allowed to free past values of the unknown and given
314 * fields.
315 *
316 * @throws WrongContext
317 */
319{
320 pb->validateTimeStep();
321 if(sub_type(Probleme_base,*pb))
322 {
323 const Probleme_base& pb_base = ref_cast(Probleme_base,*pb);
324 const Schema_Temps_base& sch = pb_base.schema_temps();
325 bool stop_ = sch.stop();
326 if (!stop_) pb->postraiter(0);
327 }
328 else
329 {
330 // If *pb is a coupled problem, we may get the last line duplicated in post-processing files.
331 pb->postraiter(0);
332 }
333}
334
335/*! @brief Tells if the Problem unknowns have changed during the last time step.
336 *
337 * @return (bool) true=stationary, false=not stationary
338 * @throws WrongContext
339 */
341{
342 return pb->isStationary();
343}
344
346{
347 // TODO TODO FIXME
348 Cerr << "ProblemTrio::setStationaryMode() not impl!" << finl;
349 Process::exit(-1);
350}
351
353{
354 // TODO TODO FIXME
355 Cerr << "ProblemTrio::getStationaryMode() not impl!" << finl;
356 Process::exit(-1);
357 return true;
358}
359
360
361/*! @brief Aborts the resolution of the current time step.
362 *
363 * @throws WrongContext
364 */
366{
367 pb->abortTimeStep();
368}
369
370/*! @brief Reset the current time of the Problem to a given value.
371 *
372 * New in version 2 of ICoCo.
373 * Particularly useful for the initialization of complex transients: the starting point of the transient
374 * of interest is computed first, the time is reset to 0, and then the actual transient of interest starts with proper
375 * initial conditions, and global time 0.
376 *
377 * Can be called outside the TIME_STEP_DEFINED context (see Problem documentation).
378 *
379 * @param[in] time the new current time.
380 * @throws ICoCo::WrongContext exception if called before initialize() or after terminate().
381 * @throws ICoCo::WrongContext exception if called inside the TIME_STEP_DEFINED context (see Problem documentation)
382 */
383void ProblemTrio::resetTime(double time)
384{
385 pb->resetTime(time);
386}
387
388/////////////////////////////////////////////
389// //
390// interface IterativeUnsteadyProblem //
391// //
392/////////////////////////////////////////////
393
394/*! @brief In the case solveTimeStep uses an iterative process, this method executes a single iteration.
395 *
396 * It is thus possible to modify the given fields between iterations.
397 * converged is set to true if the process has converged, ie if the
398 * unknown fields are solution to the problem on the next time step.
399 * Otherwise converged is set to false.
400 * The return value indicates if the convergence process behaves normally.
401 * If false, the ProblemTrio wishes to abort the time step resolution.
402 *
403 * @param (bool& converged) It is a return value : true if the process has converged, false otherwise.
404 * @return (bool) true=OK, false=unable to converge
405 * @throws WrongContext
406 */
407bool ProblemTrio::iterateTimeStep(bool& converged)
408{
409 return pb->iterateTimeStep(converged);
410}
411
412/*! @brief This method is used to find the names of input fields understood by the Problem
413 *
414 * @return (vector<string>) list of names usable with getInputFieldTemplate and setInputField
415 */
417{
418 vector<string> v;
419 Noms noms;
420 pb->getInputFieldsNames(noms);
421 for (const auto& itr : noms)
422 v.push_back(itr.getChar());
423 return v;
424}
425
426/*! @brief This method is used to get a template of a field expected for the given name.
427 *
428 */
429void ProblemTrio::getInputFieldTemplate(const std::string& name, TrioField& afield) const
430{
431 Nom nom(name);
432 pb->getInputFieldTemplate(nom,afield);
433}
434
435/*! @brief This method is used to provide the Problem with an input field.
436 *
437 */
438void ProblemTrio::setInputField(const std::string& name, const TrioField& afield)
439{
440 Nom nom(name);
441 pb->setInputField(nom,afield);
442}
443
444void ProblemTrio::setInputDoubleValue(const std::string& name, const double& val)
445{
446 Nom mot(name);
447 pb->setInputDoubleValue(mot,val);
448}
449
450void ProblemTrio::setInputStringValue(const std::string& name, const std::string& val)
451{
452 pb->setInputStringValue(name, val);
453}
454
455std::string ProblemTrio::getOutputStringValue(const std::string& name) const
456{
457 return pb->getOutputStringValue(name);
458}
459
460double ProblemTrio::getOutputDoubleValue(const std::string& name) const
461{
462 TrioField f;
463 try
464 {
465 getOutputField(name,f);
466 }
467 catch (WrongArgument& err)
468 {
469 vector<string> fld = getInputFieldsNames();
470 if (std::find(fld.begin(), fld.end(), name) == fld.end())
471 throw err;
472
473 Cerr << "WARNING: trying to call getOutputDoubleValue() of an input field...!!" << finl;
474 return -1e+38;
475 }
476 if (f.nb_values()!=1)
477 throw WrongArgument((*my_params).problem_name,"getOutputDoubleValue",name,"invalid field size (should be 1)!!");
478
479 return f._field[0];
480}
481
482void ProblemTrio::setInputIntValue(const std::string& name, const int& val)
483{
484 // add value in ICoCoScalarRegister
485 const Nom nom(name);
486 pb->setInputIntValue(nom, val);
487}
488
489int ProblemTrio::getOutputIntValue(const std::string& name) const
490{
491 const Nom nom(name);
492 // [ABN] A bit ugly: we force cast to int to handle the 64b situation.
493 // In 64b the ScalarRegister will become long, but the final ICoCo interface will be int.
494 // Hopefully soon we will have a clean 64-bits version...
495 return (int)pb->getOutputIntValue(nom);
496}
497
498void ProblemTrio::getOutputPointValues(const std::string& name,
499 const std::vector<double>& x,
500 const std::vector<double>& y,
501 const std::vector<double>& z,
502 std::vector<double>& vals, int compo)
503{
504 pb->getOutputPointValues(Nom(name), x, y, z, vals, compo);
505}
506
507double ProblemTrio::getOutputPointValues(const std::string& name, const double x, const double y, const double z, int compo)
508{
509 return pb->getOutputPointValues(Nom(name), x, y, z, compo);
510}
511
513{
514
515 // const Probleme_base& pb_base=ref_cast(Probleme_base,*pb);
516 Noms my_names;
517 pb->getOutputFieldsNames(my_names);
518 vector<string> output_names;
519 for (const auto& itr : my_names)
520 output_names.push_back(itr.getChar());
521 return output_names;
522
523}
524
525ICoCo::ValueType ProblemTrio::getFieldType(const std::string& name) const
526{
527 vector<string> fld = getOutputFieldsNames();
528 if (std::find(fld.begin(), fld.end(), name) == fld.end())
529 {
530 fld = getInputFieldsNames();
531 if (std::find(fld.begin(), fld.end(), name) == fld.end())
532 throw WrongArgument((*my_params).problem_name,"getFieldType","name","invalid field name!!");
533 }
534 // All fields thus far are Double field in TRUST:
535 return ICoCo::ValueType::Double;
536}
537
538void ProblemTrio::getOutputField(const std::string& name_, TrioField& afield) const
539{
540 const Nom name(name_);
541 pb->getOutputField(name,afield);
542}
543
544// TODO: provide a more efficient version of this:
545void ProblemTrio::updateOutputField(const std::string& name, TrioField& afield) const
546{
547 getOutputField(name, afield);
548}
549
550void ProblemTrio::getOutputMEDDoubleField(const std::string& name,MEDDoubleField& medfield) const
551{
552#ifndef NO_MEDFIELD
553 TrioField triofield;
554 getOutputField(name,triofield);
555 medfield= build_medfield(triofield);
556
557#else
558 throw NotImplemented("No ParaMEDMEM","getInputMEDDoubleField");
559#endif
560}
561
562void ProblemTrio::getInputMEDDoubleFieldTemplate(const std::string& name, MEDDoubleField& medfield) const
563{
564#ifndef NO_MEDFIELD
565 TrioField triofield;
566 getInputFieldTemplate(name,triofield);
567 medfield=build_medfield(triofield);
568#else
569 throw NotImplemented("No ParaMEDMEM","getInputMEDDoubleFieldTemplate");
570#endif
571}
572
573void ProblemTrio::setInputMEDDoubleField(const std::string& name, const MEDDoubleField& afield)
574{
575#ifndef NO_MEDFIELD
576 // bof en attendant mieux
577 TrioField triofield;
578 getInputFieldTemplate(name,triofield);
579#ifdef OLD_MEDCOUPLING
580 const ParaMEDMEM::DataArrayDouble *fieldArr=afield.getField()->getArray();
581#else
582 const MEDCoupling::DataArrayDouble *fieldArr=afield.getMCField()->getArray();
583#endif
584 triofield._field=const_cast<double*> (fieldArr->getConstPointer());
585 // il faut copier les valeurs
586 setInputField(name,triofield);
587 triofield._field=0;
588 //fieldArr->decrRef();
589
590 // Assigning proper component names
591 const unsigned int nbcomp = (int)fieldArr->getNumberOfComponents();
592 std::vector<std::string> compo_names = fieldArr->getInfoOnComponents();
593
594 OBS_PTR(Field_base) ch = pb->findInputField(Nom(name));
595 assert(nbcomp == (unsigned)ch->nb_comp());
596 for (unsigned int i = 0; i < nbcomp; i++)
597 {
598 Nom compo_name(compo_names[i]);
599 ch->fixer_nom_compo((int)i, compo_name);
600 }
601#else
602 throw NotImplemented("No ParaMEDMEM","setInputMEDDoubleField");
603#endif
604}
605
606// TODO TODO FIXME do this more cleverly
607void ProblemTrio::updateOutputMEDDoubleField(const std::string& name, MEDDoubleField& medfield) const
608{
609#ifndef NO_MEDFIELD
610 TrioField triofield;
611 getOutputField(name,triofield);
612 medfield= build_medfield(triofield);
613
614#else
615 throw NotImplemented("No ParaMEDMEM","getInputMEDDoubleField");
616#endif
617}
618
619
621{
622#ifdef OLD_MEDCOUPLING
623 return 7;
624#else
625 return MEDCOUPLING_VERSION_MAJOR;
626#endif
627}
628
630{
631#ifdef OLD_MEDCOUPLING
632 return false;
633#else
634 return sizeof(mcIdType) == 8;
635#endif
636}
637
638// Specific to TRUST, and outside the ICoCo standard
639// Get a direct access to the unknown array of an equation, wrapped into a dummy
640// MEDDoubleField. The mesh and other field information are irrelevant, only the underlying
641// array should be considered.
642ICoCo::MEDDoubleField ProblemTrio::getDirectAccessToUnknown(const std::string& unk_name, bool isFuture)
643{
644 using namespace MEDCoupling;
645
646 if(sub_type(Probleme_base,*pb))
647 {
648 Probleme_base& pb_base = ref_cast(Probleme_base,*pb);
649 double * ptr = nullptr;
650 size_t nbTup = 0, nbCompo = 0;
651 for (int i=0; i < pb_base.nombre_d_equations(); i++)
652 {
653 Champ_Inc_base& ci = pb_base.equation(i).inconnue();
654 assert(ci.valeurs().nb_dim() == 2);
655 if (Motcle(ci.le_nom()) == Motcle(unk_name))
656 {
657 DoubleTab& t = isFuture ? ci.futur() : ci.valeurs() ;
658 ptr = t.addr();
659 nbTup = t.dimension_tot(0);
660 nbCompo = t.dimension_tot(1);
661 break;
662 }
663 }
664 if (ptr == nullptr)
665 throw WrongArgument((*my_params).problem_name,"getDirectAccessToUnknown","unk_name","invalid unknown name!!");
666
667 // Now wrap the underlying array in a dummy MEDDoubleField, with no valid mesh and no valid field information.
668 MCAuto<DataArrayDouble> da = DataArrayDouble::New();
669 da->useExternalArrayWithRWAccess(ptr, nbTup, nbCompo);
670 MCAuto<MEDCouplingFieldDouble> f = MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
671 f->setArray(da);
672 MEDDoubleField ret(f);
673 return ret;
674 }
675 else
676 throw WrongArgument((*my_params).problem_name,"getDirectAccessToUnknown","","Problem type must derive from Probleme_base!!");
677}
678
679
680// Miscellaneous
681Objet_U& get_obj(const char* chr)
682{
683 Nom nom(chr);
684 Objet_U& obj=nom.interprete().objet(nom);
685 return obj;
686}
687
688
static void signal_callback_handler(int signum)
void set_nom_cas_pour_signal(const Nom &cas)
Classe Champ_Inc_base.
DoubleTab & futur(int i=1) override
Renvoie les valeurs du champs a l'instant t+i.
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
virtual const Champ_Inc_base & inconnue() const =0
const Nom & le_nom() const override
Renvoie le nom du champ.
std::string problem_name
Definition Init_Params.h:32
class ProblemTrio
Definition ProblemTrio.h:46
void setMPIComm(void *) override
void updateOutputMEDDoubleField(const std::string &name, MEDDoubleField &afield) const override
void terminate() override
This method is called once at the end, after any other one.
Init_Params * my_params
void getOutputPointValues(const std::string &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, std::vector< double > &vals, int compo=0)
bool iterateTimeStep(bool &converged) override
In the case solveTimeStep uses an iterative process, this method executes a single iteration.
double getOutputDoubleValue(const std::string &name) const override
bool getStationaryMode() const override
double computeTimeStep(bool &stop) const override
Compute the value the Problem would like for the next time step.
ValueType getFieldType(const std::string &name) const override
int getMEDCouplingMajorVersion() const override
std::vector< std::string > getInputFieldsNames() const override
This method is used to find the names of input fields understood by the Problem.
void getInputMEDDoubleFieldTemplate(const std::string &name, MEDDoubleField &afield) const override
void validateTimeStep() override
Validates the calculated unknown by moving the present time at the end of the time step.
double presentTime() const override
Returns the present time.
void setInputDoubleValue(const std::string &name, const double &val) override
void getInputFieldTemplate(const std::string &name, TrioField &afield) const override
This method is used to get a template of a field expected for the given name.
bool initialize() override
This method is called once at the beginning, before any other one of the interface Problem.
std::string getOutputStringValue(const std::string &name) const override
void resetTime(double time) override
Reset the current time of the Problem to a given value.
bool isMEDCoupling64Bits() const override
void setInputField(const std::string &name, const TrioField &afield) override
This method is used to provide the Problem with an input field.
bool initialize_pb(Probleme_U &pb)
void getOutputField(const std::string &name, TrioField &afield) const override
void getOutputMEDDoubleField(const std::string &name, MEDDoubleField &afield) const override
std::vector< std::string > getOutputFieldsNames() const override
void setInputMEDDoubleField(const std::string &name, const MEDDoubleField &afield) override
bool initTimeStep(double dt) override
This method allocates and initializes the unknown and given fields for the future time step.
void setDataFile(const std::string &datafile) override
void updateOutputField(const std::string &name, TrioField &afield) const override
void setStationaryMode(bool stationary) override
void setInputStringValue(const std::string &name, const std::string &val) override
bool solveTimeStep() override
Calculates the unknown fields for the next time step.
MEDDoubleField getDirectAccessToUnknown(const std::string &unk_name, bool isFuture)
int getOutputIntValue(const std::string &name) const override
bool isStationary() const override
Tells if the Problem unknowns have changed during the last time step.
Probleme_U * pb
void abortTimeStep() override
Aborts the resolution of the current time step.
void setInputIntValue(const std::string &name, const int &val) override
void deactivate_multiple_runs()
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
const Interprete & interprete() const
Definition Objet_U.cpp:212
static int DEACTIVATE_SIGINT_CATCH
Definition Objet_U.h:103
~ProblemTrio() override
classe Probleme_U
Definition Probleme_U.h:46
virtual int postraiter(int force=1)
Demande au probleme de postraiter ses champs, sondes,.
virtual void initialize()
This method is called once at the beginning, before any other one of the interface Problem.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
const Schema_Temps_base & schema_temps() const
Renvoie le schema en temps associe au probleme.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static int exception_sur_exit
Definition Process.h:163
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
class Schema_Temps_base
virtual int stop() const
Renvoie 1 si il y lieu de stopper le calcul pour differente raisons: - le temps final est atteint.
_TYPE_ * addr()
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160