Skip to content

Commit

Permalink
Issue #336, application names have been changed to BaramFlow and Bara…
Browse files Browse the repository at this point in the history
…mMesh
  • Loading branch information
jiban committed Oct 11, 2023
1 parent ccb2eaa commit 9d536d2
Show file tree
Hide file tree
Showing 478 changed files with 883 additions and 866 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion baram/app.py → baramFlow/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from PySide6.QtWidgets import QApplication

from resources import resource
from baram.coredb.app_settings import AppSettings
from baramFlow.coredb.app_settings import AppSettings


class App(QObject):
Expand Down
6 changes: 3 additions & 3 deletions baram/app_plug_in.py → baramFlow/app_plug_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from PySide6.QtCore import QObject

from baram.app import app
from baram.view.main_window.main_window import MainWindow
from baram.view.case_wizard.case_wizard import CaseWizard
from baramFlow.app import app
from baramFlow.view.main_window.main_window import MainWindow
from baramFlow.view.case_wizard.case_wizard import CaseWizard


class AppPlugIn(QObject):
Expand Down
File renamed without changes.
File renamed without changes.
36 changes: 22 additions & 14 deletions baram/coredb/app_settings.py → baramFlow/coredb/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shutil
from enum import Enum
from pathlib import Path
from typing import Optional

from PySide6.QtCore import QLocale, QRect

Expand Down Expand Up @@ -42,6 +43,15 @@ def setup(cls, name):
cls._settingsFile = cls._settingsPath / 'baram.cfg.yaml'
cls._applicationLockFile = cls._settingsPath / 'baram.lock'

# ToDo: For compatibility. Remove this code block after 20241201
# Migration from previous name of "BaramFlow"
# Begin
if name == 'BaramFlow':
oldPath = Path.home().joinpath('.baram')
if not cls._settingsPath.exists() and oldPath.is_dir():
oldPath.replace(cls._settingsPath)
# End

cls._settingsPath.mkdir(exist_ok=True)
cls._casesPath.mkdir(exist_ok=True)

Expand Down Expand Up @@ -136,37 +146,35 @@ def setLanguage(cls, language):
cls._save(settings)

@classmethod
def getParaviewInstalledPath(cls):
return cls._get(SettingKey.PARAVIEW_INSTALLED_PATH, '')

@classmethod
def updateParaviewInstalledPath(cls, path):
def updateParaviewInstalledPath(cls, path: Path):
settings = cls._load()
settings[SettingKey.PARAVIEW_INSTALLED_PATH.value] = str(path)
cls._save(settings)

@classmethod
def findParaviewInstalledPath(cls):
def validate(path, update=True):
if path and Path(path).exists():
if update:
cls.updateParaviewInstalledPath(path)
def findParaviewInstalledPath(cls) -> Optional[Path]:
def validate(pathString: str, update=True):
if pathString:
path = Path(pathString)
if path.is_file():
if update:
cls.updateParaviewInstalledPath(path)

return str(path)
return path

return None

if path := validate(cls.getParaviewInstalledPath(), False):
if path := validate(cls._get(SettingKey.PARAVIEW_INSTALLED_PATH, ''), False):
return path

if path := validate(Path(shutil.which('paraview'))):
if path := validate(shutil.which('paraview')):
return path

if platform.system() == 'Windows':
# Search the unique paraview executable file.
paraviewHomes = list(Path(os.environ.get('PROGRAMFILES')).glob('paraview*'))
if len(paraviewHomes) == 1:
if path := validate(paraviewHomes[0] / 'bin/paraview.exe'):
if path := validate(str(paraviewHomes[0] / 'bin/paraview.exe')):
return path

return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from PySide6.QtCore import QCoreApplication

from baram.coredb import coredb
from baram.view.widgets.multi_selector_dialog import SelectorItem
from baramFlow.coredb import coredb
from baramFlow.view.widgets.multi_selector_dialog import SelectorItem


