![]() |
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
This class is used in order to check results using a json file containing the solution a given model part with a certain frequency. More...
#include <from_json_check_result_process.h>
Public Member Functions | |
Life Cycle | |
| FromJSONCheckResultProcess (Model &rModel, Parameters ThisParameters=Parameters(R"({})")) | |
| Default constructor. More... | |
| FromJSONCheckResultProcess (ModelPart &rModelPart, Parameters ThisParameters=Parameters(R"({})")) | |
| Default constructor. More... | |
| virtual | ~FromJSONCheckResultProcess () |
| Destructor. More... | |
Operators | |
| void | operator() () |
Operations | |
| void | ExecuteInitialize () override |
| This function is designed for being called at the beginning of the computations right after reading the model and the groups. More... | |
| void | ExecuteFinalizeSolutionStep () override |
| This function will be executed at every time step AFTER performing the solve phase. More... | |
| void | ExecuteFinalize () override |
| This function is designed for being called at the end of the computations. More... | |
| int | Check () override |
| This function is designed for being called after ExecuteInitialize ONCE to verify that the input is correct. More... | |
| bool | IsCorrectResult () |
| This function returns if the result is correct. More... | |
| std::string | GetErrorMessage () |
| This function returns the error message. More... | |
Input and output | |
| std::string | Info () const override |
| Turn back information as a string. More... | |
| void | PrintInfo (std::ostream &rOStream) const override |
| Print information about this object. More... | |
| void | PrintData (std::ostream &rOStream) const override |
| Print object's data. More... | |
Public Member Functions inherited from Kratos::Process | |
| KRATOS_CLASS_POINTER_DEFINITION (Process) | |
| Pointer definition of Process. More... | |
| Process () | |
| Default constructor. More... | |
| Process (const Flags options) | |
| ~Process () override | |
| Destructor. More... | |
| void | operator() () |
| This operator is provided to call the process as a function and simply calls the Execute method. More... | |
| virtual Process::Pointer | Create (Model &rModel, Parameters ThisParameters) |
| This method creates an pointer of the process. More... | |
| virtual void | Execute () |
| Execute method is used to execute the Process algorithms. More... | |
| virtual void | ExecuteBeforeSolutionLoop () |
| This function is designed for being execute once before the solution loop but after all of the solvers where built. More... | |
| virtual void | ExecuteInitializeSolutionStep () |
| This function will be executed at every time step BEFORE performing the solve phase. More... | |
| virtual void | ExecuteBeforeOutputStep () |
| This function will be executed at every time step BEFORE writing the output. More... | |
| virtual void | ExecuteAfterOutputStep () |
| This function will be executed at every time step AFTER writing the output. More... | |
| virtual void | Clear () |
| This method clears the assignation of the conditions. More... | |
| std::string | Info () const override |
| Turn back information as a string. More... | |
| void | PrintInfo (std::ostream &rOStream) const override |
| Print information about this object. More... | |
| void | PrintData (std::ostream &rOStream) const override |
| Print object's data. More... | |
Public Member Functions inherited from Kratos::Flags | |
| Flags & | operator= (Flags const &rOther) |
| Assignment operator. More... | |
| operator bool () const | |
| Flags | operator~ () const |
| bool | operator! () const |
| void | AssignFlags (Flags const &rOther) |
| void | Set (const Flags ThisFlag) |
| void | Set (const Flags ThisFlag, bool Value) |
| void | Reset (const Flags ThisFlag) |
| void | Flip (const Flags ThisFlag) |
| void | SetPosition (IndexType Position, bool Value=true) |
| bool | GetPosition (IndexType Position) const |
| void | FlipPosition (IndexType Position) |
| void | ClearPosition (IndexType Position) |
| void | Clear () |
| Flags | AsFalse () const |
| bool | Is (Flags const &rOther) const |
| bool | IsDefined (Flags const &rOther) const |
| bool | IsNot (Flags const &rOther) const |
| bool | IsNotDefined (Flags const &rOther) const |
| KRATOS_CLASS_POINTER_DEFINITION (Flags) | |
| Pointer definition of Flags. More... | |
| const Flags & | operator|= (const Flags &Other) |
| const Flags & | operator&= (const Flags &Other) |
| Flags () | |
| Default constructor. More... | |
| Flags (Flags const &rOther) | |
| Copy constructor. More... | |
| virtual | ~Flags () |
| Destructor. More... | |
Protected Member Functions | |
Protected Operations | |
| void | InitializeDatabases () |
| This initializes the databases. More... | |
| void | FillVariablesList (const std::vector< std::string > &rNodalVariablesNames, const std::vector< std::string > &rGPVariablesNames) |
| This method fills the list of variables. More... | |
| template<class TEntity > | |
| bool | CheckFlag (const TEntity &rEntity, const Flags *pFlag) |
| This method checks if a flag is active in a given entity. More... | |
| bool | CheckValues (const double ValueEntity, const double ValueJSON) |
| This method checks the results. More... | |
| void | FailMessage (const IndexType EntityId, const std::string &rEntityType, const double ValueEntity, const double ValueJSON, const std::string &rVariableName, const int ComponentIndex=-1, const int GPIndex=-1) |
| This returns a message in case of fail. More... | |
| void | CheckNodeValues (IndexType &rCheckCounter) |
| This method check the nodal values. More... | |
| void | CheckNodeHistoricalValues (IndexType &rCheckCounter) |
| This method check the nodal historical values. More... | |
| void | CheckGPValues (IndexType &rCheckCounter) |
| This method check the GP values. More... | |
| SizeType | SizeDatabase (const Parameters &rResults, const NodesArrayType &rNodesArray, const ElementsArrayType &rElementsArray) |
| void | FillDatabase (const Parameters &rResults, const NodesArrayType &rNodesArray, const ElementsArrayType &rElementsArray, const SizeType NumberOfGP) |
| std::string | GetNodeIdentifier (NodeType &rNode) |
| Returns the identifier/key for saving nodal results in the json this can be either the node Id or its coordinates. More... | |
| NodesArrayType & | GetNodes (const Flags *pFlag=nullptr) |
| This method returns the nodes of the model part. More... | |
| ElementsArrayType & | GetElements (const Flags *pFlag=nullptr) |
| This method returns the elements of the model part. More... | |
| std::size_t | ComputeRelevantDigits (const double Value) |
| This method computes the relevant digits to take into account. More... | |
| const Parameters | GetDefaultParameters () const override |
| This method provides the defaults parameters to avoid conflicts between the different constructors. More... | |
Protected Access | |
| const ModelPart & | GetModelPart () const |
| This method returns the model part. More... | |
| const Parameters | GetSettings () const |
| This method returns the settings. More... | |
| const ResultDatabase & | GetNodeDatabase () |
| This method returns the Nodes database. If not initialized it will try initialize again. More... | |
| const ResultDatabase & | GetGPDatabase () |
| This method returns the GP database. If not initialized it will try initialize again. More... | |
Protected LifeCycle | |
| FromJSONCheckResultProcess (ModelPart &rModelPart, Parameters Settings, Parameters DefaultSettings) | |
| Protected constructor with modified default settings to be defined by derived class. More... | |
Type Definitions | |
| typedef ModelPart::NodesContainerType | NodesArrayType |
| This flag is used in order to check that elements database are initialized. More... | |
| typedef ModelPart::ElementsContainerType | ElementsArrayType |
| typedef Node | NodeType |
| The node type definiton. More... | |
| typedef std::size_t | IndexType |
| The definition of the index type. More... | |
| typedef std::size_t | SizeType |
| The definition of the sizetype. More... | |
| KRATOS_CLASS_POINTER_DEFINITION (FromJSONCheckResultProcess) | |
| Pointer definition of FromJSONCheckResultProcess. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (CORRECT_RESULT) | |
| Local Flags. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (HISTORICAL_VALUE) | |
| This flag is used in order to check that the result is correct. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (CHECK_ONLY_LOCAL_ENTITIES) | |
| This flag is used in order to check if the values are historical. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (NODES_CONTAINER_INITIALIZED) | |
| This flag is used in order to check only local entities. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (ELEMENTS_CONTAINER_INITIALIZED) | |
| This flag is used in order to check that nodes container are initialized. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (NODES_DATABASE_INITIALIZED) | |
| This flag is used in order to check that elements container are initialized. More... | |
| KRATOS_DEFINE_LOCAL_FLAG (ELEMENTS_DATABASE_INITIALIZED) | |
| This flag is used in order to check that nodes database are initialized. More... | |
Additional Inherited Members | |
Public Types inherited from Kratos::Flags | |
| enum | FlagsList { Flag0 = BlockType(1) , Flag1 = BlockType(1) << 1 , Flag2 = BlockType(1) << 2 , Flag3 = BlockType(1) << 3 , Flag4 = BlockType(1) << 4 , Flag5 = BlockType(1) << 5 , Flag6 = BlockType(1) << 6 , Flag7 = BlockType(1) << 7 , Flag8 = BlockType(1) << 8 , Flag9 = BlockType(1) << 9 , Flag10 = BlockType(1) << 10 , Flag11 = BlockType(1) << 11 , Flag12 = BlockType(1) << 12 , Flag13 = BlockType(1) << 13 , Flag14 = BlockType(1) << 14 , Flag15 = BlockType(1) << 15 , Flag16 = BlockType(1) << 16 , Flag17 = BlockType(1) << 17 , Flag18 = BlockType(1) << 18 , Flag19 = BlockType(1) << 19 , Flag20 = BlockType(1) << 20 , Flag21 = BlockType(1) << 21 , Flag22 = BlockType(1) << 22 , Flag23 = BlockType(1) << 23 , Flag24 = BlockType(1) << 24 , Flag25 = BlockType(1) << 25 , Flag26 = BlockType(1) << 26 , Flag27 = BlockType(1) << 27 , Flag28 = BlockType(1) << 28 , Flag29 = BlockType(1) << 29 , Flag30 = BlockType(1) << 30 } |
| typedef int64_t | BlockType |
| typedef int64_t | FlagType |
| typedef std::size_t | IndexType |
Static Public Member Functions inherited from Kratos::Flags | |
| static const Flags | AllDefined () |
| static const Flags | AllTrue () |
| static Flags | Create (IndexType ThisPosition, bool Value=true) |
This class is used in order to check results using a json file containing the solution a given model part with a certain frequency.
This stores the dababase in a class denominated ResultDatabase which considers Table to store the information, therefore being able to interpolate results
| typedef std::size_t Kratos::FromJSONCheckResultProcess::IndexType |
The definition of the index type.
This flag is used in order to check that elements database are initialized.
Containers definition
The node type definiton.
| typedef std::size_t Kratos::FromJSONCheckResultProcess::SizeType |
The definition of the sizetype.
| Kratos::FromJSONCheckResultProcess::FromJSONCheckResultProcess | ( | Model & | rModel, |
| Parameters | ThisParameters = Parameters(R"({})") |
||
| ) |
Default constructor.
| rModel | The model where the where the simulation is performed |
| ThisParameters | The parameters of configuration |
| Kratos::FromJSONCheckResultProcess::FromJSONCheckResultProcess | ( | ModelPart & | rModelPart, |
| Parameters | ThisParameters = Parameters(R"({})") |
||
| ) |
Default constructor.
| rModelPart | The model part where the simulation is performed |
| ThisParameters | The parameters of configuration |
|
inlinevirtual |
Destructor.
|
protected |
Protected constructor with modified default settings to be defined by derived class.
|
overridevirtual |
This function is designed for being called after ExecuteInitialize ONCE to verify that the input is correct.
Reimplemented from Kratos::Process.
|
inlineprotected |
This method checks if a flag is active in a given entity.
| rEntity | The entity to check |
| pFLag | The pointer to the flag to check |
|
protected |
This method check the GP values.
| rCheckCounter | The check counter |
|
protected |
This method check the nodal historical values.
| rCheckCounter | The check counter |
|
protected |
This method check the nodal values.
| rCheckCounter | The check counter |
|
protected |
This method checks the results.
| ValueEntity | The value on the entity |
| ValueJSON | The reference value from the JSON |
|
protected |
This method computes the relevant digits to take into account.
|
overridevirtual |
This function is designed for being called at the end of the computations.
Reimplemented from Kratos::Process.
|
overridevirtual |
This function will be executed at every time step AFTER performing the solve phase.
Reimplemented from Kratos::Process.
|
overridevirtual |
This function is designed for being called at the beginning of the computations right after reading the model and the groups.
Reimplemented from Kratos::Process.
|
protected |
This returns a message in case of fail.
| EntityId | The Kratos node or element to check |
| rEntityType | The type of the entity |
| ValueEntity | The value on the entity |
| ValueJSON | The reference value from the json |
| rVariableName | The name of the variable |
| ComponentIndex | The component index |
| GPIndex | The GP index |
|
protected |
|
protected |
This method fills the list of variables.
| rNodalVariablesNames | The names of the nodal variables |
| rGPVariablesNames | The names of the GP variables |
|
overrideprotectedvirtual |
This method provides the defaults parameters to avoid conflicts between the different constructors.
Reimplemented from Kratos::Process.
|
protected |
This method returns the elements of the model part.
|
inline |
This function returns the error message.
|
protected |
This method returns the GP database. If not initialized it will try initialize again.
|
protected |
This method returns the model part.
|
protected |
This method returns the Nodes database. If not initialized it will try initialize again.
|
protected |
Returns the identifier/key for saving nodal results in the json this can be either the node Id or its coordinates.
The coordinates can be used to check the nodal results in MPI
| rNode | The Kratos node to get the identifier for |
|
protected |
This method returns the nodes of the model part.
|
protected |
This method returns the settings.
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::Flags.
|
protected |
This initializes the databases.
|
inline |
This function returns if the result is correct.
| Kratos::FromJSONCheckResultProcess::KRATOS_CLASS_POINTER_DEFINITION | ( | FromJSONCheckResultProcess | ) |
Pointer definition of FromJSONCheckResultProcess.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | CHECK_ONLY_LOCAL_ENTITIES | ) |
This flag is used in order to check if the values are historical.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | CORRECT_RESULT | ) |
Local Flags.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | ELEMENTS_CONTAINER_INITIALIZED | ) |
This flag is used in order to check that nodes container are initialized.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | ELEMENTS_DATABASE_INITIALIZED | ) |
This flag is used in order to check that nodes database are initialized.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | HISTORICAL_VALUE | ) |
This flag is used in order to check that the result is correct.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | NODES_CONTAINER_INITIALIZED | ) |
This flag is used in order to check only local entities.
| Kratos::FromJSONCheckResultProcess::KRATOS_DEFINE_LOCAL_FLAG | ( | NODES_DATABASE_INITIALIZED | ) |
This flag is used in order to check that elements container are initialized.
|
inline |
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::Flags.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::Flags.
|
protected |