/// <summary> /// ctor, especially for the creation of vector fields /// </summary> /// <param name="DGDegreeImpliedBy"> /// This can be used to ensure that two or more fields in the code have equal DG polynomial Degree: /// if not null, the DG polynomial degree of the field is determined by another field with this name; /// E.g. if this argument is set to 'Psi', then the DG degree will be determined /// by the control file entry for field 'Psi', independent of what is specified for <paramref name="FieldIdentifications"/>. /// </param> /// <param name="DegreesMustBeEqual"> /// An exception is thrown if the degrees of all members in <paramref name="DegreesMustBeEqual"/> /// are not specified equal in the control file. /// </param> /// <param name="FieldIdentifications"> /// Names for the components of the Vector field (see <see cref="BoSSS.Foundation.DGField.Identification"/>); /// </param> /// <param name="CapDimension"> /// Only the first <em>D</em> entries of <paramref name="FieldIdentifications"/> and <paramref name="DGDegreeImpliedBy"/> /// will be considered, where <em>D</em> denotes the spatial dimension of the loaded grid; e.g. /// if <paramref name="FieldIdentifications"/> = {"u", "v", "w" }, but <em>D</em>=2, only {"v", "w" } /// will be taken. /// </param> /// <param name="ioListOpt"></param> public InstantiateFromControlFileAttribute(string[] FieldIdentifications, string[] DGDegreeImpliedBy = null, bool DegreesMustBeEqual = true, bool CapDimension = true, IOListOption ioListOpt = IOListOption.ControlFileDetermined) { m_ioListOpt = ioListOpt; m_DegreesMustBeEqual = DegreesMustBeEqual; m_CapDimension = CapDimension; m_IsVectorField = true; m_ControlFileNames = DGDegreeImpliedBy; m_FieldIdentifications = FieldIdentifications; }
#pragma warning restore 649 /// <summary> /// creates energy related fields /// </summary> public void CreateEnergyFields() { int D = this.GridData.SpatialDimension; IOListOption register = (this.Control.RegisterUtilitiesToIOFields) ? IOListOption.Always : IOListOption.ControlFileDetermined; if (this.Control.solveKineticEnergyEquation) { this.KineticEnergy = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), VariableNames.KineticEnergy); base.RegisterField(this.KineticEnergy); this.ResidualKineticEnergy = new XDGField(this.KineticEnergy.Basis, "ResidualKineticEnergy"); base.RegisterField(this.ResidualKineticEnergy); //this.prevKineticEnergy = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions["KineticEnergy"].Degree))); this.GeneratedKineticEnergy = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "GeneratedKineticEnergy"); base.RegisterField(this.GeneratedKineticEnergy, register); this.KineticEnergyChangerate = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "KineticEnergyChangerate"); base.RegisterField(this.KineticEnergyChangerate, register); } if (this.Control.ComputeEnergyProperties) { if (this.Control.TimesteppingMode == AppControl._TimesteppingMode.Transient) { prevVel = new XDGField[D]; for (int d = 0; d < D; d++) { prevVel[d] = new XDGField(this.XDGvelocity.Velocity[d].Basis); } } this.prevKineticEnergy = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "previousKineticEnergy"); base.RegisterField(this.prevKineticEnergy); this.DerivedKineticEnergy = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "DerivedKineticEnergy"); base.RegisterField(this.DerivedKineticEnergy, register); this.DerivedKineticEnergyChangerate = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "DerivedKineticEnergyChangerate"); base.RegisterField(this.DerivedKineticEnergyChangerate, register); this.KineticDissipation = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "KineticDissipation"); base.RegisterField(this.KineticDissipation, register); this.PowerOfStresses = new XDGField(new XDGBasis(this.LsTrk, (this.Control.FieldOptions[VariableNames.KineticEnergy].Degree)), "PowerOfStresses"); base.RegisterField(this.PowerOfStresses, register); } }
/// <summary> /// ctor /// </summary> /// <param name="FieldIdentification"> /// Specifies the name that the created DG field will have after instantiation (member <see cref="BoSSS.Foundation.DGField.Identification"/>); /// If null or empty, the identification of the field will be set equal to the member name. /// </param> /// <param name="DGDegreeImpliedBy"> /// This can be used to ensure that two or more fields in the code have equal DG polynomial Degree: /// if not null, the DG polynomial degree of the field is determined by another field with this name; /// E.g. if this argument is set to 'Psi', then the DG degree will be determined /// by the control file entry for field 'Psi', independent of what is specified for <paramref name="FieldIdentification"/>. /// </param> /// <param name="ioListOpt"></param> public InstantiateFromControlFileAttribute(string FieldIdentification = null, string DGDegreeImpliedBy = null, IOListOption ioListOpt = IOListOption.ControlFileDetermined) { m_ControlFileName = DGDegreeImpliedBy; if (m_ControlFileName != null && m_ControlFileName == "") { m_ControlFileName = null; } m_FieldIdentification = FieldIdentification; if (m_FieldIdentification != null && m_FieldIdentification == "") { m_FieldIdentification = null; } m_ioListOpt = ioListOpt; m_IsScalarField = true; }