fenicsxconcrete.experimental_setup package

Submodules

fenicsxconcrete.experimental_setup.am_multiple_layers module

class AmMultipleLayers(parameters: dict[str, Quantity])[source]

Bases: Experiment

sets up a simple layered structure

all layers of the same height are on top of each other, the boundary on the bottom is fixed the mesh includes all (activation via pseudo-density)

parameters

parameter dictionary with units

p

parameter dictionary without units

create_body_force(v: Argument) Form[source]

defines body force for am experiments without element activation

element activation via pseudo density and incremental loading via parameter [“load_time”] computed in class concrete_am

Parameters:

v – test function

Returns:

form for body force

create_body_force_am(v: Argument, q_fd: Function, rule: QuadratureRule) Form[source]

defines body force for am experiments

element activation via pseudo density and incremental loading via parameter [“load_time”] computed in class concrete_am

Parameters:
  • v – test function

  • q_fd – quadrature function given the loading increment where elements are active

  • rule – rule for the quadrature function

Returns:

form for body force

create_displacement_boundary(V: FunctionSpace) list[DirichletBC][source]

defines displacement boundary as fixed at bottom

Parameters:

V – function space

Returns:

list of dirichlet boundary conditions

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup() None[source]

defines the mesh for 2D and 3D

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

fenicsxconcrete.experimental_setup.base_experiment module

class Experiment(parameters: dict[str, Quantity])[source]

Bases: ABC, LogMixin

base class for experimental setups

parameters

parameter dictionary with units

p

parameter dictionary without units

boundary_back() Callable[source]

specifies boundary: plane at front

only for 3D case front plane

Returns:

fct defining if dof is at boundary

boundary_bottom() Callable[source]

specifies boundary: plane at bottom

Returns: fct defining if dof is at boundary

boundary_front() Callable[source]

specifies boundary: plane at front

only for 3D case front plane

Returns:

fct defining if dof is at boundary

boundary_left() Callable[source]

specifies boundary: plane at left side

Returns:

fct defining if dof is at boundary

boundary_right() Callable[source]

specifies boundary: plane at left side

Returns:

fct defining if dof is at boundary

boundary_top() Callable[source]

specifies boundary: plane at top

Returns:

fct defining if dof is at boundary

create_body_force(v: Argument | None = None) Form | None[source]

defines empty body force function

Parameters:

v – test function

Returns:

if defined a form for the body force otherwise None

create_body_force_am(v: Argument | None = None, q_fd: Function | None = None, rule: QuadratureRule | None = None) Form | None[source]

defines empty body force function for am case

Parameters:
  • v – test function

  • q_fd – quadrature function given the loading increment where elements are active

  • rule – rule for the quadrature function

Returns:

if defined a form for the body force otherwise None

abstractmethod create_displacement_boundary(V: FunctionSpace) list[DirichletBC] | None[source]

defines empty displacement boundary conditions (to be done in child)

this function is abstract until there is a need for a material that does not need a displacement boundary once that is required, just make this a normal function that returns an empty list

Parameters:

V – function space

Returns:

if defined a list with displacement boundary conditions otherwise None

create_force_boundary(v: Argument | None = None) Form | None[source]

defines empty force boundary (to be done in child)

Parameters:

v – test function

Returns:

if defined a form for the force otherwise None

abstractmethod static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

must be defined in each child

Returns:

a dictionary with required parameters and a set of working values as example

abstractmethod setup()[source]

Is called by init, must be defined by child

fenicsxconcrete.experimental_setup.cantilever_beam module

class CantileverBeam(parameters: dict[str, Quantity] | None = None)[source]

Bases: Experiment

Sets up a cantilever beam, clamped on one side and loaded with gravity

parameters

parameter dictionary with units

p

parameter dictionary without units

create_body_force(v: Argument) Form[source]

defines body force

Parameters:

v – test function

Returns:

form for body force

create_displacement_boundary(V) list[source]

defines displacement boundary as fixed at bottom

Parameters:

V – function space

Returns:

list of dirichlet boundary conditions

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup() None[source]

defines the mesh for 2D or 3D

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

fenicsxconcrete.experimental_setup.compression_cylinder module

class CompressionCylinder(parameters: dict[str, Quantity] | None = None)[source]

Bases: Experiment

A cylinder mesh for a uni-axial displacement load

parameters

parameter dictionary with units

p

parameter dictionary without units

