Hello Daniel, Yes, I do. In addition to the files from my first post, here are the files for the issue with replicate_triangulation() function. These files are sufficient to test both merge_triangulation() and replicate_triangulation() functions for my problem.
Thanks Vinayak On Monday, November 20, 2023 at 4:30:14 PM UTC+1 [email protected] wrote: > Vinayak, > > Would you have a minimal reproducer? > > Best, > Daniel > > On Mon, Nov 20, 2023 at 4:13 AM Vinayak Vijay <[email protected]> wrote: > >> Hello, >> >> I also tried to do the same using the >> GridGenerator::replicate_triangulation(triangulation1,{2},triangulation2) >> function. This should result in a triangulation (triangulation1) to be >> repeated in the three-coordinate axis two times. However, it results in the >> same error. >> Please note that the triangulations are with dim=1 and spacedim=2. >> >> I am not sure where things are going wrong. Could someone help me with >> this? >> >> Thanks >> Vinayak >> On Thursday, November 16, 2023 at 10:05:11 AM UTC+1 Vinayak Vijay wrote: >> >>> Hello, >>> >>> I am trying to merge two triangulations into a single one. However, I am >>> getting the following error: >>> >>> An error occurred in line <11736> of file >>> </tmp/vinayak/spack-stage/spack-stage-dealii-9.4.2-4haiezd5dty7b537inhxmeebwxllx4gs/spack-src/source/grid/tria.cc> >>> >>> in function >>> void dealii::Triangulation<<anonymous>, <anonymous> >>> >::create_triangulation(const std::vector<dealii::Point<spacedim> >&, const >>> std::vector<dealii::CellData<dim> >&, const dealii::SubCellData&) [with int >>> dim = 1; int spacedim = 3] >>> The violated condition was: >>> !(correct(i, j) ^ (neighbor->direction_flag() == >>> (*cell)->direction_flag())) >>> Additional information: >>> (none) >>> >>> I am using the dealii 9.4.0 version. >>> >>> I have attached the two triangulations that need to be merged and the >>> .cc file to reproduce the error. >>> Can someone help me with this? >>> >>> Thanks >>> Vinayak >>> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/dealii/a9aaa852-3ad8-40c7-a0db-87d339c37cb2n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/dealii/a9aaa852-3ad8-40c7-a0db-87d339c37cb2n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/d566681b-8279-46bb-9be5-cf3e50f0d9c2n%40googlegroups.com.
triangulation2.vtk
Description: Binary data
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/grid_generator.h>
using namespace dealii;
int main()
{
Triangulation<1, 3> triangulation1;
GridIn<1, 3> grid_in1;
grid_in1.attach_triangulation(triangulation1);
std::ifstream input_file1("triangulation1.vtk");
grid_in1.read_vtk(input_file1);
Triangulation<1, 3> triangulation2;
GridIn<1, 3> grid_in2;
grid_in2.attach_triangulation(triangulation2);
std::ifstream input_file2("triangulation2.vtk");
grid_in2.read_vtk(input_file2);
// attempt to merge triangulation1 into triangulation2 using merge_triangulations
// GridGenerator::merge_triangulations(triangulation2, triangulation1, triangulation2);
// attempt to replicate triangulation2 (twice) in the three coordinate directions
Triangulation<1, 3> triangulation3;
GridGenerator::replicate_triangulation(triangulation2, {2}, triangulation3);
}
triangulation1.vtk
Description: Binary data
# Set the name of the project and target:
SET(TARGET "merge_test")
# Declare all source files the target consists of. Here, this is only
# the one step-X.cc file, but as you expand your project you may wish
# to add other source files as well. If your project becomes much larger,
# you may want to either replace the following statement by something like
# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc")
# FILE(GLOB_RECURSE TARGET_INC "include/*.h")
# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC})
# or switch altogether to the large project CMakeLists.txt file discussed
# in the "CMake in user projects" page accessible from the "User info"
# page of the documentation.
SET(TARGET_SRC
${TARGET}.cc
)
# Usually, you will not need to modify anything beyond this point...
CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)
FIND_PACKAGE(deal.II 9.4.0
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)
IF(NOT ${deal.II_FOUND})
MESSAGE(FATAL_ERROR "\n"
"*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
"You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to
cmake\n"
"or set an environment variable \"DEAL_II_DIR\" that contains this path."
)
ENDIF()
DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET} CXX)
DEAL_II_INVOKE_AUTOPILOT()
# ENABLE_TESTING()
# add_subdirectory(src)
# add_subdirectory(examples)
# add_subdirectory(tests)
