def simple_domain(): control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] boundary1 = BSplineElement(control_points) boundary2 = LineElement([[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]]) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries) return domain
def simple_domain(request): control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] boundary1 = BSplineElement(control_points, bcond={"type_one": True}) boundary2 = LineElement([[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]], bcond={"type_two": True}) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries, msh_format=request.param) return domain
def forms(): control_points_1 = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] control_points_2 = [[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]] boundary1 = BSplineElement(control_points_1, bcond={ "noslip": True, "heat_flux": 10 }) boundary2 = LineElement(control_points_2, bcond={ "impedance": 5, "isothermal": True }) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries) forms = TVAcousticWeakForm(domain, Re=1, Pe=1) return forms
el_size=el_size / 8.0, bcond={ "impedance": 0.0, "adiabatic": True }) domain_boundaries = ( boundary0, boundary1, boundary2, boundary3, boundary3a, boundary4, boundary5, ) domain = SimpleDomain(domain_boundaries) def normal_velocity(mode, solver): return dolf.assemble((dolf.dot(mode[1], solver.domain.n)) * solver.domain.ds(boundary5.surface_index)) def _stress(mode, solver): n = solver.domain.n return dolf.dot(dolf.dot(solver.forms.stress(mode[0], mode[1]), n), n) def stress(mode, solver): return dolf.assemble( _stress(mode, solver) * solver.domain.ds(boundary5.surface_index))
def domain(self): if self._domain is None: self._domain = SimpleDomain(self.domain_boundaries) return self._domain
from firecrest.mesh.boundaryelement import BSplineElement, LineElement from firecrest.mesh.geometry import SimpleDomain line_control_points = [[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]] bspline_control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] if __name__ == "__main__": bspline_boundary = BSplineElement(bspline_control_points) line_boundary = LineElement(line_control_points, el_size=0.1) domain = SimpleDomain([bspline_boundary, line_boundary])