Skip to content

Commit ee7604b

Browse files
committed
the black format test works! formatting 6 files as it suggests
1 parent 115bd05 commit ee7604b

File tree

6 files changed

+81
-45
lines changed

6 files changed

+81
-45
lines changed

docs/conf.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,35 @@
1212
#
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('../pvade'))
15+
16+
sys.path.insert(0, os.path.abspath("../pvade"))
1617

1718

1819
# -- Project information -----------------------------------------------------
1920

20-
project = 'PVade'
21-
copyright = '2023, Walid Arsalane, Ethan Young'
22-
author = 'Walid Arsalane, Ethan Young'
21+
project = "PVade"
22+
copyright = "2023, Walid Arsalane, Ethan Young"
23+
author = "Walid Arsalane, Ethan Young"
2324

2425

2526
# -- General configuration ---------------------------------------------------
2627

2728
# Add any Sphinx extension module names here, as strings. They can be
2829
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2930
# ones.
30-
extensions = ['sphinx.ext.autodoc',
31-
'sphinx.ext.napoleon',
32-
'sphinx.ext.autosectionlabel'
31+
extensions = [
32+
"sphinx.ext.autodoc",
33+
"sphinx.ext.napoleon",
34+
"sphinx.ext.autosectionlabel",
3335
]
3436

3537
# Add any paths that contain templates here, relative to this directory.
36-
templates_path = ['_templates']
38+
templates_path = ["_templates"]
3739

3840
# List of patterns, relative to source directory, that match files and
3941
# directories to ignore when looking for source files.
4042
# This pattern also affects html_static_path and html_extra_path.
41-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
43+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4244

4345

4446
# -- Options for HTML output -------------------------------------------------
@@ -47,11 +49,11 @@
4749
# a list of builtin themes.
4850
#
4951
# html_theme = 'alabaster'
50-
html_theme = 'sphinx_rtd_theme'
52+
html_theme = "sphinx_rtd_theme"
5153

5254
# Add any paths that contain custom static files (such as style sheets) here,
5355
# relative to this directory. They are copied after the builtin static files,
5456
# so a file named "default.css" will overwrite the builtin "default.css".
55-
html_static_path = ['_static']
57+
html_static_path = ["_static"]
5658

57-
autoclass_content = 'both'
59+
autoclass_content = "both"

ns_main.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111

1212

1313
def main():
14-
1514
# Get the path to the input file from the command line
1615
# input_file = get_input_file()
17-
input_file = "inputs/2d_cyld.yaml" #get_input_file()
16+
input_file = "inputs/2d_cyld.yaml" # get_input_file()
1817

1918
# Load the parameters object specified by the input file
2019
params = SimParams(input_file)

pvade/FlowManager.py

+43-15
Original file line numberDiff line numberDiff line change
@@ -304,62 +304,90 @@ def _locate_boundary_dofs_tags(self, domain):
304304
Args:
305305
domain (:obj:`pvade.geometry.MeshManager.Domain`): A Domain object
306306
307-
"""
307+
"""
308308
self.x_min_V_dofs = dolfinx.fem.locate_dofs_topological(
309-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["x_min"]["idx"])
309+
self.V,
310+
self.facet_dim,
311+
domain.ft.find(domain.domain_markers["x_min"]["idx"]),
310312
)
311313

312314
self.x_max_V_dofs = dolfinx.fem.locate_dofs_topological(
313-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["x_max"]["idx"])
315+
self.V,
316+
self.facet_dim,
317+
domain.ft.find(domain.domain_markers["x_max"]["idx"]),
314318
)
315319

316320
self.y_min_V_dofs = dolfinx.fem.locate_dofs_topological(
317-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["y_min"]["idx"])
321+
self.V,
322+
self.facet_dim,
323+
domain.ft.find(domain.domain_markers["y_min"]["idx"]),
318324
)
319325

320326
self.y_max_V_dofs = dolfinx.fem.locate_dofs_topological(
321-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["y_max"]["idx"])
327+
self.V,
328+
self.facet_dim,
329+
domain.ft.find(domain.domain_markers["y_max"]["idx"]),
322330
)
323331
if self.ndim == 3:
324332
self.z_min_V_dofs = dolfinx.fem.locate_dofs_topological(
325-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["z_min"]["idx"])
333+
self.V,
334+
self.facet_dim,
335+
domain.ft.find(domain.domain_markers["z_min"]["idx"]),
326336
)
327337

328338
self.z_max_V_dofs = dolfinx.fem.locate_dofs_topological(
329-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["z_max"]["idx"])
339+
self.V,
340+
self.facet_dim,
341+
domain.ft.find(domain.domain_markers["z_max"]["idx"]),
330342
)
331343

332344
self.internal_surface_V_dofs = dolfinx.fem.locate_dofs_topological(
333-
self.V, self.facet_dim, domain.ft.find(domain.domain_markers["internal_surface"]["idx"])
345+
self.V,
346+
self.facet_dim,
347+
domain.ft.find(domain.domain_markers["internal_surface"]["idx"]),
334348
)
335349

336350
self.x_min_Q_dofs = dolfinx.fem.locate_dofs_topological(
337-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["x_min"]["idx"])
351+
self.Q,
352+
self.facet_dim,
353+
domain.ft.find(domain.domain_markers["x_min"]["idx"]),
338354
)
339355

340356
self.x_max_Q_dofs = dolfinx.fem.locate_dofs_topological(
341-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["x_max"]["idx"])
357+
self.Q,
358+
self.facet_dim,
359+
domain.ft.find(domain.domain_markers["x_max"]["idx"]),
342360
)
343361

