Thanks, Jean-Paul. I was thinking maybe something in the same way like 
step-40.

I tried your approach, but can I just set it equal to each other?

I did the following:

*Main class*
LA::MPI::Vector configurational_forces;
LA::MPI::Vector local_configurational_forces;

*setup_system() class*
configurational_forces.reinit(locally_owned_dofs, locally_relevant_dofs, 
mpi_com);

*compute_config_forces() class*
Vector<double> cell_cf(dofs_per_cell); // Cell Configurational forces

typename DoFHandler<dim>::active_cell_iterator cell = 
dof_handler.begin_active(), endc = dof_handler.end();
for (; cell != endc; ++cell)
{
if ( cell->is_locally_owned() )
{
fe_values.reinit(cell);

cell_cf = 0;

                ...

                // Configurational force computation ...

                ...
                
                cell->get_dof_indices(local_dof_indices);

                constraints.distribute_local_to_global(cell_cf, 
local_dof_indices, *local_configurational_forces*);
        }
}

*local_configurational_forces*.compress(VectorOperation::add);

*output_results() class*
// ========================[ CONFIGURATIONAL FORCES 
]==========================

configurational_forces = local_configurational_forces;  *(here I receive an 
error!)*

std::vector<std::string> configurational_forces_magnitude(dim, 
"config_forces");

std::vector<DataComponentInterpretation::DataComponentInterpretation> 
configurational_forces_interpretation(dim, 
DataComponentInterpretation::component_is_part_of_vector);

data_out.add_data_vector(configurational_forces, 
configurational_forces_magnitude, DataOut<dim>::type_dof_data, 
configurational_forces_interpretation);


I receive the following error:

make all 
Scanning dependencies of target solid_mechanics
[ 50%] Building CXX object 
CMakeFiles/solid_mechanics.dir/solid_mechanics.cc.o
/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc(950): 
error: no operator "=" matches these operands
            operand types are: const 
dealii::LinearAlgebraPETSc::MPI::Vector = const 
dealii::LinearAlgebraPETSc::MPI::Vector
  configurational_forces = local_configurational_forces;
                        ^
          detected during:
            instantiation of "void 
SolidMechanics<dim>::do_initial_timestep() [with dim=2]" at line 1081
            instantiation of "void SolidMechanics<dim>::run() [with dim=2]" 
at line 1113

compilation aborted for 
/home/seyedali/fe_models/deal.II/solid_mechanics/solid_mechanics.cc (code 2)
make[2]: *** [CMakeFiles/solid_mechanics.dir/solid_mechanics.cc.o] Fehler 2
CMakeFiles/solid_mechanics.dir/build.make:62: die Regel für Ziel 
„CMakeFiles/solid_mechanics.dir/solid_mechanics.cc.o“ scheiterte
CMakeFiles/Makefile2:195: die Regel für Ziel 
„CMakeFiles/solid_mechanics.dir/all“ scheiterte
make[1]: *** [CMakeFiles/solid_mechanics.dir/all] Fehler 2
Makefile:83: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2

I assume the size doesn't match. Can I really just write it like you 
suggested?

Kind regards,
S. A. Mohseni

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to