Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions mach_eval/analyzers/electromagnetic/SynR/SynR_em_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def analyze(self, problem):
model.SetName(self.project_name)
model.SetDescription(self.show(self.project_name, toString=True))

valid_design = self.pre_process(model)
valid_design = self.pre_process(app, model)

if not valid_design:
raise InvalidDesign
Expand Down Expand Up @@ -403,7 +403,7 @@ def show(self, name, toString=False):
"%s = %s" % item for item in tuple_list
)

def pre_process(self, model):
def pre_process(self, app, model):
# pre-process : you can select part by coordinate!
"""Group"""

Expand All @@ -427,6 +427,13 @@ def group(name, id_list):

group("Coils", partIDRange_Coil)

# """ Set Parts names """

app.GetModel(0).SetPartName(id_rotorCore, u"RotorCore")
app.GetModel(0).SetPartName(id_shaft, u"Shaft")
app.GetModel(0).SetPartName(id_statorCore, u"StatorCore")


""" Add Part to Set for later references """

def add_part_to_set(name, x, y, ID=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def analyze(self, problem):
model.SetName(self.project_name)
model.SetDescription(self.show(self.project_name, toString=True))

valid_design = self.pre_process(model)
valid_design = self.pre_process(app, model)

if not valid_design:
raise InvalidDesign
Expand Down Expand Up @@ -385,7 +385,7 @@ def show(self, name, toString=False):
"%s = %s" % item for item in tuple_list
)

def pre_process(self, model):
def pre_process(self, app, model):
# pre-process : you can select part by coordinate!
"""Group"""

Expand All @@ -409,6 +409,12 @@ def group(name, id_list):

group("Coils", partIDRange_Coil)

# """ Set Parts names """

app.GetModel(0).SetPartName(id_rotorCore, u"RotorCore")
app.GetModel(0).SetPartName(id_shaft, u"Shaft")
app.GetModel(0).SetPartName(id_statorCore, u"StatorCore")

""" Add Part to Set for later references """

def add_part_to_set(name, x, y, ID=None):
Expand Down
8 changes: 7 additions & 1 deletion mach_eval/analyzers/electromagnetic/bspm/jmag_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def group(name, id_list):
id_shaft = part_ID_list[1]
partIDRange_Magnet = part_ID_list[2 : int(2 + self.machine_variant.p * 2)]
# id_sleeve = part_ID_list[int(2 + self.machine_variant.p * 2)]
id_statorCore = part_ID_list[int(2 + self.machine_variant.p * 2) + 1]
id_statorCore = part_ID_list[int(2 + self.machine_variant.p * 2)]
partIDRange_Coil = part_ID_list[
int(1 + self.machine_variant.p * 2)
+ 2 : int(2 + self.machine_variant.p * 2)
Expand All @@ -318,6 +318,12 @@ def group(name, id_list):
group("Magnet", partIDRange_Magnet)
group("Coils", partIDRange_Coil)

# """ Set Parts names """

app.GetModel(0).SetPartName(id_backiron, u"NotchedRotor")
app.GetModel(0).SetPartName(id_shaft, u"Shaft")
app.GetModel(0).SetPartName(id_statorCore, u"StatorCore")

""" Add Part to Set for later references """

def add_part_to_set(name, x, y, ID=None):
Expand Down