Commit 682f9db1 authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

New version

parent da034104
.svn
tests/solver_test001/matrices
solver_mtiluc2.cpp
solver_mtiluc2.hpp
solver_mtilu2.hpp
Tests/solver_test001/matrices
SyncToy*
cmake_minimum_required (VERSION 2.6)
project (INMOST)
set(SOURCE solver.cpp
solver_ani.cpp
solver_petsc.cpp
partitioner.cpp
algorithm.cpp
geometry.cpp
iterator.cpp
storage.cpp
eset.cpp
mesh_file.cpp
timer.cpp
face.cpp
edge.cpp
mesh.cpp
node.cpp
cell.cpp
tag.cpp
element.cpp
mesh_parallel.cpp
modify.cpp
earray.cpp
comparator.cpp
autodiff.cpp
solver_ddpqiluc2.cpp)
set(HEADER inmost.h
inmost_options_cmake.h
inmost_common.h
inmost_mesh.h
inmost_solver.h
inmost_partitioner.h
inmost_autodiff.h
container.hpp
io.hpp
solver_ilu2.hpp
solver_ddpqiluc2.hpp
solver_bcgsl.hpp
solver_prototypes.hpp)
add_subdirectory(Source)
add_definitions(${SOLVER_DEFINITIONS})
include_directories("Source/Headers")
set(INMOST_MAJOR_VERSION 0)
set(INMOST_MINOR_VERSION 1)
set(INMOST_PATCH_VERSION 0)
set(INMOST_VERSION "${INMOST_MAJOR_VERSION}.${INMOST_MINOR_VERSION}.${INMOST_PATCH_VERSION}")
if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_mtiluc2.hpp" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_mtiluc2.cpp" )
add_definitions(-DHAVE_SOLVER_MPTILUC2)
set(HAVE_SOLVER_MPTILUC2 TRUE)
list(APPEND HEADER solver_mtiluc2.hpp)
list(APPEND SOURCE solver_mtiluc2.cpp)
else()
set(HAVE_SOLVER_MPTILUC2 FALSE)
endif()
if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_mtilu2.hpp" )
add_definitions(-DHAVE_SOLVER_MPTILU2)
set(HAVE_SOLVER_MPTILU2 TRUE)
list(APPEND SOURCE solver_mtilu2.hpp)
else()
set(HAVE_SOLVER_MPTILU2 FALSE)
endif()
if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_fcbiilu2.h" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_fcbiilu2.cpp" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/fcbiilu2.cpp" )
add_definitions(-DHAVE_SOLVER_FCBIILU2)
set(HAVE_SOLVER_FCBIILU2 TRUE)
list(APPEND HEADER solver_fcbiilu2.h)
list(APPEND SOURCE solver_fcbiilu2.cpp fcbiilu2.cpp)
else()
set(HAVE_SOLVER_FCBIILU2 FALSE)
endif()
if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/solver_k3biilu2.h" AND EXISTS
"${CMAKE_CURRENT_SOURCE_DIR}/solver_k3biilu2.cpp" AND EXISTS
"${CMAKE_CURRENT_SOURCE_DIR}/k3d.h" AND EXISTS
"${CMAKE_CURRENT_SOURCE_DIR}/k3d.cpp" )
add_definitions(-DHAVE_SOLVER_K3BIILU2)
set(HAVE_SOLVER_K3BIILU2 TRUE)
list(APPEND HEADER solver_k3biilu2.h k3d.h)
list(APPEND SOURCE solver_k3biilu2.cpp k3d.cpp)
else()
set(HAVE_SOLVER_K3BIILU2 FALSE)
endif()
add_library(inmost STATIC ${SOURCE} ${HEADER})
......@@ -93,9 +23,9 @@ option(USE_MESH "Compile mesh capabilities" ON)
option(USE_SOLVER "Compile solver capabilities" ON)
option(USE_PARTITIONER "Compile partitioner capabilities" ON)
option(USE_AUTODIFF "Compile automatic differentiation capabilities" ON)
option(USE_NONLINEAR "Compile nonlinear solver capabilities" ON)
option(TEST_FORTRAN_ANI3D "Test for fortran availibility to compile ANI3D lib" OFF)
option(COMPILE_EXAMPLES "Compile examples" OFF)
#option(COMPILE_PROJECTS "Compile projects" OFF)
option(COMPILE_TESTS "Compile some tests" OFF)
option(USE_PARTITIONER_PARMETIS "Use ParMetis partitioner" OFF)
......@@ -145,8 +75,10 @@ if(USE_OMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
message("OpenMP FOUND")
else()
set(USE_OMP OFF)
message("OpenMP NOT FOUND")
endif()
endif()
......@@ -285,52 +217,65 @@ if(MSVC)
endif()
endif()
configure_file("inmost_options_cmake.h" "${PROJECT_BINARY_DIR}/inmost_options.h")
configure_file("Source/Headers/inmost_options_cmake.h" "${PROJECT_BINARY_DIR}/inmost_options.h")
include_directories("${PROJECT_BINARY_DIR}")
target_include_directories(inmost PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(inmost PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_include_directories(inmost PUBLIC $<INSTALL_INTERFACE:include>)
if(COMPILE_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(Examples)
endif(COMPILE_EXAMPLES)
#if(COMPILE_PROJECTS)
#add_subdirectory(projects)
#endif(COMPILE_PROJECTS)
if(COMPILE_TESTS)
enable_testing()
include(CTest)
add_subdirectory(tests)
add_subdirectory(Tests)
endif(COMPILE_TESTS)
set(INMOST_INSTALL_HEADERS inmost.h
inmost_options_cmake.h
inmost_common.h
inmost_mesh.h
inmost_solver.h
inmost_partitioner.h
inmost_autodiff.h
container.hpp)
set(INMOST_INSTALL_HEADERS Source/Headers/inmost.h
Source/Headers/inmost_autodiff.h
Source/Headers/inmost_common.h
Source/Headers/inmost_data.h
Source/Headers/inmost_expression.h
Source/Headers/inmost_mesh.h
Source/Headers/inmost_nonlinear.h
Source/Headers/inmost_partitioner.h
Source/Headers/inmost_solver.h
Source/Headers/inmost_sparse.h
Source/Headers/inmost_variable.h
Source/Headers/container.hpp)
include(CPack)
export(TARGETS inmost FILE inmost-targets.cmake)
export(PACKAGE inmost)
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Source/Headers" "${PROJECT_BINARY_DIR}")
configure_file(inmost-config.cmake.in "${PROJECT_BINARY_DIR}/inmost-config.cmake" @ONLY)
set(CONF_INCLUDE_DIRS "\${inmost_DIR}/include")
configure_file(inmost-config.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/inmost-config.cmake" @ONLY)
configure_file(inmost-config-version.cmake.in "${PROJECT_BINARY_DIR}/inmost-config-version.cmake" @ONLY)
set_property(TARGET inmost PROPERTY PUBLIC_HEADER
"${PROJECT_BINARY_DIR}/inmost_options.h"
"${PROJECT_SOURCE_DIR}/inmost.h"
"${PROJECT_SOURCE_DIR}/inmost_common.h"
"${PROJECT_SOURCE_DIR}/inmost_mesh.h"
"${PROJECT_SOURCE_DIR}/inmost_solver.h"
"${PROJECT_SOURCE_DIR}/inmost_partitioner.h"
"${PROJECT_SOURCE_DIR}/inmost_autodiff.h"
"${PROJECT_SOURCE_DIR}/container.hpp")
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_autodiff.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_common.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_data.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_expression.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_mesh.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_nonlinear.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_partitioner.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_solver.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_sparse.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_variable.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/container.hpp")
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/inmost-config.cmake"
......
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "INMOST")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=INMOST")
set(CTEST_DROP_SITE_CDASH TRUE)
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "inmost")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "localhost")
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=inmost")
set(CTEST_DROP_SITE_CDASH TRUE)
......@@ -85,3 +85,31 @@ INMOST::shell<*>{
)
)
}
;------------------------------------------------------------------------------
; INMOST::array
;------------------------------------------------------------------------------
INMOST::array<*>{
preview (
#(
"[",
$e.m_size,
"](",
#array(
expr: ($e.m_arr)[$i],
size: $e.m_size
),
")"
)
)
children (
#(
#([size] : $e.m_size),
#array(
expr: ($e.m_arr)[$i],
size: $e.m_size
)
)
)
}
......@@ -3,16 +3,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59408561-3', 'auto');
ga('send', 'pageview');
</script>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
......
set(SOURCE
${SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/autodiff.cpp
PARENT_SCOPE
)
set(HEADER
${HEADER}
PARENT_SCOPE
)
\ No newline at end of file
......@@ -16,7 +16,7 @@ namespace INMOST
#if defined(NEW_VERSION)
//! returns offset from the end of precomputed z
void Automatizator::DerivativeFill(expr & var, INMOST_DATA_ENUM_TYPE element, INMOST_DATA_ENUM_TYPE parent, Solver::Row & entries, INMOST_DATA_REAL_TYPE multval, void * user_data)
void Automatizator::DerivativeFill(expr & var, INMOST_DATA_ENUM_TYPE element, INMOST_DATA_ENUM_TYPE parent, Sparse::RowMerger & entries, INMOST_DATA_REAL_TYPE multval, void * user_data)
{
INMOST_DATA_ENUM_TYPE voffset = var.values_offset(element), doffset = var.derivatives_offset(element);
INMOST_DATA_ENUM_TYPE k = static_cast<INMOST_DATA_ENUM_TYPE>(var.data.size()-1);
......@@ -199,14 +199,17 @@ namespace INMOST
return EvaluateSub(var,0,ENUMUNDEF,user_data);
}
INMOST_DATA_REAL_TYPE Automatizator::Derivative(expr & var, const Storage & e, Solver::Row & out, Storage::real multiply, void * user_data)
INMOST_DATA_REAL_TYPE Automatizator::Derivative(expr & var, const Storage & e, Sparse::Row & out, Storage::real multiply, void * user_data)
{
INMOST_DATA_REAL_TYPE ret;
var.current_stencil.resize(1);
var.current_stencil[0] = stencil_pair(e->GetHandle(),1.0);
var.resize_for_stencil();
ret = EvaluateSub(var,0,ENUMUNDEF,user_data);
DerivativeFill(var, 0, ENUMUNDEF, out, multiply, user_data);
merger.PushRow(1.0,out);
DerivativeFill(var, 0, ENUMUNDEF, merger, multiply, user_data);
merger.RetriveRow(out);
merger.Clear();
return ret*multiply;
}
#else
......@@ -353,7 +356,7 @@ namespace INMOST
return 0.0;
}
//! returns offset from the end of precomputed values
void Automatizator::DerivativeFill(const expr & var, const Storage & e, Solver::Row & entries, precomp_values_t & values, INMOST_DATA_REAL_TYPE multval, void * user_data)
void Automatizator::DerivativeFill(const expr & var, const Storage & e, Sparse::RowMerger & entries, precomp_values_t & values, INMOST_DATA_REAL_TYPE multval, void * user_data)
{
assert(var.op != AD_NONE);
INMOST_DATA_REAL_TYPE lval, rval, ret;
......@@ -526,12 +529,16 @@ namespace INMOST
return 0.0;
}
INMOST_DATA_REAL_TYPE Automatizator::Derivative(const expr & var, const Storage & e, Solver::Row & out, Storage::real multiply, void * user_data)
INMOST_DATA_REAL_TYPE Automatizator::Derivative(const expr & var, const Storage & e, Sparse::Row & out, Storage::real multiply, void * user_data)
{
Sparse::RowMerger & m = GetMerger();
INMOST_DATA_REAL_TYPE ret;
precomp_values_t values;
ret = DerivativePrecompute(var, e, values, user_data);
DerivativeFill(var, e, out, values, multiply, user_data);
m.PushRow(1.0,out);
DerivativeFill(var, e, m, values, multiply, user_data);
m.RetriveRow(out);
m.Clear();
return ret*multiply;
}
#endif
......@@ -644,48 +651,56 @@ namespace INMOST
{
if (!it->indices.isSparse(etype))
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
}
}
else
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
}
}
}
else
{
if (!it->indices.isSparse(etype))
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
}
}
else
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt = last_num++;
}
}
}
}
}
......@@ -708,47 +723,55 @@ namespace INMOST
{
if (!it->indices.isSparse(etype))
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
}
}
else
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
indarr.resize(jt->RealArray(it->d.t).size());
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
}
}
}
else
{
if (!it->indices.isSparse(etype))
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask)))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
}
}
else
{
for (Mesh::iteratorElement jt = m->BeginElement(etype); jt != m->EndElement(); ++jt)
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
for (Mesh::iteratorStorage jt = m->Begin(etype); jt != m->End(); ++jt)
{
if ((!(etype & paralleltypes) || ((etype & paralleltypes) && jt->getAsElement()->GetStatus() != Element::Ghost)) && (jt->HaveData(it->d.t) && (it->d.domain_mask == 0 || jt->GetMarker(it->d.domain_mask))))
{
Storage::integer_array indarr = jt->IntegerArray(it->indices);
for (Storage::integer_array::iterator qt = indarr.begin(); qt != indarr.end(); ++qt)
*qt += first_num;
}
}
}
}
}
......@@ -762,7 +785,22 @@ namespace INMOST
}
}
#endif
// this version will fail in parallel
//merger.Resize(first_num,last_num,false);
// use this version until there is a way to define multiple intervals in RowMerger
INMOST_DATA_INTEGER_TYPE max_unknowns = m->AggregateMax(static_cast<INMOST_DATA_INTEGER_TYPE>(last_num));
#if defined(USE_OMP)
#pragma omp parallel
{
#pragma omp single
{
merger.resize(omp_get_num_procs());
}
merger[omp_get_thread_num()].Resize(0,max_unknowns,false);
}
#else
merger.Resize(0,max_unknowns,false);
#endif
}
/// register tag, data for which don't change through iterations
/// don't register tag twice
......
add_subdirectory(Data)
add_subdirectory(Mesh)
add_subdirectory(Io)
add_subdirectory(Solver)
add_subdirectory(NonlinearSolver)
add_subdirectory(Autodiff)
add_subdirectory(Partitioner)
add_subdirectory(Misc)
add_subdirectory(Headers)
set(SOLVER_DEFINITIONS ${SOLVER_DEFINITIONS} PARENT_SCOPE)
set(SOURCE ${SOURCE} PARENT_SCOPE)
set(HEADER ${HEADER} PARENT_SCOPE)
set(SOURCE
${SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/storage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tag.cpp
PARENT_SCOPE
)
set(HEADER
${HEADER}
PARENT_SCOPE
)
\ No newline at end of file
#include "inmost.h"
#if defined(USE_MESH)
#include <new>
namespace INMOST
{
Storage & Storage::operator =(Storage const & other)
{
handle = other.handle;
if( handle_link != NULL ) *handle_link = handle;
//else handle_link = other.handle_link; //if other have remote link this will copy this link and current will also be remote
m_link = other.m_link;
return *this;
}
Element Storage::reference_array::operator [](size_type n)
{