Skip to content

Commit

Permalink
Merge branch 'main' of github.com:LBNL-ETA/frads
Browse files Browse the repository at this point in the history
  • Loading branch information
TammieYu committed Oct 26, 2023
2 parents 97882e0 + 68f0643 commit c70a274
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 17 deletions.
11 changes: 10 additions & 1 deletion frads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@

from .utils import gen_grid, unpack_primitives

from .window import create_glazing_system, Gap, Gas, GlazingSystem, AIR, ARGON, KRYPTON, XENON
from .window import (
create_glazing_system,
Gap,
Gas,
GlazingSystem,
AIR,
ARGON,
KRYPTON,
XENON,
)

__version__ = "1.1.0"

Expand Down
50 changes: 35 additions & 15 deletions frads/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
from scipy.sparse import csr_matrix



logger: logging.Logger = logging.getLogger("frads.methods")


Expand Down Expand Up @@ -840,11 +839,20 @@ def generate_matrices(self, view_matrices: bool = True):
return
if view_matrices:
for _, mtx in self.view_window_matrices.items():
mtx.generate(self.config.settings.view_window_matrix)
mtx.generate(
self.config.settings.view_window_matrix,
nproc=self.config.settings.num_processors,
)
for _, mtx in self.sensor_window_matrices.items():
mtx.generate(self.config.settings.sensor_window_matrix)
mtx.generate(
self.config.settings.sensor_window_matrix,
nproc=self.config.settings.num_processors,
)
for _, mtx in self.daylight_matrices.items():
mtx.generate(self.config.settings.daylight_matrix)
mtx.generate(
self.config.settings.daylight_matrix,
nproc=self.config.settings.num_processors,
)
if self.config.settings.save_matrices:
self.save_matrices()

Expand Down Expand Up @@ -1042,14 +1050,16 @@ def calculate_edgps(
"""
# generate octree with bsdf
stdins = []
stdins.append(gen_perez_sky(
date_time,
self.wea_metadata.latitude,
self.wea_metadata.longitude,
self.wea_metadata.timezone,
dirnorm=dni,
diffhor=dhi,
))
stdins.append(
gen_perez_sky(
date_time,
self.wea_metadata.latitude,
self.wea_metadata.longitude,
self.wea_metadata.timezone,
dirnorm=dni,
diffhor=dhi,
)
)
for wname, sname in bsdf.items():
if (_gms := self.config.model.materials.glazing_materials) != {}:
gmaterial = _gms[sname]
Expand Down Expand Up @@ -1342,12 +1352,22 @@ def generate_matrices(self):
logger.info("Generating matrices...")
logger.info("Step 1/5: Generating view matrices...")
for mtx in self.view_window_matrices.values():
mtx.generate(self.config.settings.view_window_matrix, memmap=True)
mtx.generate(
self.config.settings.view_window_matrix,
memmap=True,
nproc=self.config.settings.num_processors,
)
for mtx in self.sensor_window_matrices.values():
mtx.generate(self.config.settings.sensor_window_matrix)
mtx.generate(
self.config.settings.sensor_window_matrix,
nproc=self.config.settings.num_processors,
)
logger.info("Step 2/5: Generating daylight matrices...")
for mtx in self.daylight_matrices.values():
mtx.generate(self.config.settings.daylight_matrix)
mtx.generate(
self.config.settings.daylight_matrix,
nproc=self.config.settings.num_processors,
)
logger.info("Step 3/5: Generating direct view matrices...")
for _, mtx in self.view_window_direct_matrices.items():
mtx.generate(["-ab", "1"], sparse=True)
Expand Down
1 change: 0 additions & 1 deletion frads/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def from_json(cls, path: Union[str, Path]):
gap_instances.append(Gap(gas=gas_instances, **gap))
return cls(layers=layer_instances, gaps=gap_instances, **data)


def get_brtdfunc(self) -> pr.Primitive:
"""Get a BRTDfunc primitive for the glazing system."""
if any(layer.product_type != "glazing" for layer in self.layers):
Expand Down

0 comments on commit c70a274

Please sign in to comment.