def __init__(self, analysis_obj): """ analysis_obj should contains all the information needed, boundaryConditionList is a list of all boundary Conditions objects(FemConstraint) """ self.analysis_obj = analysis_obj self.solver_obj = CfdTools.getSolver(analysis_obj) self.mesh_obj = CfdTools.getMesh(analysis_obj) self.part_obj = self.mesh_obj.Part if not self.part_obj: print( "Error!, mesh has no Part property link to an geometry object") self.dimension = CfdTools.getPartDimension(self.part_obj) self.material_obj = CfdTools.getMaterial(analysis_obj) self.bc_group = CfdTools.getConstraintGroup( analysis_obj) # not work for pure Python constraint yet self.mesh_generated = False # unit schema detection is usful for mesh scaling, boundary type area, pressure calculation self.unit_shema = FreeCAD.ParamGet( "User parameter:BaseApp/Preferences/Units/").GetInt("UserSchema") self.case_file_name = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName + u".json" if self.solver_obj.Parallel: # FIXME: XDMF is the preferred file io for parallel mesh in the future self.mesh_file_name = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName + u".hdf5" else: self.mesh_file_name = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName + u".xml" self.case_settings = OrderedDict( ) # OrderedDict does not support pprint self.case_settings['case_name'] = self.solver_obj.InputCaseName self.case_settings['case_folder'] = self.solver_obj.WorkingDir self.case_settings['case_file'] = self.case_file_name
def __init__(self, analysis_obj): """ analysis_obj should contains all the information needed, boundaryConditionList is a list of all boundary Conditions objects(FemConstraint) """ self.analysis_obj = analysis_obj self.solver_obj = CfdTools.getSolver(analysis_obj) self.mesh_obj = CfdTools.getMesh(analysis_obj) self.material_obj = CfdTools.getMaterial(analysis_obj) self.bc_group = CfdTools.getConstraintGroup(analysis_obj) self.mesh_generated = False self.case_folder = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName self.mesh_file_name = self.case_folder + os.path.sep + self.solver_obj.InputCaseName + u".unv" if self.solver_obj.HeatTransfering: self.builder = fcb.BasicBuilder(self.case_folder, CfdTools.getSolverSettings(self.solver_obj)) else: self.builder = fcb.BasicBuilder(self.case_folder, CfdTools.getSolverSettings(self.solver_obj)) self.builder.createCase()
def __init__(self, analysis_obj): """ analysis_obj should contains all the information needed, boundaryConditionList is a list of all boundary Conditions objects(FemConstraint) """ self.analysis_obj = analysis_obj self.solver_obj = CfdTools.getSolver(analysis_obj) self.mesh_obj = CfdTools.getMesh(analysis_obj) self.material_obj = CfdTools.getMaterial(analysis_obj) self.bc_group = CfdTools.getConstraintGroup(analysis_obj) self.mesh_generated = False # unit schema detection is usful for mesh scaling, boundary type area, pressure calculation self.unit_shema = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units/").GetInt("UserSchema") self.case_file_name = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName + u".json" self.mesh_file_name = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName + u".xml" # Collections.OrderedDict s also can not dump json self.case_settings = {'case_name': self.solver_obj.InputCaseName, 'case_folder': self.solver_obj.WorkingDir, 'case_file': self.case_file_name}
def __init__(self, analysis_obj): """ analysis_obj should contains all the information needed, boundaryConditionList is a list of all boundary Conditions objects(FemConstraint) """ self.analysis_obj = analysis_obj self.solver_obj = CfdTools.getSolver(analysis_obj) self.mesh_obj = CfdTools.getMesh(analysis_obj) self.material_obj = CfdTools.getMaterial(analysis_obj) self.bc_group = CfdTools.getConstraintGroup(analysis_obj) self.mesh_generated = False # unit schema detection is usful for mesh scaling, boundary type area, pressure calculation self.unit_shema = FreeCAD.ParamGet( "User parameter:BaseApp/Preferences/Units/").GetInt("UserSchema") self.case_folder = self.solver_obj.WorkingDir + os.path.sep + self.solver_obj.InputCaseName self.mesh_file_name = self.case_folder + os.path.sep + self.solver_obj.InputCaseName + u".unv" if self.solver_obj.HeatTransfering: self.builder = fcb.BasicBuilder( self.case_folder, CfdTools.getSolverSettings(self.solver_obj)) else: self.builder = fcb.BasicBuilder( self.case_folder, CfdTools.getSolverSettings(self.solver_obj))