MassimoCimmino / pygfunction

An open-source toolbox for the evaluation of thermal response factors (g-functions) of geothermal borehole fields.
BSD 3-Clause "New" or "Revised" License
46 stars 20 forks source link

Borefield class #260

Open j-c-cook opened 1 year ago

j-c-cook commented 1 year ago

@MassimoCimmino I've modified your Borefield class to utilize property methods that return numpy views of a single private instance of _boreholes.

j-c-cook commented 1 year ago

Current example usage:

import pygfunction as gt

borefield = gt.boreholes.rectangle_field(5, 5, 5, 5, 100, 5, 0.075)

borefield = gt.boreholes.Borefield(borefield)

n = borefield.nBoreholes

H = borefield.H

borehole = gt.boreholes.Borehole(50, 5, 0.075, 70, 70)

borefield.append(borehole)

H = borefield.H

print(H)

borefield.H[0] = 15  # Effects every instance of H (in borefield.H as well)