14 #ifndef _SIM_COUPLED_H_
15 #define _SIM_COUPLED_H_
49 return S1.preprocess() &&
S2.preprocess();
59 std::string
getName(
int substep = 1)
const
63 else if (substep == 2)
66 return "SIMCoupled<" +
S1.getName() +
","+
S2.getName() +
">";
72 return S1.advanceStep(tp) &&
S2.advanceStep(tp);
82 return S1.solveStep(tp) &&
S2.solveStep(tp);
84 return S2.solveStep(tp) &&
S1.solveStep(tp);
90 return S2.saveStep(tp,nBlock) &&
S1.saveStep(tp,nBlock);
94 virtual bool saveModel(
char* fileName,
int& geoBlk,
int& nBlock)
96 if (!
S1.saveModel(fileName,geoBlk,nBlock))
99 S2.setVTF(
S1.getVTF());
109 return S1.init(tp) &&
S2.init(tp);
115 const std::vector<ASMbase*>& patches,
116 char diffBasis = 0,
int component = 1)
118 S1.registerDependency(sim, name, nvc, patches, diffBasis, component);
119 S2.registerDependency(sim, name, nvc, patches, diffBasis, component);
126 S1.registerDependency(sim, name, nvc);
127 S2.registerDependency(sim, name, nvc);
133 return S1.getUniquePropertyCode(setName, comp);
139 return S1.createPropertySet(setName, pc);
144 VecFunc* field =
nullptr,
int pflag = -1)
146 return S1.setVecProperty(code, ptype, field, pflag);
152 S1.registerFields(exporter);
153 S2.registerFields(exporter);
159 return S1.setInitialConditions() &&
S2.setInitialConditions();
163 bool hasIC(
const std::string& name)
const
165 return S1.hasIC(name) ||
S2.hasIC(name);
173 result =
S2.getField(name);
182 return S1.serialize(data) &&
S2.serialize(data);
189 return S1.deSerialize(data) &&
S2.deSerialize(data);
Representation of a distributed physical property.
static const double T1[2]
1-point rule coordinates.
Definition: TriangleQuadrature.C:19
Base class for spline-based finite element (FE) assembly drivers.
Definition: ASMbase.h:70
Administer and write data using DataWriters.
Definition: DataExporter.h:38
Class for administration of MPI processes in IFEM library.
Definition: ProcessAdm.h:33
Template class for coupled simulators.
Definition: SIMCoupled.h:35
utl::vector< double > * getField(const std::string &name)
Returns the nodal vector of named field in this SIM.
Definition: SIMCoupled.h:169
int getUniquePropertyCode(const std::string &setName, int comp=0)
Returns a unique integer code for a Property set.
Definition: SIMCoupled.h:131
bool deSerialize(const std::map< std::string, std::string > &data)
Set internal state from a serialized state.
Definition: SIMCoupled.h:187
virtual bool solveStep(TimeStep &tp, bool firstS1=true)
Computes the solution for the current time step.
Definition: SIMCoupled.h:79
virtual ~SIMCoupled()
The destructor nullifies the VTF pointer for the second simulator.
Definition: SIMCoupled.h:41
SIMCoupled(T1 &s1, T2 &s2)
The constructor initializes the references to the two simulators.
Definition: SIMCoupled.h:38
bool serialize(std::map< std::string, std::string > &data)
Serialize internal state for restarting purposes.
Definition: SIMCoupled.h:180
T1 & S1
First substep.
Definition: SIMCoupled.h:193
virtual bool advanceStep(TimeStep &tp)
Advances the time step one step forward.
Definition: SIMCoupled.h:70
virtual bool saveStep(const TimeStep &tp, int &nBlock)
Saves the converged results to VTF-file of a given time step.
Definition: SIMCoupled.h:88
int getRefined() const
Returns current refinement status.
Definition: SIMCoupled.h:56
T2 & S2
Second substep.
Definition: SIMCoupled.h:194
virtual void registerDependency(SIMdependency *sim, const std::string &name, short int nvc=1)
Registers a dependency on a field from another SIM object.
Definition: SIMCoupled.h:123
virtual void setupDependencies()
Sets up field dependencies.
Definition: SIMCoupled.h:44
virtual bool saveModel(char *fileName, int &geoBlk, int &nBlock)
Opens a new VTF-file and writes the model geometry to it.
Definition: SIMCoupled.h:94
const ProcessAdm & getProcessAdm() const
Returns the parallel process administrator.
Definition: SIMCoupled.h:53
std::string getName(int substep=1) const
Returns the name of this (or a substep) simulator.
Definition: SIMCoupled.h:59
virtual void enableStaggering(bool=true)
Enables/disables staggering iteration cycles.
Definition: SIMCoupled.h:76
bool preprocess()
Performs some pre-processing tasks on the FE model.
Definition: SIMCoupled.h:47
bool setInitialConditions()
Sets the initial conditions for the simulators.
Definition: SIMCoupled.h:157
bool hasIC(const std::string &name) const
Checks whether a named initial condition is present.
Definition: SIMCoupled.h:163
VTF * getVTF() const
Returns the current VTF-file object.
Definition: SIMCoupled.h:104
size_t setVecProperty(int code, Property::Type ptype, VecFunc *field=nullptr, int pflag=-1)
Defines a vector field property.
Definition: SIMCoupled.h:143
virtual bool init(const TimeStep &tp)
Initializes for time-dependent simulation.
Definition: SIMCoupled.h:107
void registerFields(DataExporter &exporter)
Registers the field vectors for storage on HDF5 output.
Definition: SIMCoupled.h:150
bool createPropertySet(const std::string &setName, int pc)
Creates a set of Property objects.
Definition: SIMCoupled.h:137
virtual void registerDependency(SIMdependency *sim, const std::string &name, short int nvc, const std::vector< ASMbase * > &patches, char diffBasis=0, int component=1)
Registers a dependency on a field from another SIM object.
Definition: SIMCoupled.h:113
Class administering inter-SIM field dependencies.
Definition: SIMdependency.h:30
Class for encapsulation of general time stepping parameters.
Definition: TimeStep.h:31
Class for output of FE model and results to VTF file.
Definition: VTF.h:58
Vector-valued unary function of a spatial point.
Definition: Function.h:242
A vector class with some added algebraic operations.
Definition: matrix.h:64
Simple template classes for dense rectangular matrices and vectors.
Type
The available property types.
Definition: Property.h:32