OpenPisco.Optim.Criteria.ComposedCriteria module#

OpenPisco.Optim.Criteria.ComposedCriteria.CheckIntegrity(GUI=False)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CheckIntegrity_SymbolicComposedCriteria(GUI=False)[source]#
class OpenPisco.Optim.Criteria.ComposedCriteria.ComposedCriteria(other=None)[source]#

Bases: CriteriaBase

GetInternalCriteria(i)[source]#
GetNumberOfInternalCriteria()[source]#
GetNumberOfSolutions()[source]#
classmethod GetNumberOfSolutions(self)[source]#

Retrieve the number of solutions of the current criterion :return: number of solutions :rtype: int

GetScalarsOutputs()[source]#
GetSolution(i)[source]#
GetSolutionName(i)[source]#
GetUpperBound()[source]#
SetUpperBound(val)[source]#
UpdateValues(point)[source]#
classmethod UpdateValues(self, point)[source]#

Update value and sensitivity of the criterion for the current levelset

Parameters

point (LevelSet) – current level set

Returns

paramater indicating if the update was successfull

Return type

bool

OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaFactor(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaOffset(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaPolynomialVanishing(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaPower(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaRatio(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriteriaWeighted(ops)[source]#
OpenPisco.Optim.Criteria.ComposedCriteria.CreateCriterionCyclicSymmetry(ops)[source]#
class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaFactor(other=None)[source]#

Bases: ComposedCriteria

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaOffset(other=None)[source]#

Bases: ComposedCriteria

Composed Criteria to apply an offset and/or the absolute values This can be used to simulate a target values with tolerance

g(x) = |f(x)-offset| g’(x) = g(x) * f’(x)

this is implemented with a sign function : sign(g(x)) = g(x)/|g(x)|

Parameters
  • offset (float) – offset to apply, by default 0.

  • absValue (bool) – if the absolute values is applied to the function, by default False

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaPolynomialVanishing(other=None)[source]#

Bases: ComposedCriteria

Allow to generate a polynomial constraint from a given one.

if J is the internal criterion and B is its upperbound, then the polynomial function is B*(J/B-1)*( (J/B-1)**2+1 )+ B https://royalsocietypublishing.org/doi/10.1098/rspa.2019.0861

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetSlack()[source]#
GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaPower(other=None)[source]#

Bases: ComposedCriteria

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

SetPower(value)[source]#
class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaRatio(other=None)[source]#

Bases: ComposedCriteria

Compute the derivative of the ratio of two given criteria

GetDenominatorCriteria()[source]#
GetNumeratorCriteria()[source]#
GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

SetInternalCriteria(numcriteria, dencriteria)[source]#
class OpenPisco.Optim.Criteria.ComposedCriteria.CriteriaWeighted(other=None)[source]#

Bases: ComposedCriteria

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetUpperBound()[source]#
GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

SetUpperBound(val)[source]#
class OpenPisco.Optim.Criteria.ComposedCriteria.CriterionCyclicSymmetry(other=None)[source]#

Bases: ComposedCriteria

Composed Criterion to impose a cyclic symmetry to the given sensitivity

This means that the sensitivity field looks the same after being rotated by an angle of (

rac{2pi}{nFold} ) radians.

It can be useful when the optimal geometry is expected to be symmetric but the boundary conditions are not The implementation uses the field transfer feature

nFoldint

fraction angle

axisstr

perform a planar rotation about a fixed axis

GetRotationMatrixAroundAxis(angle)[source]#
GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetTransferedNodalField(inField, inMesh, targetNodes)[source]#
GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

OpenPisco.Optim.Criteria.ComposedCriteria.OptToCriteria(ops, keysToRead=[], numberOfExpectedCriterion=1)[source]#

_summary_

Parameters
  • ops (_type_) – _description_

  • keysToRead (list, optional) – _description_, by default []

  • numberOfExpectedCriterion (int, optional) – -1 means at least one, by default 1

Returns

_description_

Return type

_type_

Raises
  • Exception – _description_

  • Exception – _description_

class OpenPisco.Optim.Criteria.ComposedCriteria.SymbolicComposedCriteria(other=None)[source]#

Bases: CriteriaBase

Eval()[source]#
GetNumberOfSolutions()[source]#
classmethod GetNumberOfSolutions(self)[source]#

Retrieve the number of solutions of the current criterion :return: number of solutions :rtype: int

GetSensitivity()[source]#
classmethod GetSensitivity()[source]#

Get the current value of the sensitivity :return: current value of the sensitivity :rtype: ndarray

GetValue()[source]#
classmethod GetValue()[source]#

Get the current value of the criterion :return: current value of the criterion :rtype: float

SetComposedSymbExpression(criteriaExpression, criteriaByName)[source]#
UpdateValues(point)[source]#
classmethod UpdateValues(self, point)[source]#

Update value and sensitivity of the criterion for the current levelset

Parameters

point (LevelSet) – current level set

Returns

paramater indicating if the update was successfull

Return type

bool