344362
self.y_min_Q_dofs = dolfinx.fem.locate_dofs_topological(
345-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["y_min"]["idx"])
363+
self.Q,
364+
self.facet_dim,
365+
domain.ft.find(domain.domain_markers["y_min"]["idx"]),
346366
)
347367

348368
self.y_max_Q_dofs = dolfinx.fem.locate_dofs_topological(
349-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["y_max"]["idx"])
369+
self.Q,
370+
self.facet_dim,
371+
domain.ft.find(domain.domain_markers["y_max"]["idx"]),
350372
)
351373

352374
if self.ndim == 3:
353375
self.z_min_Q_dofs = dolfinx.fem.locate_dofs_topological(
354-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["z_min"]["idx"])
376+
self.Q,
377+
self.facet_dim,
378+
domain.ft.find(domain.domain_markers["z_min"]["idx"]),
355379
)
356380

357381
self.z_max_Q_dofs = dolfinx.fem.locate_dofs_topological(
358-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["z_max"]["idx"])
382+
self.Q,
383+
self.facet_dim,
384+
domain.ft.find(domain.domain_markers["z_max"]["idx"]),
359385
)
360386

361387
self.internal_surface_Q_dofs = dolfinx.fem.locate_dofs_topological(
362-
self.Q, self.facet_dim, domain.ft.find(domain.domain_markers["internal_surface"]["idx"])
388+
self.Q,
389+
self.facet_dim,
390+
domain.ft.find(domain.domain_markers["internal_surface"]["idx"]),
363391
)
364392

365393
def _applybc(self, value, domain, V, marker):

pvade/geometry/MeshManager3d.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def __init__(self, params):
3232
self._get_domain_markers()
3333

3434
def _get_domain_markers(self):
35-
3635
self.domain_markers = {}
3736

3837
# Facet Markers
@@ -43,13 +42,16 @@ def _get_domain_markers(self):
4342
self.domain_markers["z_min"] = {"idx": 5, "entity": "facet", "gmsh_tags": []}
4443
self.domain_markers["z_max"] = {"idx": 6, "entity": "facet", "gmsh_tags": []}
4544

46-
self.domain_markers["internal_surface"] = {"idx": 7, "entity": "facet", "gmsh_tags": []}
45+
self.domain_markers["internal_surface"] = {
46+
"idx": 7,
47+
"entity": "facet",
48+
"gmsh_tags": [],
49+
}
4750

4851
# Cell Markers
4952
self.domain_markers["fluid"] = {"idx": 8, "entity": "cell", "gmsh_tags": []}
5053
self.domain_markers["structure"] = {"idx": 9, "entity": "cell", "gmsh_tags": []}
5154

52-
5355
def build(self, params):
5456
"""This function call builds the geometry, marks the boundaries and creates a mesh using Gmsh."""
5557

@@ -62,13 +64,14 @@ def build(self, params):
6264
except:
6365
raise ValueError(f"Could not import {domain_creation_module}")
6466

65-
6667
self.geometry = dcm.DomainCreation(params)
6768

6869
# Only rank 0 builds the geometry and meshes the domain
6970
if self.rank == 0:
7071
self.geometry.build(params)
71-
self.domain_markers = self.geometry.mark_surfaces(params, self.domain_markers)
72+
self.domain_markers = self.geometry.mark_surfaces(
73+
params, self.domain_markers
74+
)
7275
self.geometry.set_length_scales(params, self.domain_markers)
7376

7477
if params.fluid.periodic:

pvade/geometry/template/TemplateDomainCreation.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,26 @@ def mark_surfaces(self, params, domain_markers):
9090
else:
9191
domain_markers["internal_surface"]["gmsh_tags"].append(tag)
9292

93-
9493
# self.gmsh_model.addPhysicalGroup(self.ndim, [1], domain_marker_idx["fluid"])
9594
# self.gmsh_model.setPhysicalName(self.ndim, domain_marker_idx["fluid"], "fluid")
96-
# TODO: this is a hack to add fluid tags, need to loop through cells
97-
# as we do for facets and mark fluid and structure
95+
# TODO: this is a hack to add fluid tags, need to loop through cells
96+
# as we do for facets and mark fluid and structure
9897
domain_markers["fluid"]["gmsh_tags"].append(1)
9998

10099
for key, data in domain_markers.items():
101100
if len(data["gmsh_tags"]) > 0:
102101
# Cells (i.e., entities of dim = msh.topology.dim)
103102
if data["entity"] == "cell":
104-
self.gmsh_model.addPhysicalGroup(self.ndim, data["gmsh_tags"], data["idx"])
103+
self.gmsh_model.addPhysicalGroup(
104+
self.ndim, data["gmsh_tags"], data["idx"]
105+
)
105106
self.gmsh_model.setPhysicalName(self.ndim, data["idx"], key)
106107

107108
# Facets (i.e., entities of dim = msh.topology.dim - 1)
108109
if data["entity"] == "facet":
109-
self.gmsh_model.addPhysicalGroup(self.ndim-1, data["gmsh_tags"], data["idx"])
110-
self.gmsh_model.setPhysicalName(self.ndim-1, data["idx"], key)
110+
self.gmsh_model.addPhysicalGroup(
111+
self.ndim - 1, data["gmsh_tags"], data["idx"]
112+
)
113+
self.gmsh_model.setPhysicalName(self.ndim - 1, data["idx"], key)
111114

112115
return domain_markers
113-

setup.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from setuptools import setup
22

3-
setup(name = 'PV Aerodynamic Design Engineering, PVade',
4-
version = '0.0',
5-
packages = ['pvade'],
6-
zip_safe = False)
3+
setup(
4+
name="PV Aerodynamic Design Engineering, PVade",
5+
version="0.0",
6+
packages=["pvade"],
7+
zip_safe=False,
8+
)

0 commit comments

Comments
 (0)