Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if param is integer, read it as double, it's not a mistake #12751

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jginternational
Copy link
Member

@jginternational jginternational commented Oct 14, 2024

Having this input in ConvectionDiffusionMaterials.json

{
    "properties" : [{
        "model_part_name" : "ThermalModelPart.Heating",
        "properties_id"   : 2,
        "Material"        : {
            "Variables" : {
                "DENSITY"       : 0.0,
                "CONDUCTIVITY"  : 10,
                "SPECIFIC_HEAT" : 0.0
            },
            "Tables"    : null
        }
    }]
}

fails, because the read function says that conductivity value is not properly set.

This allows the user to set 10 instead of 10.0

@rubenzorrilla (lo pongo como draft porque no se si es mejor esta solución, o hacer un mensaje de error más explicativo sobre cual de los parámetros falla, y que el usuario lo corrija)

@@ -472,7 +472,7 @@ def _assign_nodally_properties(self):
for key, value in mat["Variables"].items():
var = KratosMultiphysics.KratosGlobals.GetVariable(key)
if (self._check_variable_to_set(var)):
if value.IsDouble():
if value.IsDouble() or value.IsInt():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if value.IsDouble() or value.IsInt():
if value.IsNumber():

perhaps that makes more sense here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd follow @philbucher's suggestion in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants