mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-29 01:14:24 +02:00
Relaxed the prohibition on ((S != 1) && (M != 1)) in device
network parallel/series networks. Instead, added a global option with command "property tolerance strict|relaxed" to reinstate the original (strict) behavior on demand, while relaxing it by default. This allows certain series/parallel networks to match numerically even though the schematic netlist may have combined individual devices.
This commit is contained in:
+14
-6
@@ -162,6 +162,10 @@ int right_col_end = 87;
|
||||
/* if TRUE, always partition ALL classes */
|
||||
int ExhaustiveSubdivision = 0;
|
||||
|
||||
/* if TRUE, enforce that networks (e.g., resistor) must match */
|
||||
/* topologically, as opposed to just matching numerically. */
|
||||
int ExactTopology = 0;
|
||||
|
||||
#ifdef TEST
|
||||
static void PrintElement_List(struct Element *E)
|
||||
{
|
||||
@@ -4932,13 +4936,17 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||
}
|
||||
}
|
||||
if (kl == NULL) {
|
||||
/* Prevent setting both M > 1 and S > 1 in any one */
|
||||
/* device, as it is ambiguous. */
|
||||
/* Setting both M > 1 and S > 1 is topologically */
|
||||
/* ambiguous. If global option ExactTopology is */
|
||||
/* enabled, then this will cause a failure. */
|
||||
/* Otherwise, it is allowed. */
|
||||
|
||||
if ((*matchfunc)(vl->key, other)) {
|
||||
if (vl->type == PROP_INTEGER)
|
||||
if (vl->value.ival > 1)
|
||||
fail = 1;
|
||||
if (ExactTopology) {
|
||||
if ((*matchfunc)(vl->key, other)) {
|
||||
if (vl->type == PROP_INTEGER)
|
||||
if (vl->value.ival > 1)
|
||||
fail = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (kl != NULL) {
|
||||
|
||||
@@ -7,6 +7,7 @@ extern struct nlist *Circuit1;
|
||||
extern struct nlist *Circuit2;
|
||||
|
||||
extern int ExhaustiveSubdivision;
|
||||
extern int ExactTopology;
|
||||
|
||||
extern int left_col_end;
|
||||
extern int right_col_end;
|
||||
|
||||
Reference in New Issue
Block a user