class BoundaryType(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from enum import Enum

from baram.coredb import coredb
from baram.view.widgets.multi_selector_dialog import SelectorItem
from baramFlow.coredb import coredb
from baramFlow.view.widgets.multi_selector_dialog import SelectorItem


class ZoneType(Enum):
Expand Down
2 changes: 1 addition & 1 deletion baram/coredb/coredb.py → baramFlow/coredb/coredb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import resource_rc

from resources import resource
from baram.coredb import migrate
from baramFlow.coredb import migrate

ns = 'http://www.baramcfd.org/baram'
nsmap = {'': ns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from PySide6.QtCore import QCoreApplication

from baram.coredb.coredb import CoreDB, Error
from baramFlow.coredb.coredb import CoreDB, Error


class WriteItem:
Expand Down
2 changes: 1 addition & 1 deletion baram/coredb/filedb.py → baramFlow/coredb/filedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pandas as pd
import h5py

from baram.coredb import coredb
from baramFlow.coredb import coredb


class BcFileRole(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from enum import Enum

from baram.coredb import coredb
from baramFlow.coredb import coredb


class SolverType(Enum):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb import coredb
from baramFlow.coredb import coredb


class InitializationDB:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from PySide6.QtCore import QCoreApplication

from baram.coredb import coredb
from baramFlow.coredb import coredb

UNIVERSAL_GAL_CONSTANT = 8314.46261815324

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from PySide6.QtCore import QCoreApplication

from baram.coredb import coredb
from baramFlow.coredb import coredb


class MultiphaseModel(Enum):
Expand Down
8 changes: 4 additions & 4 deletions baram/coredb/monitor_db.py → baramFlow/coredb/monitor_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from PySide6.QtCore import QCoreApplication

from baram.coredb import coredb
from baram.coredb.models_db import ModelsDB, TurbulenceModel
from baram.coredb.general_db import GeneralDB
from baram.coredb.material_db import MaterialDB, Phase
from baramFlow.coredb import coredb
from baramFlow.coredb.models_db import ModelsDB, TurbulenceModel
from baramFlow.coredb.general_db import GeneralDB
from baramFlow.coredb.material_db import MaterialDB, Phase


class Field(Enum):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion baram/coredb/project.py → baramFlow/coredb/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pathlib import Path

from libbaram import process
from baram.coredb import coredb
from baramFlow.coredb import coredb
from .project_settings import ProjectSettings, ProjectSettingKey
from .app_settings import AppSettings
from .filedb import FileDB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import yaml

from baram.coredb.app_settings import AppSettings
from baramFlow.coredb.app_settings import AppSettings


SETTINGS_FILE_NAME = 'case.cfg.yaml'
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions baram/coredb/region_db.py → baramFlow/coredb/region_db.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb import coredb
from baram.coredb.material_db import MaterialDB, Phase
from baram.coredb.initialization_db import InitializationDB
from baram.coredb.models_db import ModelsDB
from baramFlow.coredb import coredb
from baramFlow.coredb.material_db import MaterialDB, Phase
from baramFlow.coredb.initialization_db import InitializationDB
from baramFlow.coredb.models_db import ModelsDB


DEFAULT_REGION_NAME = 'region0'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions baram/main.py → baramFlow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# noinspection PyUnresolvedReferences
import resource_rc

from baram.app import app
from baram.app_properties import AppProperties
from baram.app_plug_in import AppPlugIn
from baram.view.main_window.start_window import Baram
from baram.coredb.app_settings import AppSettings
from baramFlow.app import app
from baramFlow.app_properties import AppProperties
from baramFlow.app_plug_in import AppPlugIn
from baramFlow.view.main_window.start_window import Baram
from baramFlow.coredb.app_settings import AppSettings


logger = logging.getLogger()
Expand All @@ -47,10 +47,10 @@ def handle_exception(eType, eValue, eTraceback):

def main():
app.setupApplication(AppProperties({
'name': 'baram',
'fullName': QApplication.translate('Main', 'Baram'),
'iconResource': 'baram.ico',
'logoResource': 'baram.ico',
'name': 'BaramFlow',
'fullName': QApplication.translate('Main', 'BaramFlow'),
'iconResource': 'baramFlow.ico',
'logoResource': 'baramFlow.ico',
}))
app.setPlug(AppPlugIn())

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions baram/mesh/mesh_manager.py → baramFlow/mesh/mesh_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from enum import Enum, auto
from pathlib import Path

from baram.openfoam.redistribution_task import RedistributionTask
from baramFlow.openfoam.redistribution_task import RedistributionTask
from libbaram.run import runUtility, runParallelUtility
from widgets.progress_dialog import ProgressDialog

from baram.openfoam import parallel
from baram.openfoam.file_system import FileSystem
from baram.openfoam.polymesh.polymesh_loader import PolyMeshLoader
from baramFlow.openfoam import parallel
from baramFlow.openfoam.file_system import FileSystem
from baramFlow.openfoam.polymesh.polymesh_loader import PolyMeshLoader
from libbaram.process import Processor


Expand Down
4 changes: 2 additions & 2 deletions baram/mesh/mesh_model.py → baramFlow/mesh/mesh_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from PySide6.QtCore import QObject, Signal

from baram.app import app
from baram.view.main_window.rendering_view import DisplayMode
from baramFlow.app import app
from baramFlow.view.main_window.rendering_view import DisplayMode


_applyDisplayMode = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, ContactAngleModel, InterfaceMode
from baram.coredb.models_db import ModelsDB
from baram.coredb.material_db import MaterialDB
from baram.coredb.region_db import RegionDB
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, ContactAngleModel, InterfaceMode
from baramFlow.coredb.models_db import ModelsDB
from baramFlow.coredb.material_db import MaterialDB
from baramFlow.coredb.region_db import RegionDB
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class Alpha(BoundaryCondition):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, WallVelocityCondition, InterfaceMode, WallTemperature
from baram.coredb.models_db import ModelsDB
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, WallVelocityCondition, InterfaceMode, WallTemperature
from baramFlow.coredb.models_db import ModelsDB
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class Alphat(BoundaryCondition):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

from libbaram.openfoam.dictionary.dictionary_file import DictionaryFile, DataClass

from baram.coredb import coredb
from baram.coredb.material_db import MaterialDB
from baram.coredb.models_db import TurbulenceModel
from baram.coredb.region_db import RegionDB
from baram.openfoam.constant.boundary_data import BoundaryData
from baram.openfoam.file_system import FileSystem
from baramFlow.coredb import coredb
from baramFlow.coredb.material_db import MaterialDB
from baramFlow.coredb.models_db import TurbulenceModel
from baramFlow.coredb.region_db import RegionDB
from baramFlow.openfoam.constant.boundary_data import BoundaryData
from baramFlow.openfoam.file_system import FileSystem

logger = logging.getLogger(__name__)
# logger.setLevel(logging.INFO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, KEpsilonSpecification, WallVelocityCondition, InterfaceMode
from baram.coredb.models_db import ModelsDB, TurbulenceModel
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, KEpsilonSpecification, WallVelocityCondition, InterfaceMode
from baramFlow.coredb.models_db import ModelsDB, TurbulenceModel
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class Epsilon(BoundaryCondition):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, KEpsilonSpecification, KOmegaSpecification, InterfaceMode
from baram.coredb.models_db import ModelsDB, TurbulenceModel
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, KEpsilonSpecification, KOmegaSpecification, InterfaceMode
from baramFlow.coredb.models_db import ModelsDB, TurbulenceModel
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class K(BoundaryCondition):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, SpalartAllmarasSpecification, InterfaceMode
from baram.coredb.models_db import ModelsDB, TurbulenceModel
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, SpalartAllmarasSpecification, InterfaceMode
from baramFlow.coredb.models_db import ModelsDB, TurbulenceModel
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class NuTilda(BoundaryCondition):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from baram.coredb.boundary_db import BoundaryDB, BoundaryType, WallVelocityCondition, InterfaceMode
from baram.coredb.models_db import ModelsDB, TurbulenceModel
from baram.openfoam.boundary_conditions.boundary_condition import BoundaryCondition
from baramFlow.coredb.boundary_db import BoundaryDB, BoundaryType, WallVelocityCondition, InterfaceMode
from baramFlow.coredb.models_db import ModelsDB, TurbulenceModel
from baramFlow.openfoam.boundary_conditions.boundary_condition import BoundaryCondition


class Nut(BoundaryCondition):
Expand Down
Loading

0 comments on commit 9d536d2

Please sign in to comment.