1 #ifndef SM_StochasticHysteresis_H
2 #define SM_StochasticHysteresis_H
5 #include "SM_StochasticOutput.h"
8 #include "SM_LandauLifschitzBeam.h"
11 #include "SM_System.h"
17 #include "core_string.h"
18 #include "core_numeric.h"
44 std::array<tReal,SM_Constants::DIM> mD;
45 std::array<tReal,SM_Constants::DIM> mEpS;
57 "<E_{s}(E_p(<S(s,p),D>))",
59 "<number of simulations>",
65 memset(&outputs[0],0,outputs.size()*
sizeof(tReal));
77 tString routineName=
"SM_StochasticHysteresis::~SM_StochasticHysteresis()";
114 mem+=mEpS.size()*
sizeof(tReal);
115 mem+=mD.size()*
sizeof(tReal);
122 inline static CORE_UniquePointer<Self>
New() {
123 return CORE_UniquePointer<Self>(
new Self(),
129 inline static CORE_UniquePointer<Self>
New(
const Self& c) {
130 CORE_UniquePointer<Self> p=
New();
196 memset(&rawValues[0],0,rawValues.size()*
sizeof(tReal));
237 inline tBoolean
close(
const tIndex& s,
const SM_System& system,
const tBoolean& hasSucceeded) {
250 const tReal *iEpS=mEpS.data();
251 for (
const auto& Dk:mD) {
303 const tIndex& rawValuesNumber,
304 const std::valarray<tReal>& rawValues)
override {
315 std::stringstream ret;
323 inline void updateOutputs(
const tIndex& rawValuesNumber,
324 const std::valarray<tReal>& rawValues,
325 std::valarray<tReal>& outputs) {
326 if (outputs.size()<3) outputs.resize(3);
327 outputs[0]=rawValues[0]/rawValuesNumber;
328 outputs[1]=rawValuesNumber;
329 outputs[2]=rawValues[1];
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
static void EndCallRoutine(const tString &routineName)
end calling routine
Definition: CORE_Profiler.h:91
static void StartCallRoutine(const tString &routineName)
start calling routine
Definition: CORE_Profiler.h:61
This class defines a general stochastic beam of trajectories of system.
Definition: SM_Beam.h:61
const tIndex & getBeamSize() const
get the beam size
Definition: SM_Beam.h:166
This class describes a materials defined by state attributes:
Definition: SM_Material.h:61
This class stores stochastic hysteresis values.
Definition: SM_StochasticHysteresis.h:30
tBoolean close(const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded)
close the stochastic data for the simulation at index s
Definition: SM_StochasticHysteresis.h:237
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_StochasticHysteresis.h:100
virtual void adimensionize(const SM_Material &material) override
adimensionize the output compoent with material characteristic
Definition: SM_StochasticHysteresis.h:148
tBoolean open(const SM_Beam &beam)
open the stochastic data at the begininf of simulations
Definition: SM_StochasticHysteresis.h:183
tBoolean store(const SM_System &system)
store the stochastic data during the evolution method of the system
Definition: SM_StochasticHysteresis.h:220
virtual ~SM_StochasticHysteresis(void)
destroy
Definition: SM_StochasticHysteresis.h:76
const std::array< tReal, SM_Constants::DIM > & getHysteresisDirection() const
get the direction of hysteresis
Definition: SM_StochasticHysteresis.h:162
virtual void copy(const SM_StochasticOutputComponent &c) override
copy the stochastic data
Definition: SM_StochasticHysteresis.h:140
static CORE_UniquePointer< Self > New(const Self &c)
build a new instance of a stochastic data
Definition: SM_StochasticHysteresis.h:129
void setHysteresisDirection(const std::array< tReal, SM_Constants::DIM > &D)
set the direction of hysteresis
Definition: SM_StochasticHysteresis.h:155
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticHysteresis.h:112
SM_StochasticHysteresis(void)
create
Definition: SM_StochasticHysteresis.h:54
static CORE_UniquePointer< Self > New()
build a new instance of a stochastic data
Definition: SM_StochasticHysteresis.h:122
virtual void closePackedSimulations(const SM_Beam &beam, const tIndex &rawValuesNumber, const std::valarray< tReal > &rawValues) override
close stochastic data at the end of all packed simulations
Definition: SM_StochasticHysteresis.h:302
virtual tString toString() const override
return the string representation of the class
Definition: SM_StochasticHysteresis.h:314
tBoolean open(const tIndex &s, const SM_System &system)
open the stochastic data for simulation at index s
Definition: SM_StochasticHysteresis.h:210
tBoolean close(const SM_Beam &beam)
close stochastic data at the end of one packed simulations
Definition: SM_StochasticHysteresis.h:272
This class stores stochastic outpus computed for each trajectory of a simulation of trajectories of a...
Definition: SM_StochasticOutputComponent.h:36
const int & getRootIndex() const
get the root index of the output component
Definition: SM_StochasticOutputComponent.h:222
std::valarray< tReal > & getPackedRawValues()
get the packed raw values
Definition: SM_StochasticOutputComponent.h:301
void setOutputDescription(const std::vector< tString > &v)
et the output description
Definition: SM_StochasticOutputComponent.h:323
virtual tString toString() const override
return the string representation of the class
Definition: SM_StochasticOutputComponent.h:398
const tIndex & getPackedRawValuesNumber() const
get the packed raw values number
Definition: SM_StochasticOutputComponent.h:286
const tInteger & getPackedSimulationsNumber() const
get packed simulations number
Definition: SM_StochasticOutputComponent.h:269
const std::valarray< tReal > & getOutputValues() const
get the output values of the stochastic output for reading
Definition: SM_StochasticOutputComponent.h:330
const int & getIndex() const
get the index of the output component
Definition: SM_StochasticOutputComponent.h:217
this class implements the virtual methods of its base class SM_StochasticOutputComponent with templat...
Definition: SM_StochasticOutput.h:24
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticOutput.h:84
virtual void copy(const SM_StochasticOutputComponent &c)
copy
Definition: SM_StochasticOutput.h:94
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53
void computeMagneticMomentDirectionsMeanOverNetworks(const int &rootNetwork, std::array< tReal, SM_Constants::DIM > &meanS) const
compute the mean over the domain of magneticmoment directions
Definition: SM_System.h:477