Skip to content

Commit

Permalink
Merge pull request #1732 from KratosMultiphysics/feature-dam-Release-5.3
Browse files Browse the repository at this point in the history
Feature dam release 5.3
  • Loading branch information
roigcarlo authored Mar 21, 2018
2 parents 4cd5e7e + d71a4a3 commit 8120588
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class DamAddedMassConditionProcess : public Process
Parameters default_parameters(R"(
{
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"mesh_id": 0,
"variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME",
"Modify" : true,
"Gravity_Direction" : "Y",
Expand All @@ -65,7 +64,6 @@ class DamAddedMassConditionProcess : public Process
// Now validate agains defaults -- this also ensures no type mismatch
rParameters.ValidateAndAssignDefaults(default_parameters);

mMeshId = rParameters["mesh_id"].GetInt();
mVariableName = rParameters["variable_name"].GetString();
mGravityDirection = rParameters["Gravity_Direction"].GetString();
mReferenceCoordinate = rParameters["Reservoir_Bottom_Coordinate_in_Gravity_Direction"].GetDouble();
Expand All @@ -87,7 +85,7 @@ class DamAddedMassConditionProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
int direction;
double added_mass;

Expand All @@ -102,7 +100,7 @@ class DamAddedMassConditionProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -141,7 +139,7 @@ class DamAddedMassConditionProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
int direction;
double added_mass;

Expand All @@ -156,7 +154,7 @@ class DamAddedMassConditionProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -211,7 +209,6 @@ class DamAddedMassConditionProcess : public Process
/// Member Variables

ModelPart &mrModelPart;
std::size_t mMeshId;
std::string mVariableName;
std::string mGravityDirection;
double mReferenceCoordinate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class DamAzenhaHeatFluxProcess : public Process
Parameters default_parameters(R"(
{
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"mesh_id": 0,
"variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME",
"activation_energy" : 0.0,
"gas_constant" : 0.0,
Expand All @@ -68,7 +67,6 @@ class DamAzenhaHeatFluxProcess : public Process
// Now validate agains defaults -- this also ensures no type mismatch
rParameters.ValidateAndAssignDefaults(default_parameters);

mMeshId = rParameters["mesh_id"].GetInt();
mVariableName = rParameters["variable_name"].GetString();
mActivationEnergy = rParameters["activation_energy"].GetDouble();
mGasConstant = rParameters["gas_constant"].GetDouble();
Expand Down Expand Up @@ -100,12 +98,12 @@ class DamAzenhaHeatFluxProcess : public Process

if (mAging == false)
{
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -139,13 +137,13 @@ class DamAzenhaHeatFluxProcess : public Process

if (mAging == false)
{
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
double delta_time = mrModelPart.GetProcessInfo()[DELTA_TIME];

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -185,12 +183,12 @@ class DamAzenhaHeatFluxProcess : public Process
{
KRATOS_TRY;

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -218,13 +216,13 @@ class DamAzenhaHeatFluxProcess : public Process
{
KRATOS_TRY;

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
double delta_time = mrModelPart.GetProcessInfo()[DELTA_TIME];

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -277,7 +275,6 @@ class DamAzenhaHeatFluxProcess : public Process
protected:
/// Member Variables
ModelPart &mrModelPart;
std::size_t mMeshId;
std::string mVariableName;
double mActivationEnergy;
double mGasConstant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class DamBofangConditionTemperatureProcess : public Process
Parameters default_parameters(R"(
{
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"mesh_id": 0,
"variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME",
"is_fixed" : false,
"Gravity_Direction" : "Y",
Expand All @@ -72,7 +71,6 @@ class DamBofangConditionTemperatureProcess : public Process
// Now validate agains defaults -- this also ensures no type mismatch
rParameters.ValidateAndAssignDefaults(default_parameters);

mMeshId = rParameters["mesh_id"].GetInt();
mVariableName = rParameters["variable_name"].GetString();
mIsFixed = rParameters["is_fixed"].GetBool();
mGravityDirection = rParameters["Gravity_Direction"].GetString();
Expand Down Expand Up @@ -112,7 +110,7 @@ class DamBofangConditionTemperatureProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
int direction;

if (mGravityDirection == "X")
Expand All @@ -124,7 +122,7 @@ class DamBofangConditionTemperatureProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -173,7 +171,7 @@ class DamBofangConditionTemperatureProcess : public Process
mMonth = mpTableMonth->GetValue(time);
}

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();
int direction;

if (mGravityDirection == "X")
Expand All @@ -185,7 +183,7 @@ class DamBofangConditionTemperatureProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -219,12 +217,12 @@ class DamBofangConditionTemperatureProcess : public Process

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

if (nnodes != 0)
{

ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -260,7 +258,6 @@ class DamBofangConditionTemperatureProcess : public Process
/// Member Variables

ModelPart &mrModelPart;
std::size_t mMeshId;
std::string mVariableName;
std::string mGravityDirection;
bool mIsFixed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class DamChemoMechanicalAgingYoungProcess : public Process
Parameters default_parameters(R"(
{
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"mesh_id": 0,
"variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME",
"initial_elastic_modulus" : 30.0e9,
"initial_porosity" : 0.2,
Expand All @@ -64,7 +63,6 @@ class DamChemoMechanicalAgingYoungProcess : public Process
// Now validate agains defaults -- this also ensures no type mismatch
rParameters.ValidateAndAssignDefaults(default_parameters);

mMeshId = rParameters["mesh_id"].GetInt();
mVariableName = rParameters["variable_name"].GetString();
mInitialElasticModulus = rParameters["initial_elastic_modulus"].GetDouble();
mInitialPorosity = rParameters["initial_porosity"].GetDouble();
Expand All @@ -91,7 +89,7 @@ class DamChemoMechanicalAgingYoungProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

// This model works in years so it is necessary to convert time in this unit
double time = mrModelPart.GetProcessInfo()[TIME] / 31536000.0;
Expand All @@ -104,7 +102,7 @@ class DamChemoMechanicalAgingYoungProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand All @@ -124,7 +122,7 @@ class DamChemoMechanicalAgingYoungProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

// This model works in years so it is necessary to convert time in this unit
double time = mrModelPart.GetProcessInfo()[TIME] / 31536000.0;
Expand All @@ -137,7 +135,7 @@ class DamChemoMechanicalAgingYoungProcess : public Process

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -174,7 +172,6 @@ class DamChemoMechanicalAgingYoungProcess : public Process
protected:
/// Member Variables
ModelPart &mrModelPart;
std::size_t mMeshId;
std::string mVariableName;
double mInitialElasticModulus;
double mInitialPorosity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class DamFixTemperatureConditionProcess : public Process
Parameters default_parameters(R"(
{
"model_part_name" : "PLEASE_CHOOSE_MODEL_PART_NAME",
"mesh_id" : 0,
"variable_name" : "PLEASE_PRESCRIBE_VARIABLE_NAME",
"is_fixed" : false,
"value" : 0.0,
Expand All @@ -62,7 +61,6 @@ class DamFixTemperatureConditionProcess : public Process
// Now validate agains defaults -- this also ensures no type mismatch
rParameters.ValidateAndAssignDefaults(default_parameters);

mMeshId = rParameters["mesh_id"].GetInt();
mVariableName = rParameters["variable_name"].GetString();
mIsFixed = rParameters["is_fixed"].GetBool();
mTemperature = rParameters["value"].GetDouble();
Expand All @@ -89,11 +87,11 @@ class DamFixTemperatureConditionProcess : public Process
KRATOS_TRY;

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);
const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -129,11 +127,11 @@ class DamFixTemperatureConditionProcess : public Process
mTemperature = mpTable->GetValue(time);
}

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

if (nnodes != 0)
{
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -161,12 +159,12 @@ class DamFixTemperatureConditionProcess : public Process

Variable<double> var = KratosComponents<Variable<double>>::Get(mVariableName);

const int nnodes = mrModelPart.GetMesh(mMeshId).Nodes().size();
const int nnodes = mrModelPart.GetMesh(0).Nodes().size();

if (nnodes != 0)
{

ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(mMeshId).NodesBegin();
ModelPart::NodesContainerType::iterator it_begin = mrModelPart.GetMesh(0).NodesBegin();

#pragma omp parallel for
for (int i = 0; i < nnodes; i++)
Expand Down Expand Up @@ -202,7 +200,6 @@ class DamFixTemperatureConditionProcess : public Process
/// Member Variables

ModelPart &mrModelPart;
std::size_t mMeshId;
std::string mVariableName;
std::string mGravityDirection;
bool mIsFixed;
Expand Down
Loading

0 comments on commit 8120588

Please sign in to comment.