Skip to content

Commit 718c978

Browse files
committed
Fixed formatting and added some sanity checks and stubs for other records
1 parent c63b5f0 commit 718c978

File tree

5 files changed

+524
-217
lines changed

5 files changed

+524
-217
lines changed

include/private/psse.hpp

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ struct Transformer {
159159
std::string name;
160160
int stat;
161161
std::array<Ownership, 4> owners;
162+
std::string vecgrp;
162163
Impedence imp12;
163164
Impedence imp23;
164165
Impedence imp31;
@@ -176,55 +177,113 @@ struct Area {
176177
std::string arname;
177178
};
178179

180+
struct AreaInterchange {};
181+
182+
struct TwoTerminalDCLine {};
183+
184+
struct VSCDCLine {};
185+
186+
struct ImpedanceCorrection {};
187+
188+
struct MultiTerminalDCLine {};
189+
190+
struct MultiSectionLineGroup {};
191+
192+
struct Zone {};
193+
194+
struct InterAreaTransfer {};
195+
196+
struct Owner {};
197+
198+
struct FACTSDevice {};
199+
200+
struct SwitchedShunt {
201+
struct Block {
202+
int n;
203+
double b;
204+
};
205+
std::size_t i;
206+
std::string i_bus_name;
207+
int modsw;
208+
int adjm;
209+
int stat;
210+
double vswhi;
211+
double vswlo;
212+
std::size_t swrem;
213+
std::string swrem_bus_name;
214+
double rmpct;
215+
std::string rmidnt;
216+
double binit;
217+
std::array<Block, 8> blocks;
218+
};
219+
220+
struct GNEDevice {};
221+
179222
class BusMapping {
180223
public:
181224
struct Optional {
182225
operator bool() { return value; }
183226
bool value{false};
184227
};
185228

186-
BusMapping(const std::vector<Bus> &buses);
229+
BusMapping(std::vector<Bus> &buses);
230+
231+
bool HasBus(std::size_t bus_number) const;
232+
bool HasBus(const std::string &bus_name) const;
187233

188-
std::size_t getInternalIndex(std::size_t bus_number) const;
189-
std::size_t getInternalIndex(const std::string &bus_name) const;
234+
std::size_t GetInternalIndex(std::size_t bus_number) const;
235+
std::size_t GetInternalIndex(const std::string &bus_name) const;
190236

191-
std::size_t getBusNumber(const std::string &bus_name) const;
192-
const std::string &getBusName(std::size_t bus_number) const;
237+
std::size_t GetBusNumber(const std::string &bus_name) const;
238+
const std::string &GetBusName(std::size_t bus_number) const;
193239

194-
const Bus &getBus(const std::string &bus_name) const;
195-
const Bus &getBus(std::size_t bus_number) const;
240+
const Bus &GetBus(const std::string &bus_name) const;
241+
const Bus &GetBus(std::size_t bus_number) const;
196242

197-
void resolve(std::size_t &bus_number, std::string &bus_name,
243+
void Resolve(std::size_t &bus_number, std::string &bus_name,
198244
Optional opt = Optional{false}) const;
199245

200246
private:
201-
const std::vector<Bus> &buses_;
247+
std::vector<Bus> &buses_;
202248
std::unordered_map<std::size_t, std::size_t> id_map_;
203249
std::unordered_map<std::string, std::size_t> name_map_;
204250
};
205251

206252
struct Network {
207253
Network(CaseID &&, std::vector<Bus> &&, std::vector<Load> &&,
208254
std::vector<FixedBusShunt> &&, std::vector<Generator> &&,
209-
std::vector<Branch> &&, std::vector<Transformer> &&);
255+
std::vector<Branch> &&, std::vector<Transformer> &&,
256+
std::vector<SwitchedShunt> &&);
210257

211-
void resolveBusIds();
258+
void ResolveBusIds();
212259

213260
std::string file_name;
214261
CaseID case_id;
215262
std::vector<Bus> buses;
216263
BusMapping bus_mapping;
217264
std::vector<Load> loads;
218-
std::vector<FixedBusShunt> shunts;
265+
std::vector<FixedBusShunt> fixed_bus_shunts;
219266
std::vector<Generator> generators;
220267
std::vector<Branch> branches;
221268
std::vector<Transformer> transformers;
269+
// std::vector<AreaInterchange> area_interchanges;
270+
// std::vector<TwoTerminalDCLine> two_terminal_dc_lines;
271+
// std::vector<VSCDCLine> vsc_dc_lines;
272+
// std::vector<ImpedanceCorrection> impedance_corrections;
273+
// std::vector<MultiTerminalDCLine> multi_terminal_dc_lines;
274+
// std::vector<MultiSectionLineGroup> multi_section_line_groups;
275+
// std::vector<Zone> zones;
276+
// std::vector<InterAreaTransfer> inter_area_transfers;
277+
// std::vector<Owner> owners;
278+
// std::vector<FACTSDevice> facts_devices;
279+
std::vector<SwitchedShunt> switched_shunts;
280+
// std::vector<GNEDevice> gne_devices;
222281
};
223282

224-
Network parse_network(std::istream &is);
225-
Network parse_network(const std::string &filename);
283+
Network ParseNetwork(std::istream &is);
284+
Network ParseNetwork(const std::string &filename);
226285

227-
PetscErrorCode convert_to_ps(PS ps, const Network &nw);
286+
PetscErrorCode ConvertToPS(PS ps, const Network &nw);
228287

229288
} // namespace psse
230289
} // namespace exago

0 commit comments

Comments
 (0)