BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Circuit.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_CIRCUIT_HPP
13#define BELFEM_CL_CIRCUIT_HPP
14#include "typedefs.hpp"
15#include "hdf5_types.hpp"
16
17namespace belfem
18{
19 class Circuit
20 {
21 public:
22
23 Circuit() = default ;
24 virtual ~Circuit() = default ;
25
26 // NON-COPYABLE, NON-MOVABLE. The base owns nothing itself and is
27 // abstract, so it cannot be sliced into a value. This is not what
28 // repairs the ElectricalCircuit double free -- the deletes on the
29 // derived class do that. It buys one narrower thing: a future
30 // subclass that owns allocations cannot stay IMPLICITLY copyable
31 // by forgetting to declare its own. A hand-written copy
32 // constructor that default-initializes this base is still
33 // possible, and is still that subclass's problem
34 Circuit( const Circuit & ) = delete ;
35 Circuit( Circuit && ) = delete ;
36 Circuit & operator=( const Circuit & ) = delete ;
37 Circuit & operator=( Circuit && ) = delete ;
38
39 virtual void
40 set_timestep( const real aTimestep ) = 0 ;
41
42 virtual void
43 set_omega( const real aOmega ) = 0 ;
44
45 virtual void
47
48 virtual void
50
51 virtual void
52 shift() = 0 ;
53
54 virtual void
55 shift_back() = 0 ;
56
57 virtual void
58 solve() = 0 ;
59
60 virtual real
61 residual() const = 0 ;
62
63 virtual real
64 current( const index_t aIndex ) const = 0 ;
65
66 virtual real
67 voltage( const index_t aIndex ) const = 0 ;
68
69 virtual void
70 set_current_and_voltage( const index_t aIndex, const real aI, const real aV ) = 0 ;
71
72 virtual void
74
75 virtual void
76 save_state( hid_t aFile ) = 0 ;
77
78 virtual void
79 load_state( hid_t aFile ) = 0 ;
80
81 };
82}
83#endif // BELFEM_CL_CIRCUIT_HPP
virtual void save_timestep()=0
virtual void solve()=0
Circuit(const Circuit &)=delete
virtual void set_current_and_voltage(const index_t aIndex, const real aI, const real aV)=0
Circuit & operator=(Circuit &&)=delete
virtual void save_state(hid_t aFile)=0
Circuit(Circuit &&)=delete
virtual real voltage(const index_t aIndex) const =0
virtual real residual() const =0
virtual void compute_MNA_matrix()=0
virtual void shift_back()=0
Circuit & operator=(const Circuit &)=delete
virtual void load_state(hid_t aFile)=0
virtual void set_timestep(const real aTimestep)=0
virtual void set_omega(const real aOmega)=0
virtual void compute_jacobian_and_rhs()=0
Circuit()=default
virtual real current(const index_t aIndex) const =0
virtual ~Circuit()=default
virtual void shift()=0
USER GUIDES:
Definition cl_Capacitor.cpp:16
int hid_t
Definition hdf5_types.hpp:20
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36