Skip to content

Problem_Control_Loop_Solve using Ceiling for time_loop%number_of_iterations #185

@jaredmcollette

Description

@jaredmcollette

In working with reaction diffusion routines, I noticed that FiniteElementCalculate seemed to be called either once or twice per time step (per chemical species/per element) arbitrarily within the same simulation and would switch between being called once or twice without any pattern.

Tracing this bug to the root, I found the variable TIME_LOOP%TIME_INCREMENT would solve to values between 0.99999999999999944 and 1.0000000000000002, but because the CEILING Function is used, this would round to 1 and 2 respectively, when the value should clearly be 1 in both cases.

Switching the function CEILING to instead use NINT (line 464 in Problem_Routines) fixed the bug in my simulation, but I am unsure if it would cause issues in other cases. Was there a particular motivation for using CEILING for the TIME_LOOP%TIME_INCREMENT variable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions