Best Python code snippet using lemoncheesecake
set_bcs.py
Source:set_bcs.py
1from dolfin import *2import numpy as np3## set boundary conditions4def set_bcs(sim_geometry,protocol,geo_options,mesh,W,facetboundaries,expr):5 output = {}6 if (sim_geometry == "ventricle") or (sim_geometry == "ellipsoid"):7 # if ventricle or ellipsoid simulation, constrain base in longitudinal direction,8 # and other constraints are in weak form9 topid = 410 LVendoid = 211 epiid = 112 bctop = DirichletBC(W.sub(0).sub(2), Expression(("0.0"), degree = 2), facetboundaries, topid)13 bcs = [bctop]14 elif (sim_geometry == "cylinder") or sim_geometry == "gmesh_cylinder":15 sim_type = protocol["simulation_type"][0]16 if sim_geometry == "cylinder" or sim_geometry == "gmesh_cylinder":17 center = 0.018 radius = 1.019 length = 10.020 else:21 center = 0.522 radius = 0.523 # hard coding in length for simple case24 length = 1.025 # defining parts of the model where the boundary condition should be applied later26 class Left(SubDomain):27 def inside(self, x, on_boundary):28 tol = 1E-1429 return on_boundary and abs(x[0]) < tol30 # where x[0] = 1031 class Right(SubDomain):32 def inside(self, x, on_boundary):33 tol = 1E-1434 return on_boundary and abs(x[0]-length) < tol35 class Fix_y(SubDomain):36 def inside(self, x, on_boundary):37 tol = 1E-1438 return near(x[0],0.0,tol) and near(x[1],center,tol)39 class Fix_y_right(SubDomain):40 def inside(self, x, on_boundary):41 tol = 1E-1442 return near(x[0],10.0,tol) and near(x[1],center,tol)43 class Fix_z_right(SubDomain):44 def inside(self, x, on_boundary):45 tol = 1E-1446 return near(x[0],10.0,tol) and near(x[2],center,tol)47 class Fix_z(SubDomain):48 def inside(self, x, on_boundary):49 tol = 1E-1450 return (near(x[0],0.0,tol) and near(x[2],center,tol))51 # Appropriately mark all facetboundaries52 facetboundaries.set_all(0)53 left = Left()54 right = Right()55 fix_y = Fix_y()56 fix_y_right = Fix_y_right()57 fix_z = Fix_z()58 fix_z_right = Fix_z_right()59 left.mark(facetboundaries, 1)60 right.mark(facetboundaries, 2)61 fix_y.mark(facetboundaries, 3)62 fix_z.mark(facetboundaries,5)63 # fix left face in x, right face is displacement (until traction bc may be triggered)64 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1)65 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)66 bcfix_y = DirichletBC(W.sub(0).sub(1), Constant((0.0)), fix_y, method="pointwise")67 bcfix_z = DirichletBC(W.sub(0).sub(2), Constant((0.0)), fix_z, method="pointwise")68 bcfix_y_right = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix_y_right, method="pointwise")69 bcfix_z_right = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix_z_right, method="pointwise")70 #bcright_after_switch = DirichletBC(W.sub(0).sub(0), disp_holder, facetboundaries, 2)71 bcs = [bcleft,bcfix_y,bcfix_z,bcfix_y_right,bcfix_z_right,bcright] # order matters!72 #if sim_type == "work_loop":73 marker_space = FunctionSpace(mesh,'CG',1)74 bc_right_test = DirichletBC(marker_space,Constant(1),facetboundaries,2)75 test_marker_fcn = Function(marker_space) # this is what we need to grab the displacement after potential shortening76 bc_right_test.apply(test_marker_fcn.vector())77 output["test_marker_fcn"] = test_marker_fcn78 print "KURTIS LOOK HERE, ASSIGNING PROTOCOL ARRAY"79 protocol["end_disp_array"] = np.zeros(int(protocol["simulation_duration"][0]/protocol["simulation_timestep"][0]))80 # storing this bc in the protocol dictionary bc it's already passed into update bcs81 #protocol["bcright_after"] = bcright_after_switch82 elif sim_geometry == "box_mesh":83 sim_type = protocol["simulation_type"][0]84 x_end = geo_options["end_x"][0]85 y_end = geo_options["end_y"][0]86 z_end = geo_options["end_z"][0]87 y_center = y_end/2.88 z_center = z_end/2.89 class Left(SubDomain):90 def inside(self, x, on_boundary):91 tol = 1E-1492 return on_boundary and abs(x[0]) < tol93 # where x[0] = 1094 class Right(SubDomain):95 def inside(self, x, on_boundary):96 tol = 1E-1497 return on_boundary and abs(x[0]-x_end) < tol98 class Fix_y(SubDomain):99 def inside(self, x, on_boundary):100 tol = 1E-14101 return near(x[0],0.0,tol) and near(x[1],y_center,tol)102 class Fix_y_right(SubDomain):103 def inside(self, x, on_boundary):104 tol = 1E-14105 return near(x[0],x_end,tol) and near(x[1],y_center,tol)106 class Fix_z_right(SubDomain):107 def inside(self, x, on_boundary):108 tol = 1E-14109 return near(x[0],x_end,tol) and near(x[2],z_center,tol)110 class Fix_z(SubDomain):111 def inside(self, x, on_boundary):112 tol = 1E-14113 return (near(x[0],0.0,tol) and near(x[2],z_center,tol))114 class Fix(SubDomain):115 def inside(self, x, on_boundary):116 tol = 1E-14117 #return on_boundary and abs(x[0]) < tol and abs(x[1]) < tol and abs(x[2]) < tol118 return (near(x[0],0.0,tol) and near(x[1],0.0,tol) and near(x[2],0.0,tol))119 class Fix2(SubDomain):120 def inside(self, x, on_boundary):121 tol = 1E-14122 return (near(x[0],0.0,tol) and near(x[1],0.0,tol) and near(x[2],z_end,tol))123 class Fix3(SubDomain):124 def inside(self, x, on_boundary):125 tol = 1E-14126 return (near(x[0],0.0,tol) and near(x[1],y_end,tol) and near(x[2],0.0,tol))127 class Fix_y_points_at_right_face(SubDomain):128 def inside(self, x, on_boundary):129 tol = 1E-3130 return (near(x[0],x_end,tol) and near(x[1],y_center,tol))131 class Fix_z_points_at_right_face(SubDomain):132 def inside(self, x, on_boundary):133 tol = 1E-3134 return (near(x[0],x_end,tol) and near(x[2],z_center,tol))135 class Fix_y_points_at_left_face(SubDomain):136 def inside(self, x, on_boundary):137 tol = 1E-3138 return (near(x[0],0.0,tol) and near(x[1],y_center,tol))139 class Fix_z_points_at_left_face(SubDomain):140 def inside(self, x, on_boundary):141 tol = 1E-3142 return (near(x[0],0.0,tol) and near(x[2],z_center,tol))143 class Left_back_midpoint(SubDomain):144 def inside(self, x, on_boundary):145 tol = 1E-14146 return (near(x[0],0.0,tol) and near(x[1],y_center,tol) and near(x[2],0.0,tol))147 class Left_top_midpoint(SubDomain):148 def inside(self, x, on_boundary):149 tol = 1E-14150 return (near(x[0],0.0,tol) and near(x[1],y_end,tol) and near(x[2],z_center,tol))151 class Left_front_midpoint(SubDomain):152 def inside(self, x, on_boundary):153 tol = 1E-14154 return (near(x[0],0.0,tol) and near(x[1],y_center,tol) and near(x[2],z_end,tol))155 class Left_bottom_midpoint(SubDomain):156 def inside(self, x, on_boundary):157 tol = 1E-14158 return (near(x[0],0.0,tol) and near(x[1],0.0,tol) and near(x[2],z_center,tol))159 # Appropriately mark all facetboundaries160 facetboundaries.set_all(0)161 left = Left()162 right = Right()163 fix_y = Fix_y()164 fix_y_right = Fix_y_right()165 fix_z = Fix_z()166 fix_z_right = Fix_z_right()167 fix = Fix()168 fix2 = Fix2()169 fix3 = Fix3()170 fix_y_points_at_right_face = Fix_y_points_at_right_face()171 fix_z_points_at_right_face = Fix_z_points_at_right_face()172 fix_y_points_at_left_face = Fix_y_points_at_left_face()173 fix_z_points_at_left_face = Fix_z_points_at_left_face()174 left_back_midpoint = Left_back_midpoint()175 left_top_midpoint = Left_top_midpoint()176 left_front_midpoint = Left_front_midpoint()177 left_bottom_midpoint = Left_bottom_midpoint()178 left.mark(facetboundaries, 1)179 right.mark(facetboundaries, 2)180 fix_y.mark(facetboundaries, 3)181 fix_z.mark(facetboundaries,5)182 # fix left face in x, right face is displacement (until traction bc may be triggered)183 if sim_type == "ramp_and_hold" or sim_type == "custom":184 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1)185 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)186 bcfix_y = DirichletBC(W.sub(0).sub(1), Constant((0.0)), fix_y, method="pointwise")187 bcfix_z = DirichletBC(W.sub(0).sub(2), Constant((0.0)), fix_z, method="pointwise")188 bcfix_y_right = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix_y_right, method="pointwise")189 bcfix_z_right = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix_z_right, method="pointwise")190 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise")191 bcfix2 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix2,method="pointwise")192 bcfix22 = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix2,method="pointwise")193 bcfix3 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix3,method="pointwise")194 bcfix33 = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix3,method="pointwise")195 #bcs = [bcleft,bcfix_y,bcfix_z,bcfix_y_right,bcfix_z_right,bcright] # order matters!196 bcs = [bcleft,bcfix,bcfix2,bcfix22,bcfix3,bcfix33,bcright]197 if sim_type == "traction_hold":198 print "traction simulation"199 # Similar to cylinder but without fixing displacement along y and z axes to prevent rotation200 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face201 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)202 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0203 bcfix2 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix2,method="pointwise")204 bcfix22 = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix2,method="pointwise")205 bcfix3 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix3,method="pointwise")206 bcfix33 = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix3,method="pointwise")207 bcs = [bcleft,bcfix,bcfix22,bcfix33] #order matters!208 if sim_type == "stress_strain_loop":209 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face210 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)211 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0212 bcfix2 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix2,method="pointwise")213 bcfix22 = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix2,method="pointwise")214 bcfix3 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix3,method="pointwise")215 bcfix33 = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix3,method="pointwise")216 bc_fix_y_rf = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix_y_points_at_right_face,method="pointwise")217 bc_fix_z_rf = DirichletBC(W.sub(0).sub(2), Constant((0.0)), fix_z_points_at_right_face,method="pointwise")218 bc_fix_y_lf = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix_y_points_at_left_face,method="pointwise")219 bc_fix_z_lf = DirichletBC(W.sub(0).sub(2), Constant((0.0)), fix_z_points_at_left_face,method="pointwise")220 bcleft_back_mp = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), left_back_midpoint,method="pointwise")221 bcleft_top_mp = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), left_top_midpoint,method="pointwise")222 bcleft_front_mp = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), left_front_midpoint,method="pointwise")223 bcleft_bottom_mp = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), left_bottom_midpoint,method="pointwise")224 #bcs = [bcleft,bcleft_back_mp,bcleft_top_mp,bcleft_front_mp,bcleft_bottom_mp,bc_fix_yz_rf1,bc_fix_yz_rf2,bcfix_yz_lf1,bcfix_yz_lf2]225 #bcs = [bcleft, bc_fix_y_rf, bc_fix_z_rf, bc_fix_y_lf, bc_fix_z_lf]226 bcs = [bcleft,bcfix,bcfix22,bcfix33,bc_fix_y_rf,bc_fix_z_rf]227 #print "KURTIS LOOK HERE, ASSIGNING PROTOCOL ARRAY"228 protocol["previous_end_disp"] = 0.0229 protocol["diastole"] = 1230 protocol["isovolumic"] = 0231 protocol["ejection"] = 0232 #if sim_type == "work_loop":233 marker_space = FunctionSpace(mesh,'CG',1)234 bc_right_test = DirichletBC(marker_space,Constant(1),facetboundaries,2)235 test_marker_fcn = Function(marker_space) # this is what we need to grab the displacement after potential shortening236 bc_right_test.apply(test_marker_fcn.vector())237 output["test_marker_fcn"] = test_marker_fcn238 elif sim_geometry == "unit_cube":239 sim_type = protocol["simulation_type"][0]240 print "sim type = " + sim_type241 output["test_marker_fcn"] = 0242 class Left(SubDomain):243 def inside(self, x, on_boundary):244 tol = 1E-14245 return on_boundary and abs(x[0]) < tol246 # where x[0] = 10247 class Right(SubDomain):248 def inside(self, x, on_boundary):249 tol = 1E-14250 return on_boundary and abs(x[0]-1.0) < tol251 # where x[2] = 0252 class Lower(SubDomain):253 def inside(self, x, on_boundary):254 tol = 1E-14255 return on_boundary and abs(x[2]) < tol256 class Top(SubDomain):257 def inside(self, x, on_boundary):258 tol = 1E-14259 return on_boundary and abs(x[2]-1.0) < tol260 # where x[1] = 0261 class Front(SubDomain):262 def inside(self, x, on_boundary):263 tol = 1E-14264 return on_boundary and abs(x[1]) < tol265 class Back(SubDomain):266 def inside(self, x, on_boundary):267 tol = 1E-14268 return on_boundary and abs(x[1]-1.) < tol269 # where x[0], x[1] and x[2] = 0270 class Fix(SubDomain):271 def inside(self, x, on_boundary):272 tol = 1E-14273 #return on_boundary and abs(x[0]) < tol and abs(x[1]) < tol and abs(x[2]) < tol274 return (near(x[0],0.0,tol) and near(x[1],0.0,tol) and near(x[2],0.0,tol))275 class Fix2(SubDomain):276 def inside(self, x, on_boundary):277 tol = 1E-14278 return (near(x[0],0.0,tol) and near(x[1],0.0,tol) and near(x[2],1.0,tol))279 class Fix3(SubDomain):280 def inside(self, x, on_boundary):281 tol = 1E-14282 return (near(x[0],0.0,tol) and near(x[1],1.0,tol) and near(x[2],0.0,tol))283 facetboundaries.set_all(0)284 left = Left()285 right = Right()286 fix = Fix()287 fix2 = Fix2()288 fix3 = Fix3()289 lower = Lower()290 front = Front()291 top = Top()292 back = Back()293 #294 left.mark(facetboundaries, 1)295 right.mark(facetboundaries, 2)296 fix.mark(facetboundaries, 3)297 lower.mark(facetboundaries, 4)298 front.mark(facetboundaries, 5)299 top.mark(facetboundaries, 6)300 back.mark(facetboundaries, 7)301 if sim_type == "ramp_and_hold" or sim_type == "custom":302 print "checking expression",expr["u_D"].u_D303 # Similar to cylinder but without fixing displacement along y and z axes to prevent rotation304 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face305 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)306 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0307 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face308 bcfront= DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries, 5) # u2 = 0 on front face309 bcfix2 = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)),fix2,method="pointwise")310 #bcfix22 = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix2,method="pointwise")311 bcfix3 = DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)),fix3,method="pointwise")312 #bcfix33 = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix3,method="pointwise")313 bcs = [bcleft,bcfix3,bclower,bcright] #order matters!314 # Trying shear315 """bcleft= DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), facetboundaries, 1) # u1 = 0 on left face316 bcleft2 = DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries, 1)317 bcright= DirichletBC(W.sub(0).sub(1), u_D, facetboundaries, 2)318 bcright2 = DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 2)319 bcright3 = DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 2)320 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0321 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face322 #bcs = [bcleft, bclower, bcfront,bcfix, bcright] #order matters!323 bcs = [bcleft, bcright,bcright2,bcright3]"""324 if sim_type == "ramp_and_hold_simple_shear":325 print "in simple shear bcs"326 bcleft= DirichletBC(W.sub(0), Constant((0.0,0.0,0.0)), facetboundaries, 1) # u1 = 0 on left face327 bcright= DirichletBC(W.sub(0).sub(1), expr["u_D"], facetboundaries, 2)328 bcright_x = DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 2)329 bcright_z = DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 2)330 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face331 bctop = DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 6)332 bcs = [bcleft, bcright, bcright_x,bclower]333 if sim_type == "ramp_and_hold_biaxial":334 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face335 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)336 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face337 bctop = DirichletBC(W.sub(0).sub(2), expr["u_front"], facetboundaries, 6)338 bcback = DirichletBC(W.sub(0).sub(1), expr["u_D"], facetboundaries, 7)339 bcfront = DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries,5)340 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0341 bcs = [bcleft, bcfront,bcback,bctop,bcright]342 if sim_type == "traction_hold":343 print "traction simulation"344 # Similar to cylinder but without fixing displacement along y and z axes to prevent rotation345 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face346 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)347 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0348 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face349 bcfront= DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries, 5) # u2 = 0 on front face350 bcfix2 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix2,method="pointwise")351 bcfix22 = DirichletBC(W.sub(0).sub(1), Constant((0.0)),fix2,method="pointwise")352 bcfix3 = DirichletBC(W.sub(0).sub(0), Constant((0.0)),fix3,method="pointwise")353 bcfix33 = DirichletBC(W.sub(0).sub(2), Constant((0.0)),fix3,method="pointwise")354 bcs = [bcleft,bcfix,bcfix22,bcfix33] #order matters!355 if sim_type == "work_loop":356 marker_space = FunctionSpace(mesh,'CG',1)357 bc_right_test = DirichletBC(marker_space,Constant(1),facetboundaries,2)358 test_marker_fcn = Function(marker_space) # this is what we need to grab the displacement after potential shortening359 bc_right_test.apply(test_marker_fcn.vector())360 output["test_marker_fcn"] = test_marker_fcn361 #print "KURTIS LOOK HERE, ASSIGNING PROTOCOL ARRAY"362 protocol["end_disp_array"] = np.zeros(int(protocol["simulation_duration"][0]/protocol["simulation_timestep"][0]))363 if sim_geometry == "unit_cube":364 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face365 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)366 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0367 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face368 bcfront= DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries, 5)369 bcs = [bcleft,bcfix,bclower,bcright]370 if sim_type == "stress_strain_loop":371 marker_space = FunctionSpace(mesh,'CG',1)372 bc_right_test = DirichletBC(marker_space,Constant(1),facetboundaries,2)373 test_marker_fcn = Function(marker_space) # this is what we need to grab the displacement after potential shortening374 bc_right_test.apply(test_marker_fcn.vector())375 output["test_marker_fcn"] = test_marker_fcn376 #print "KURTIS LOOK HERE, ASSIGNING PROTOCOL ARRAY"377 protocol["previous_end_disp"] = 0.0378 protocol["diastole"] = 1379 protocol["isovolumic"] = 0380 protocol["ejection"] = 0381 if sim_geometry == "unit_cube":382 bcleft= DirichletBC(W.sub(0).sub(0), Constant((0.0)), facetboundaries, 1) # u1 = 0 on left face383 bcright= DirichletBC(W.sub(0).sub(0), expr["u_D"], facetboundaries, 2)384 bcfix = DirichletBC(W.sub(0), Constant((0.0, 0.0, 0.0)), fix, method="pointwise") # at one vertex u = v = w = 0385 bclower= DirichletBC(W.sub(0).sub(2), Constant((0.0)), facetboundaries, 4) # u3 = 0 on lower face386 bcfront= DirichletBC(W.sub(0).sub(1), Constant((0.0)), facetboundaries, 5)387 bcs = [bcleft,bcfix,bclower]388 output["bcs"] = bcs...
modbus-sma-SBn_n-1AV-40.py
Source:modbus-sma-SBn_n-1AV-40.py
1# Supported hardware and firmware:2# Sunny Boy 3.0 / 3.6 / 4.0 / 5.03# Sunny Boy: SB3.0-1AV-40 / SB3.6-1AV-40 / SB4.0-1AV-40 / SB5.0-1AV-404# Starting with software package: 01.03.04.R5# Full list of readable registers - comment out registers you aren't interested in for faster performance6#7# Descriptions generated by using the following formula in SMA_Modbus-TI-en-26.xlsx - available from SMA web site8# =" ['"&A3&" - "&IFERROR(LEFT(B3,FIND(":",B3)-1),B3)&IF(C3<>""," ("&C3&")","")&"',"&A3&",'"&D3&"','"&E3&"'],"9#10# Note: The following manual updates were made:11# * Updates from STR32 to STR16 as the SMA doco appears to be wrong for 31017, 31025, 31033, 31041, 40159, 40167, 40175 and 4051312# * Remove extended characters from temperatures in 30953, 34109 and 3411313# * Comment out write only registers: 40015, 40016, 40018, 40022, 40023, 40024, 40025 and 4099914sma_registers = [15 ['30051 - Device class',30051,'U32','ENUM'],16 ['30053 - Device type',30053,'U32','ENUM'],17 ['30057 - Serial number',30057,'U32','RAW'],18 ['30059 - Software package',30059,'U32','FW'],19 ['30199 - Waiting time until feed-in (s)',30199,'U32','Duration'],20 ['30201 - Condition',30201,'U32','ENUM'],21 ['30203 - Nominal power in Ok Mode (W)',30203,'U32','FIX0'],22 ['30205 - Nominal power in Warning Mode (W)',30205,'U32','FIX0'],23 ['30207 - Nominal power in Fault Mode (W)',30207,'U32','FIX0'],24 ['30211 - Recommended action',30211,'U32','ENUM'],25 ['30213 - Message',30213,'U32','ENUM'],26 ['30215 - Fault correction measure',30215,'U32','ENUM'],27 ['30217 - Grid relay/contactor',30217,'U32','ENUM'],28 ['30225 - Insulation resistance (Ohms)',30225,'U32','FIX0'],29 ['30231 - Maximum active power device (W)',30231,'U32','FIX0'],30 ['30233 - Set active power limit (W)',30233,'U32','FIX0'],31 ['30247 - Current event number for manufacturer',30247,'U32','FIX0'],32 ['30513 - Total yield (Wh)',30513,'U64','FIX0'],33 ['30517 - Daily yield (Wh)',30517,'U64','FIX0'],34 ['30521 - Operating time (s)',30521,'U64','Duration'],35 ['30525 - Feed-in time (s)',30525,'U64','Duration'],36 ['30529 - Total yield (Wh)',30529,'U32','FIX0'],37 ['30531 - Total yield (kWh)',30531,'U32','FIX0'],38 ['30533 - Total yield (MWh)',30533,'U32','FIX0'],39 ['30535 - Daily yield (Wh)',30535,'U32','FIX0'],40 ['30537 - Daily yield (kWh)',30537,'U32','FIX0'],41 ['30539 - Daily yield (MWh)',30539,'U32','FIX0'],42 ['30541 - Operating time (s)',30541,'U32','Duration'],43 ['30543 - Feed-in time (s)',30543,'U32','Duration'],44 ['30559 - Number of events for user',30559,'U32','FIX0'],45 ['30561 - Number of events for installer',30561,'U32','FIX0'],46 ['30563 - Number of events for service',30563,'U32','FIX0'],47 ['30581 - Grid reference counter reading (Wh)',30581,'U32','FIX0'],48 ['30583 - Grid feed-in counter reading (Wh)',30583,'U32','FIX0'],49 ['30599 - Number of grid connections',30599,'U32','FIX0'],50 ['30769 - DC current input [1] (A)',30769,'S32','FIX3'],51 ['30771 - DC voltage input [1] (V)',30771,'S32','FIX2'],52 ['30773 - DC power input [1] (W)',30773,'S32','FIX0'],53 ['30775 - Power (W)',30775,'S32','FIX0'],54 ['30783 - Grid voltage phase L1 (V)',30783,'U32','FIX2'],55 ['30785 - Grid voltage phase L2 (V)',30785,'U32','FIX2'],56 ['30787 - Grid voltage phase L3 (V)',30787,'U32','FIX2'],57 ['30803 - Grid frequency (Hz)',30803,'U32','FIX2'],58 ['30805 - Reactive power (VAr)',30805,'S32','FIX0'],59 ['30813 - Apparent power (VA)',30813,'S32','FIX0'],60 ['30823 - Excitation type of cosPhi',30823,'U32','ENUM'],61 ['30825 - Operating mode of stat.V stab., stat.V stab. config.',30825,'U32','ENUM'],62 ['30829 - Reactive power set value as a % (%)',30829,'S32','FIX1'],63 ['30831 - cosPhi setpoint, cosPhi config., direct specif.',30831,'S32','FIX2'],64 ['30833 - cosPhi excit.type, cosPhi config., direct spec.',30833,'U32','ENUM'],65 ['30835 - Operating mode of feed-in management',30835,'U32','ENUM'],66 ['30837 - Active power limitation P, active power configuration (W)',30837,'U32','FIX0'],67 ['30839 - Active power limitation P, active power configuration (%)',30839,'U32','FIX0'],68 ['30865 - Power grid reference (W)',30865,'S32','FIX0'],69 ['30867 - Power grid feed-in (W)',30867,'S32','FIX0'],70 ['30925 - Connection speed of SMACOM A',30925,'U32','ENUM'],71 ['30927 - Duplex mode of SMACOM A',30927,'U32','ENUM'],72 ['30929 - Speedwire connection status of SMACOM A',30929,'U32','ENUM'],73 ['30949 - Displacement power factor ',30949,'U32','FIX3'],74 ['30953 - Internal temperature (C)',30953,'S32','TEMP'],75 ['30957 - DC current input [2] (A)',30957,'S32','FIX3'],76 ['30959 - DC voltage input [2] (V)',30959,'S32','FIX2'],77 ['30961 - DC power input [2] (W)',30961,'S32','FIX0'],78 ['30975 - Intermediate circuit voltage (V)',30975,'S32','FIX2'],79 ['30977 - Grid current phase L1 (A)',30977,'S32','FIX3'],80 ['30979 - Grid current phase L2 (A)',30979,'S32','FIX3'],81 ['30981 - Grid current phase L3 (A)',30981,'S32','FIX3'],82 ['31017 - Current speedwire IP address',31017,'STR16','UTF8'],83 ['31025 - Current speedwire subnet mask',31025,'STR16','UTF8'],84 ['31033 - Current speedwire gateway address',31033,'STR16','UTF8'],85 ['31041 - Current speedwire DNS server address',31041,'STR16','UTF8'],86 ['31085 - Nominal power in Ok Mode (W)',31085,'U32','FIX0'],87 ['31247 - Residual current (A)',31247,'S32','FIX3'],88 ['34109 - Heat sink temperature (C)',34109,'S32','TEMP'],89 ['34113 - Internal temperature (C)',34113,'S32','TEMP'],90 ['35377 - Number of events for user',35377,'U64','FIX0'],91 ['35381 - Number of events for installer',35381,'U64','FIX0'],92 ['35385 - Number of events for service',35385,'U64','FIX0'],93 ['40003 - Time zone',40003,'U32','ENUM'],94 ['40005 - Standard/Daylight saving time conversion on',40005,'U32','ENUM'],95 ['40009 - Operating condition',40009,'U32','ENUM'],96 ['40013 - Language of the user interface',40013,'U32','ENUM'],97# ['40015 - Normalized reactive power limitation by PV system ctrl (%)',40015,'S16','FIX1'], # Write only98# ['40016 - Normalized active power limitation by PV system ctrl (%)',40016,'S16','FIX0'], # Write only99# ['40018 - Fast shut-down',40018,'U32','ENUM'], # Write only100# ['40022 - Normalized reactive power limitation by PV system ctrl (%)',40022,'S16','FIX2'], # Write only101# ['40023 - Normalized active power limitation by PV system ctrl (%)',40023,'S16','FIX2'], # Write only102# ['40024 - Dis.pow.factor that can be changed via PV system ctrl',40024,'U16','FIX4'], # Write only103# ['40025 - Excitation type that can be changed by PV system ctrl',40025,'U32','ENUM'], # Write only104 ['40063 - Firmware version of the main processor',40063,'U32','FW'],105 ['40067 - Serial number',40067,'U32','RAW'],106 ['40109 - Country standard set',40109,'U32','ENUM'],107 ['40133 - Grid nominal voltage (V)',40133,'U32','FIX0'],108 ['40135 - Nominal frequency (Hz)',40135,'U32','FIX2'],109 ['40157 - Automatic speedwire configureation switched on',40157,'U32','ENUM'],110 ['40159 - Speedwire IP address',40159,'STR16','IP4'],111 ['40167 - Speedwire subnet mask',40167,'STR16','IP4'],112 ['40175 - Speedwire gateway address',40175,'STR16','IP4'],113 ['40183 - Phase assignment',40183,'U32','ENUM'],114 ['40185 - Maximum apparent power device (VA)',40185,'U32','FIX0'],115 ['40195 - Currently set apparent power limit (VA)',40195,'U32','FIX0'],116 ['40200 - Operating mode of stat.V stab., stat.V stab. config.',40200,'U32','ENUM'],117 ['40204 - Reactive power set value as a % (%)',40204,'S32','FIX1'],118 ['40206 - cosPhi setpoint, cosPhi config., direct specif.',40206,'S32','FIX2'],119 ['40208 - cosPhi excit.type, cosPhi config., direct spec.',40208,'U32','ENUM'],120 ['40210 - Operating mode of feed-in management',40210,'U32','ENUM'],121 ['40212 - Active power limitation P, active power configuration (W)',40212,'U32','FIX0'],122 ['40214 - Active power limitation P, active power configuration (%)',40214,'U32','FIX0'],123 ['40216 - Operating mode of active power reduction in case of overfrequency P(f)',40216,'U32','ENUM'],124 ['40218 - Difference between starting frequency and grid frequency, linear instantaneous power gradient configuration (Hz)',40218,'U32','FIX2'],125 ['40220 - Difference between reset frequency and grid frequency, linear instantaneous power gradient configuration (Hz)',40220,'U32','FIX2'],126 ['40222 - cosPhi at start point, cosPhi(P) char. config.',40222,'U32','FIX2'],127 ['40224 - Excit. type at start point, cosPhi(P) char. conf.',40224,'U32','ENUM'],128 ['40226 - cosPhi at end point, cosPhi(P) char. config.',40226,'U32','FIX2'],129 ['40228 - Excit. type at end point, cosPhi(P) char. config.',40228,'U32','ENUM'],130 ['40230 - Act. power at start point, cosPhi(P) char. config. (%)',40230,'U32','FIX0'],131 ['40232 - Act. power at end point, cosPhi(P) char. config. (%)',40232,'U32','FIX0'],132 ['40238 - Active power gradient, linear instantaneous power gradient configuration (%)',40238,'U32','FIX0'],133 ['40240 - Activation of stay-set indicator function, linear instantaneous power gradient configuration',40240,'U32','ENUM'],134 ['40242 - Active power gradient after reset frequency, linear instantaneous power gradient configuration (%)',40242,'U32','FIX0'],135 ['40428 - Frequency monitoring median maximum threshold (Hz)',40428,'U32','FIX2'],136 ['40430 - Frq. monitoring median max. threshold trip. time (ms)',40430,'U32','FIX0'],137 ['40432 - Frequency monitoring lower maximum threshold (Hz)',40432,'U32','FIX2'],138 ['40434 - Frq. monitoring lower max. threshold trip. time (ms)',40434,'U32','FIX0'],139 ['40436 - Frequency monitoring upper minimum threshold (Hz)',40436,'U32','FIX2'],140 ['40438 - Frq. monitoring upper min. threshold trip. time (ms)',40438,'U32','FIX0'],141 ['40440 - Frequency monitoring median minimum threshold (Hz)',40440,'U32','FIX2'],142 ['40442 - Frq. monitoring median min. threshold trip. time (ms)',40442,'U32','FIX0'],143 ['40448 - Voltage monitoring median maximum threshold (V)',40448,'U32','FIX2'],144 ['40450 - Voltage monitoring median max. threshold trip.time (ms)',40450,'U32','FIX0'],145 ['40452 - Voltage monitoring lower maximum threshold (V)',40452,'U32','FIX2'],146 ['40456 - Voltage monitoring lower max. threshold trip. time (ms)',40456,'U32','FIX0'],147 ['40458 - Voltage monitoring lower minimum threshold (V)',40458,'U32','FIX2'],148 ['40462 - Voltage monitoring lower min. threshold trip. time (ms)',40462,'U32','FIX0'],149 ['40464 - Voltage monitoring of median minimum threshold (V)',40464,'U32','FIX2'],150 ['40466 - Voltage monitoring median min. threshold trip.time (ms)',40466,'U32','FIX0'],151 ['40470 - Island network detect. status',40470,'U32','ENUM'],152 ['40484 - Activation of active power gradient',40484,'U32','ENUM'],153 ['40497 - MAC address',40497,'STR32','UTF8'],154 ['40513 - Speedwire DNS server address',40513,'STR16','IP4'],155 ['40631 - Device name',40631,'STR32','UTF8'],156 ['40789 - Communication version',40789,'U32','REV'],157 ['40915 - Set active power limit (W)',40915,'U32','FIX0'],158# ['40999 - Setpoint cos(phi) as per EEI convention',40999,'S32','FIX4'], # Write only159 ['41017 - Adjustment time of characteristic operating point, conf. of grid integr. char. 1 (s)',41017,'U32','FIX1'],160 ['41023 - Number of points to be used, conf. of grid integr. char. 1',41023,'U32','FIX0'],161 ['41025 - X-axes reference, conf. of grid integration char. 1',41025,'U32','ENUM'],162 ['41027 - Y-axes reference, conf. of grid integration char. 1',41027,'U32','ENUM'],163 ['41029 - X value 1, conf. of grid integr. char. 1',41029,'S32','FIX3'],164 ['41031 - Y value 1, conf. of grid integr. char. 1',41031,'S32','FIX3'],165 ['41033 - X value 2, conf. of grid integr. char. 1',41033,'S32','FIX3'],166 ['41035 - Y value 2, conf. of grid integr. char. 1',41035,'S32','FIX3'],167 ['41037 - X value 3, conf. of grid integr. char. 1',41037,'S32','FIX3'],168 ['41039 - Y value 3, conf. of grid integr. char. 1',41039,'S32','FIX3'],169 ['41041 - X value 4, conf. of grid integr. char. 1',41041,'S32','FIX3'],170 ['41043 - Y value 4, conf. of grid integr. char. 1',41043,'S32','FIX3'],171 ['41061 - 2nd characteristic curve number, configuration of characteristic curve mode',41061,'U32','FIX0'],172 ['41063 - 2nd activation of the characteristic curve, configuration of characteristic curve mode',41063,'U32','ENUM'],173 ['41065 - Adjustment time of char. operating point, conf. of grid integration char. 2 (s)',41065,'U32','FIX1'],174 ['41071 - Number of points to be used, conf. of grid integr. char. 2',41071,'U32','FIX0'],175 ['41073 - Input unit, conf. of grid integration char. 2',41073,'U32','ENUM'],176 ['41075 - Output frequency, conf. of grid integration char. 2',41075,'U32','ENUM'],177 ['41077 - X value 1, conf. of grid integr. char. 2',41077,'S32','FIX3'],178 ['41079 - Y value 1, conf. of grid integr. char. 2',41079,'S32','FIX3'],179 ['41081 - X value 2, conf. of grid integr. char. 2',41081,'S32','FIX3'],180 ['41083 - Y value 2, conf. of grid integr. char. 2',41083,'S32','FIX3'],181 ['41085 - X value 3, conf. of grid integr. char. 2',41085,'S32','FIX3'],182 ['41087 - Y value 3, conf. of grid integr. char. 2',41087,'S32','FIX3'],183 ['41089 - X value 4, conf. of grid integr. char. 2',41089,'S32','FIX3'],184 ['41091 - Y value 4, conf. of grid integr. char. 2',41091,'S32','FIX3'],185 ['41111 - Voltage monitoring of lower minimum threshold as RMS value (V)',41111,'U32','FIX2'],186 ['41113 - Voltage monitoring of lower min.threshold as RMS value for tripping time (ms)',41113,'U32','FIX0'],187 ['41115 - Voltage monitoring of upper maximum threshold as RMS value (V)',41115,'U32','FIX2'],188 ['41117 - Voltage monitoring of upper max. thresh. as RMS value for tripping time (ms)',41117,'U32','FIX0'],189 ['41121 - Set country standard',41121,'U32','FUNKTION_SEC'],190 ['41123 - Min. voltage for reconnection (V)',41123,'U32','FIX2'],191 ['41125 - Max. voltage for reconnection (V)',41125,'U32','FIX2'],192 ['41127 - Lower frequency for reconnection (Hz)',41127,'U32','FIX2'],193 ['41129 - Upper frequency for reconnection (Hz)',41129,'U32','FIX2'],194 ['41169 - Minimum insulation resistance (Ohms)',41169,'U32','FIX0'],195 ['41171 - Set total yield (kWh)',41171,'U32','FIX0'],196 ['41173 - Set total operating time at grid connection point (h)',41173,'U32','Duration'],197 ['41193 - Operating mode for absent active power limitation',41193,'U32','ENUM'],198 ['41195 - Timeout for absent active power limitation (s)',41195,'U32','Duration'],199 ['41197 - Fallback act power lmt P in % of WMax for absent act power lmt (%)',41197,'U32','FIX2'],200 ['41199 - Set active power limit at grid connection point (%)',41199,'U32','FIX0'],201 ['41203 - Nominal PV system power (W)',41203,'U32','FIX0'],202 ['41217 - Set active power limit at grid connection point (W)',41217,'U32','FIX0'],203 ['41219 - Operating mode for absent reactive power control',41219,'U32','ENUM'],204 ['41221 - Timeout for absent reactive power control (s)',41221,'U32','Duration'],205 ['41223 - Fallback react power Q in % of WMax for absent react power ctr (%)',41223,'S32','FIX2'],206 ['41225 - Operating mode for absent cos Phi spec',41225,'U32','ENUM'],207 ['41227 - Timeout for absent cos Phi spec (s)',41227,'U32','Duration'],208 ['41229 - Fallback cos Phi for absent cos Phi spec',41229,'S32','FIX4'],209 ['41253 - Fast shut-down',41253,'U32','ENUM'],210 ['41255 - Normalized active power limitation by PV system ctrl (%)',41255,'S16','FIX2'],211 ['41256 - Normalized reactive power limitation by PV system ctrl (%)',41256,'S16','FIX2'],212 ['41257 - Setpoint cos(phi) as per EEI convention',41257,'S32','FIX4'],213 ['43090 - Login with Grid Guard-Code',43090,'U32','FIX0']214 ]215# scan is not used for SMA inverters but solariot.py expects it to exist...
test_tutorial_macros.py
Source:test_tutorial_macros.py
1import numpy as np2import pandas as pd3from eskapade import process_manager, resources, DataStore4from eskapade_python.bases import TutorialMacrosTest5class DataQualityTutorialMacrosTest(TutorialMacrosTest):6 """Integration tests based on data quality tutorial macros"""7 def test_esk501(self):8 """Test Esk-501: fixing pandas dataframe"""9 # run Eskapade10 self.eskapade_run(resources.tutorial('esk501_fix_pandas_dataframe.py'))11 ds = process_manager.service(DataStore)12 self.assertIn('vrh', ds)13 self.assertIn('vrh_fix1', ds)14 self.assertIn('vrh_fix2', ds)15 self.assertIn('vrh_fix3', ds)16 self.assertIsInstance(ds['vrh'], pd.DataFrame)17 self.assertIsInstance(ds['vrh_fix1'], pd.DataFrame)18 self.assertIsInstance(ds['vrh_fix2'], pd.DataFrame)19 self.assertIsInstance(ds['vrh_fix3'], pd.DataFrame)20 self.assertEqual(len(ds['vrh'].index), 5)21 self.assertEqual(len(ds['vrh_fix1'].index), 5)22 self.assertEqual(len(ds['vrh_fix2'].index), 5)23 self.assertEqual(len(ds['vrh_fix3'].index), 5)24 self.assertIsInstance(ds['vrh']['B'].dtype, np.object)25 self.assertIsInstance(ds['vrh']['C'].dtype, np.object)26 self.assertIsInstance(ds['vrh']['D'].dtype.type(), np.float64)27 self.assertListEqual(ds['vrh']['A'].values.tolist(), [True, False, np.nan, np.nan, np.nan])28 self.assertListEqual(ds['vrh']['B'].values.tolist(), ['foo', 'bar', '3', np.nan, np.nan])29 self.assertListEqual(ds['vrh']['C'].values.tolist(), ['1.0', '2.0', 'bal', np.nan, np.nan])30 self.assertListEqual(ds['vrh']['D'].values.tolist()[:3], [1.0, 2.0, 3.0])31 self.assertListEqual(ds['vrh']['E'].values.tolist(), ['1', '2', 'bla', np.nan, np.nan])32 self.assertListEqual(ds['vrh']['F'].values.tolist(), ['1', '2.5', 'bar', np.nan, np.nan])33 self.assertListEqual(ds['vrh']['G'].values.tolist(), ['a', 'b', 'c', 'd', np.nan])34 self.assertListEqual(ds['vrh']['H'].values.tolist(), ['a', 'b', '1', '2', '3'])35 self.assertListEqual(ds['vrh_fix1']['A'].values.tolist()[:2], [1.0, 0.0])36 self.assertListEqual(ds['vrh_fix1']['B'].values.tolist(), ['foo', 'bar', '3', np.nan, np.nan])37 self.assertListEqual(ds['vrh_fix1']['C'].values.tolist()[:2], [1.0, 2.0])38 self.assertListEqual(ds['vrh_fix1']['D'].values.tolist()[:3], [1.0, 2.0, 3.0])39 self.assertListEqual(ds['vrh_fix1']['E'].values.tolist()[:2], [1, 2])40 self.assertListEqual(ds['vrh_fix1']['F'].values.tolist()[:3], ['1', '2.5', 'bar'])41 self.assertListEqual(ds['vrh_fix1']['G'].values.tolist(), ['a', 'b', 'c', 'd', np.nan])42 self.assertListEqual(ds['vrh_fix1']['H'].values.tolist()[2:5], [1.0, 2.0, 3.0])43 self.assertListEqual(ds['vrh_fix2']['B'].values.tolist()[2:3], [3])44 self.assertListEqual(ds['vrh_fix2']['C'].values.tolist(), ['1.0', '2.0', 'bal', np.nan, np.nan])45 self.assertListEqual(ds['vrh_fix3']['A'].values.tolist()[:2], [1.0, 0.0])46 self.assertListEqual(ds['vrh_fix3']['B'].values.tolist(), ['foo', 'bar', '3', 'not_a_str', 'not_a_str'])47 self.assertListEqual(ds['vrh_fix3']['C'].values.tolist()[:2], [1.0, 2.0])48 self.assertListEqual(ds['vrh_fix3']['D'].values.tolist()[:3], [1.0, 2.0, 3.0])49 self.assertListEqual(ds['vrh_fix3']['E'].values.tolist(), [1, 2, -999, -999, -999])50 self.assertListEqual(ds['vrh_fix3']['F'].values.tolist(), ['1', '2.5', 'bar', 'not_a_str', 'not_a_str'])51 self.assertListEqual(ds['vrh_fix3']['G'].values.tolist(), ['a', 'b', 'c', 'd', 'GREPME'])...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!