42 #include "libmesh/numeric_vector.h" 43 #include "libmesh/sparse_matrix.h" 44 #include "libmesh/dof_map.h" 45 #include "libmesh/petsc_nonlinear_solver.h" 46 #include "libmesh/petsc_vector.h" 54 _fluid_complex_solver (nullptr),
55 _fluid_complex_assembly (nullptr),
56 _pressure_function (nullptr),
57 _freq_domain_pressure_function (nullptr),
58 _complex_displ (nullptr)
122 (std::vector<libMesh::NumericVector<Real>*>& basis,
132 n_basis = (
unsigned int)basis.size();
141 mat.setZero(n_basis, n_basis);
143 std::vector<libMesh::dof_id_type> dof_indices;
146 std::unique_ptr<libMesh::NumericVector<Real> >
149 std::vector<libMesh::NumericVector<Real>*> localized_basis(n_basis);
155 for (
unsigned int i=0; i<n_basis; i++)
159 localized_zero.reset(localized_basis[0]->zero_clone().release());
171 for (
unsigned int i=0; i<n_basis; i++) {
191 const libMesh::DofMap& dof_map =
_system->
system().get_dof_map();
194 libMesh::MeshBase::const_element_iterator el =
196 const libMesh::MeshBase::const_element_iterator end_el =
201 for ( ; el != end_el; ++el) {
203 const libMesh::Elem* elem = *el;
205 dof_map.dof_indices (elem, dof_indices);
214 unsigned int ndofs = (
unsigned int)dof_indices.size();
217 basis_mat.setZero(ndofs, n_basis);
219 for (
unsigned int i=0; i<dof_indices.size(); i++) {
222 sol(i) = (*localized_solution)(dof_indices[i]);
224 for (
unsigned int j=0; j<n_basis; j++)
225 basis_mat(i,j) = (*localized_basis[j])(dof_indices[i]);
246 dof_map.constrain_element_vector(v1, dof_indices);
252 dof_map.constrain_element_vector(v1, dof_indices);
258 mat.col(i) += basis_mat.transpose() * vec;
272 for (
unsigned int i=0; i<basis.size(); i++)
273 delete localized_basis[i];
MAST::AssemblyElemOperations * _elem_ops
provides assembly elem operations for use by this class
MAST::NonlinearSystem & system()
MAST::FrequencyDomainPressureFunction * _freq_domain_pressure_function
small disturbance pressure function boundary condition for structures
virtual void set_elem_data(unsigned int dim, const libMesh::Elem &ref_elem, MAST::GeomElem &elem) const
sets the structural element y-vector if 1D element is used.
void init(const libMesh::NumericVector< Real > &steady_sol, const libMesh::NumericVector< Real > *small_dist_sol=nullptr)
initiate the mesh function for this solution
MAST::PressureFunction * _pressure_function
pressure function boundary condition for structures
MAST::ComplexAssemblyBase * _fluid_complex_assembly
virtual void clear_elem_operation_object()
clears the association of this object with the assembly element operation object. ...
virtual void elem_aerodynamic_force_calculations(ComplexVectorX &vec)
void set_assembly(MAST::ComplexAssemblyBase &assemble)
sets the assembly object for this solver
FSIGeneralizedAeroForceAssembly()
default constructor
void init(MAST::FluidStructureAssemblyElemOperations &fsi_elem_ops, MAST::ComplexSolverBase &complex_solver, MAST::ComplexAssemblyBase &complex_assembly, MAST::ComplexAssemblyElemOperations &fluid_elem_ops, MAST::PressureFunction &pressure_func, MAST::FrequencyDomainPressureFunction &freq_pressure_func, MAST::ComplexMeshFieldFunction &displ_func)
initializes for the given fluid and structural components.
Matrix< Complex, Dynamic, 1 > ComplexVectorX
uses a Gauss-Siedel method to solve the complex system of equations for a system. ...
This is a scalar function whose value can be changed and one that can be used as a design variable in...
virtual void set_elem_operation_object(MAST::AssemblyElemOperations &elem_ops)
attaches a element operation to this object, and associated this with the element operation object...
libMesh::NumericVector< Real > & imag_solution(bool if_sens=false)
virtual void set_elem_solution(const RealVectorX &sol)
sets the element solution
MAST::SystemInitialization * _system
System for which this assembly is performed.
void clear()
clear the solution and mesh function data structures
MAST::ComplexMeshFieldFunction * _complex_displ
flexible surface motion for fluid and structure
void clear_assembly()
clears the assembly object from this solver
libMesh::DenseVector< Real > DenseRealVector
virtual void init(const MAST::GeomElem &elem)
initializes the object for the geometric element elem.
virtual void solve_block_matrix(MAST::Parameter *p=nullptr)
solves the complex system of equations using block matrices.
Matrix< Real, Dynamic, Dynamic > RealMatrixX
void parallel_sum(const libMesh::Parallel::Communicator &c, RealMatrixX &mat)
Matrix< Complex, Dynamic, Dynamic > ComplexMatrixX
virtual void clear_discipline_and_system()
clears association with a system to this discipline, and vice-a-versa
void copy(DenseRealMatrix &m1, const RealMatrixX &m2)
void clear()
clear the solution
Matrix< Real, Dynamic, 1 > RealVectorX
void init(const libMesh::NumericVector< Real > &steady_sol, const libMesh::NumericVector< Real > &small_dist_sol_real, const libMesh::NumericVector< Real > &small_dist_sol_imag)
initiate the mesh function for this solution
std::unique_ptr< libMesh::NumericVector< Real > > build_localized_vector(const libMesh::System &sys, const libMesh::NumericVector< Real > &global) const
localizes the parallel vector so that the local copy stores all values necessary for calculation of t...
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
virtual void set_elem_velocity(const RealVectorX &vel)
sets the element velocity
virtual void assemble_generalized_aerodynamic_force_matrix(std::vector< libMesh::NumericVector< Real > * > &basis, ComplexMatrixX &mat, MAST::Parameter *p=nullptr)
calculates the reduced order matrix given the basis provided in basis.
This provides a wrapper FieldFunction compatible class that interpolates the solution using libMesh's...
void init(const libMesh::NumericVector< Real > &sol, const libMesh::NumericVector< Real > *dsol=nullptr)
initializes the data structures to perform the interpolation function of sol.
const libMesh::NumericVector< Real > * _base_sol
base solution about which this eigenproblem is defined.
virtual void clear_elem()
clears the element initialization
virtual void init(const libMesh::Elem &elem, const MAST::SystemInitialization &sys_init)
initialize the object for the specified reference elem.
libMesh::NumericVector< Real > & real_solution(bool if_sens=false)
~FSIGeneralizedAeroForceAssembly()
destructor
void init(const libMesh::NumericVector< Real > &sol_re, const libMesh::NumericVector< Real > &sol_im)
virtual void set_elem_acceleration(const RealVectorX &accel)
sets the element acceleration
virtual void clear_discipline_and_system()
clears association with a system to this discipline, and vice-a-versa
const libMesh::NumericVector< Real > & base_sol(bool if_sens=false) const
MAST::MeshFieldFunction * _sol_function
system solution that will be initialized before each solution
MAST::ComplexSolverBase * _fluid_complex_solver
complex solver