apply_displ_load(top_displacement: Quantity | float) None[source]

Updates the applied displacement load

Parameters:

top_displacement – Displacement of the top boundary in mm, > 0 ; tension, < 0 ; compression

create_displacement_boundary(V: FunctionSpace) list[DirichletBC][source]

Defines the displacement boundary conditions

Parameters:

V – Function space of the structure

Returns:

list of DirichletBC objects, defining the boundary conditions

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup() None[source]

Generates the mesh based on parameters

This function is called during __init__

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

generate_cylinder_mesh(radius: float, height: float, mesh_density: float, element_degree: int = 2) Mesh[source]

Uses gmsh to generate a cylinder mesh for fenics

Parameters:
  • radius – radius of the cylinder

  • height – height of the cylinder

  • mesh_density – defines the size of the elements and the minimum number of element edges in the height of the cylinder

  • element_degree – degree of the discretization elements, quadratic geometry by default

Returns:

cylinder mesh for dolfin

fenicsxconcrete.experimental_setup.simple_beam module

class SimpleBeam(parameters: dict[str, Quantity])[source]

Bases: Experiment

Sets up a simply supported beam, fix on the left

parameters

parameter dictionary with units

p

parameter dictionary without units

boundary_left() Callable[source]

specifies boundary at bottom

Returns:

fct defining boundary

boundary_right() Callable[source]

specifies boundary at bottom

Returns:

fct defining boundary

create_body_force(v: Argument) Form[source]

defines body force

Parameters:

v – test function

Returns:

form for body force

create_displacement_boundary(V) list[source]

defines displacement boundary as fixed at bottom

Parameters:

V – function space

Returns:

list of dirichlet boundary conditions

create_force_boundary(v: Argument) Form[source]

distributed load on top of beam

Parameters:

v – test function

Returns:

form for force boundary

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup()[source]

defines the mesh for 2D or 3D

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

fenicsxconcrete.experimental_setup.simple_cube module

class SimpleCube(parameters: dict[str, Quantity] | None = None)[source]

Bases: Experiment

sets up an uniaxial cube structure with displacement load

2D unit square or 3D unit cube with uniaxial boundary conditions displacement controlled for material model testing

parameters

parameter dictionary with units

p

parameter dictionary without units

apply_body_force() None[source]
apply_displ_load(top_displacement: Quantity | float) None[source]

Updates the applied displacement load

Parameters:

top_displacement – Displacement of the top boundary in mm, > 0 ; tension, < 0 ; compression

apply_temp_bc(T_bc: Quantity | float) None[source]

Updates the applied temperature boundary condition

Parameters:

T_bc1 – Temperature of the top boundary in degree Celsius

create_body_force(v: Argument) Form | None[source]

Defines the body force in either z or y direction depending on mesh dimension

Parameters:

v – test function

Returns:

if use_body_force flag is true the form for the body force, else None

create_displacement_boundary(V: FunctionSpace) list[DirichletBC][source]

Defines the displacement boundary conditions

Parameters:

V – Function space of the structure

Returns:

list of DirichletBC objects, defining the boundary conditions

create_temperature_bcs(V: FunctionSpace) list[DirichletBC][source]

defines empty temperature boundary conditions (to be done in child)

this function is abstract until there is a need for a material that does need a temperature boundary once that is required, just make this a normal function that returns an empty list

Parameters:

V – function space

Returns:

a list with temperature boundary conditions

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup() None[source]

Generates the mesh in 2D or 3D based on parameters

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

fenicsxconcrete.experimental_setup.tensile_beam module

class TensileBeam(parameters: dict[str, Quantity] | None = None)[source]

Bases: Experiment

Sets up a tensile beam experiment, clamped on one side and loaded with force on the other side

parameters

parameter dictionary with units

p

parameter dictionary without units

create_displacement_boundary(V) list[source]

Defines the displacement boundary conditions

Parameters:

V – Function space of the structure

Returns:

list of DirichletBC objects, defining the boundary conditions

create_force_boundary(v: Argument) Form[source]

distributed load on top of beam

Parameters:

v – test function

Returns:

form for force boundary

static default_parameters() dict[str, Quantity][source]

sets up a working set of parameter values as example

Returns:

dictionary with a working set of the required parameter

setup() None[source]

defines the mesh for 2D or 3D

Raises:

ValueError – if dimension (self.p[“dim”]) is not 2 or 3

Module contents