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

Updates in Domain_Class #320

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Updates in Domain_Class #320

merged 2 commits into from
Dec 20, 2023

Conversation

shishiousan
Copy link
Member

- fixing the issue #317
- Import methods from toml file are added
@shishiousan shishiousan added enhancement New feature or request mesh toml labels Dec 20, 2023
@shishiousan shishiousan added this to the v23.10.2 milestone Dec 20, 2023
@shishiousan shishiousan self-assigned this Dec 20, 2023
Copy link
Member

@vickysharma0812 vickysharma0812 left a comment

Choose a reason for hiding this comment

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

You can reduce the code in ImportFromToml2 by following the code given in AbstractBC_Class@IOMethods.F90.

MODULE PROCEDURE bc_ImportFromToml2
CHARACTER(*), PARAMETER :: myName = "bc_ImportFromToml2()"
TYPE(toml_table), ALLOCATABLE :: table
TYPE(toml_table), POINTER :: node
INTEGER(I4B) :: origin, stat

#ifdef DEBUG_VER
CALL e%RaiseInformation(modName//'::'//myName//' - '// &
  & '[START] ImportFromToml()')
#endif

IF (PRESENT(afile)) THEN
  CALL GetValue(table=table, afile=afile)
ELSEIF (PRESENT(filename)) THEN
  CALL GetValue(table=table, filename=filename)
ELSE
  CALL e%RaiseError(modName//'::'//myName//' - '// &
    & '[ARG ERROR] :: either filename or afile should be present!')
  RETURN
END IF

node => NULL()
CALL toml_get(table, tomlName, node, origin=origin, requested=.FALSE.,  &
  & stat=stat)

IF (.NOT. ASSOCIATED(node)) THEN
  CALL e%RaiseError(modName//'::'//myName//' - '// &
    & '[CONFIG ERROR] :: following error occured while reading '//  &
    & 'the toml file :: cannot find ['//tomlName//"] table in config.")
END IF

CALL obj%ImportFromToml(table=node, dom=dom)

#ifdef DEBUG_VER
IF (PRESENT(printToml)) THEN
  CALL Display(toml_serialize(node), "toml config = "//CHAR_LF,  &
    & unitNo=stdout)
END IF
#endif

#ifdef DEBUG_VER
CALL e%RaiseInformation(modName//'::'//myName//' - '// &
  & '[END] ImportParamFromToml()')
#endif
END PROCEDURE bc_ImportFromToml2

-fixing the issue #317
@shishiousan shishiousan merged commit 8a0d495 into dev Dec 20, 2023
@shishiousan shishiousan deleted the issue317 branch December 20, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mesh toml
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants