// returns a scaled version of the mesh, that is optimally scaled with respect to the target mesh. MeshType::Pointer normalizeScale(MeshType* mesh, MeshType* target) { double scalingFactor = computeScalingFactor(mesh, target); itk::ScaleTransform<double, 3>::Pointer scaleTransform = itk::ScaleTransform<double,3>::New(); scaleTransform->SetScale(scalingFactor); typedef itk::TransformMeshFilter<MeshType, MeshType, itk::Transform<double, 3> > TransformMeshFilterType; TransformMeshFilterType::Pointer transformMeshFilter = TransformMeshFilterType::New(); transformMeshFilter->SetInput(mesh); transformMeshFilter->SetTransform(scaleTransform); transformMeshFilter->Update(); MeshType::Pointer scaledMesh = transformMeshFilter->GetOutput(); return scaledMesh; }
Real CoupledGSTALDFmodel::computeQpOffDiagJacobian(unsigned int jvar) { computeLDFcoeff(); computeScalingFactor(); // Off-diagonal element for coupled gas if (jvar == _coupled_var_u) { return -_test[_i][_qp]*_ldf_coeff*_scaling_factor*CoupledGSTAisotherm::computeGSTAconcDerivative(); } // Off-diagonal element for coupled temperature if (jvar == _coupled_var_temp) { return -_test[_i][_qp]*_ldf_coeff*_scaling_factor*CoupledGSTAmodel::computeGSTAtempDerivative() + _test[_i][_qp]*_scaling_factor*computeLDFoffdiag()*(_u[_qp] - CoupledGSTAisotherm::computeGSTAequilibrium()); } return 0.0; }
Real CoupledGSTALDFmodel::computeQpJacobian() { computeLDFcoeff(); computeScalingFactor(); return _test[_i][_qp]*_ldf_coeff*_scaling_factor*_phi[_j][_qp] + _test[_i][_qp]*_u[_qp]*computeLDFjacobian() + _test[_i][_qp] * _phi[_j][_qp] * _du_dot_du[_qp]; }
Real CoupledGSTALDFmodel::computeQpResidual() { computeLDFcoeff(); computeScalingFactor(); return _ldf_coeff*_scaling_factor*CoupledGSTAisotherm::computeQpResidual() + _test[_i][_qp] * _u_dot[_qp]; }